Subject: it works! (near)-current ld.elf_so successfully ported to the netbsd-1-6 branch!
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@NetBSD.ORG>
From: Greg A. Woods <>
List: netbsd-users
Date: 05/02/2004 18:58:27
Well, I finally did all of the things I should have done in the first
place to properly back-port the `-current' ld.elf_so to the netbsd-1-6
branch, as doing it the ``right'' way, i.e. using the exact changes
recorded in CVS and choosing a starting date that avoided most of the
potential back-porting headaches, resulted in success at last.

It works wonderfully on my Alpha, running mozilla-gtk2 with the
"expected" performance, i.e. a stellar improvement just as others have
reported from using the -current ld.elf_so binary.  I've also tested it
on i386 with good success and a noticable performance improvement when
running MozillaFirebird.  Hopefully I will soon be able to test it on
sparc too.

For those of you who, like me, would much rather build it directly from
source instead of grabbing the binary from a -current (or 2.0beta)
snapshot, here are the steps I followed:

- first get the right revs from approx. 2003/04/21, i.e. before the
  ansification and most other non-performance related recent changes:

	cd /usr/src/libexec
	mv ld.elf_so ld.elf_so-1.6.x
	cvs -d /cvs/master/m-NetBSD/main co -P -D 2003/04/21 -d ld.elf_so src/libexec/ld.elf_so

- back-port the Makefile with this patch:

Index: libexec/ld.elf_so/Makefile
RCS file: /cvs/master/m-NetBSD/main/src/libexec/ld.elf_so/Makefile,v
retrieving revision 1.61
diff -u -r1.61 Makefile
--- libexec/ld.elf_so/Makefile	25 Mar 2003 13:11:53 -0000	1.61
+++ libexec/ld.elf_so/Makefile	2 May 2004 22:38:04 -0000
@@ -1,7 +1,6 @@
 #	$NetBSD: Makefile,v 1.61 2003/03/25 13:11:53 scw Exp $
 .include <>			# for OBJECT_FMT definition
-.include <>			# for SHLINKINSTALLDIR definition
@@ -34,7 +33,11 @@
 SRCS+=	rtld.c reloc.c symbol.c malloc.c xmalloc.c xprintf.c debug.c \
 	map_object.c load.c search.c headers.c paths.c
+# make sure we don't trash the current one!
@@ -63,8 +66,8 @@
 ${PROG}: ${OBJS} ${DPADD}
 	${LD} ${LDFLAGS} -o ${PROG} ${OBJS} ${LDADD}
-.if ${SHLINKINSTALLDIR} != "/usr/libexec"
+.if ${SHLINKDIR} != "/usr/libexec"
+SYMLINKS+=	${SHLINKDIR}/${PROG} /usr/libexec/${PROG}
 .include <>

- next revert lukem's SIMPLEQ_* changes (cvs diff -D 2002/05/31 -D 2002/06/02 .):

	cvs diff -kk -r 1.12 -r 1.13 map_object.c | patch -R map_object.c
	cvs diff -kk -r 1.49 -r 1.50 rtld.c | patch -R rtld.c
	cvs diff -kk -r 1.15 -r 1.16 load.c | patch -R load.c
	cvs diff -kk -r 1.11 -r 1.12 symbol.c | patch -R symbol.c

	# and then fix line 84 from symbol.c.rej

- finally pull in the setproctitle() fix for alpha:

	cvs diff -kk -u -r 1.15 -r 1.16 arch/alpha/rtld_start.S | patch arch/alpha/rtld_start.S

Now if only I could figure out how to coerce mozilla-gtk2 to install its
own colour map when running on an 8-bit display.....

						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <>
Planix, Inc. <>          Secrets of the Weird <>