Subject: when and when not to use buildlink?
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 05/04/2004 08:11:02
I have my own glibc package which I have been using and improving for over
a year.

I am now using buildlink3.

But now it fails like:

/usr/bin/ld:/scratch/pkgsrc/new/glibc/work.puget/glibc-build/csu/abi-note.o:1:
ignoring invalid character `\000' in expression
/usr/bin/ld:/scratch/pkgsrc/new/glibc/work.puget/glibc-build/csu/abi-note.o:1:
ignoring invalid character `\003' in expression
...
/usr/bin/ld:/scratch/pkgsrc/new/glibc/work.puget/glibc-build/csu/abi-note.o:1:
parse error
collect2: ld returned 1 exit status
make[1]: *** [/scratch/pkgsrc/new/glibc/work.puget/glibc-build/libc.so]
Error 1

This is caused by some linker problem.

Please have a look at the the following diff comparing the last two lines
(split at one word per line) of my .work.log:

-[*]
-/scratch/pkgsrc/new/glibc/work.puget/.buildlink/bin/gcc
+<.>
+/scratch/pkgsrc/new/glibc/work.puget/.gcc/bin/gcc
 --specs=/scratch/pkgsrc/new/glibc/work.puget/new-gcc-specs-file
 -shared
 -static-libgcc
@@ -16,25 +16,28 @@
 __libc_main
 -u
 __register_frame
--L/scratch/pkgsrc/new/glibc/work.puget/glibc-build
--L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/math
--L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/elf
--L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/dlfcn
--L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/nss
--L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/nis
--L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/rt
--L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/resolv
--L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/crypt
--L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/linuxthreads
 -Wl,-rpath-link=/scratch/pkgsrc/new/glibc/work.puget/glibc-build:/scratch/pkgsrc/new/glibc/work.puget/glibc-build/math:/scratch/pkgsrc/new/glibc/work.puget/glibc-build/elf:/scratch/pkgsrc/new/glibc/work.puget/glibc-build/dlfcn:/scratch/pkgsrc/new/glibc/work.puget/glibc-build/nss:/scratch/pkgsrc/new/glibc/work.puget/glibc-build/nis:/scratch/pkgsrc/new/glibc/work.puget/glibc-build/rt:/scratch/pkgsrc/new/glibc/work.puget/glibc-build/resolv:/scratch/pkgsrc/new/glibc/work.puget/glibc-build/crypt:/scratch/pkgsrc/new/glibc/work.puget/glibc-build/linuxthreads
 -o
 /scratch/pkgsrc/new/glibc/work.puget/glibc-build/libc.so
 -T
-/scratch/pkgsrc/new/glibc/work.puget/glibc-build/libc.so.lds
 /scratch/pkgsrc/new/glibc/work.puget/glibc-build/csu/abi-note.o
 /scratch/pkgsrc/new/glibc/work.puget/glibc-build/elf/soinit.os
 /scratch/pkgsrc/new/glibc/work.puget/glibc-build/libc_pic.os
 /scratch/pkgsrc/new/glibc/work.puget/glibc-build/elf/sofini.os
 /scratch/pkgsrc/new/glibc/work.puget/glibc-build/elf/interp.os
 /scratch/pkgsrc/new/glibc/work.puget/glibc-build/elf/ld.so
+-I/scratch/pkgsrc/new/glibc/work.puget/.buildlink/include
+-L/scratch/pkgsrc/new/glibc/work.puget/glibc-build
+-L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/math
+-L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/elf
+-L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/dlfcn
+-L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/nss
+-L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/nis
+-L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/rt
+-L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/resolv
+-L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/crypt
+-L/scratch/pkgsrc/new/glibc/work.puget/glibc-build/linuxthreads
+-L/scratch/pkgsrc/new/glibc/work.puget/glibc-build
+-lclds
+-L/scratch/pkgsrc/new/glibc/work.puget/.buildlink/lib
 -lgcc

 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links
	  	 	 http://www.bsdnewsletter.com/