Subject: buildlink3 and libtool-base and linking gcc3 libs
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 03/08/2004 23:59:28
Can anyone help with lang/gcc3-c/buildlink3.mk and buildlink3 to properly
buildlink the libraries for gcc3-c as installed to /usr/gcc3 for
libtool-base?

libtool-base failed with:

 checking for C compiler default output file name... configure: error: C
 compiler cannot create executables

work.puget/shlibtool/libtool-1.5.2/config.log tells me:

  /usr/bin/ld: cannot find -lgcc

And work.puget/shlibtool/.work.log shows:

[*]
/scratch/pkgsrc/devel/libtool-base/work.puget/shlibtool/.buildlink/bin/gcc
-g -I/usr/include -I/usr/include
-L/usr/gcc3/lib/gcc-lib/i386-pc-linux/3.3.2
-Wl,-R/usr/gcc3/lib/gcc-lib/i386-pc-linux/3.3.2 -L/usr/gcc3/lib
-Wl,-R/usr/gcc3/lib -L/usr/lib -Wl,-R/usr/lib conftest.c
<.> /scratch/pkgsrc/devel/libtool-base/work.puget/shlibtool/.gcc/bin/gcc
-g
-I/scratch/pkgsrc/devel/libtool-base/work.puget/shlibtool/.buildlink/include
-Wl,-R/usr/gcc3/lib/gcc-lib/i386-pc-linux/3.3.2 conftest.c
-L/scratch/pkgsrc/devel/libtool-base/work.puget/shlibtool/.buildlink/gcc3/lib/gcc-lib/i386-pc-linux/3.3.2
-L/scratch/pkgsrc/devel/libtool-base/work.puget/shlibtool/.buildlink/gcc3/lib
-L/scratch/pkgsrc/devel/libtool-base/work.puget/shlibtool/.buildlink/lib

My libgcc.a is here:

$ ls -l /usr/gcc3/lib/gcc-lib/i386-pc-linux/3.3.2/libgcc.a
-r--r--r--    1 root     root      2157998 Dec 19 13:09
/usr/gcc3/lib/gcc-lib/i386-pc-linux/3.3.2/libgcc.a

But buildlink3 did this:

$ ls -l work.puget/shlibtool/.buildlink/lib/
total 0

$ ls -l
work.puget/shlibtool/.buildlink/gcc3/lib/gcc-lib/i386-pc-linux/3.3.2
total 8
drwxr-xr-x    2 reed     reed         4096 Mar  8 23:06 include
drwxr-xr-x    3 reed     reed         4096 Mar  8 23:06 install-tools

(And that include directory has symlinks to .h files.)

The above should not be any "include" directory. It should be a link or
some reference to real /usr/gcc3/lib/gcc-lib/i386-pc-linux/3.3.2/lib*

This looks like it should not have the "usr/" on front:

 reed@puget:/usr/pkgsrc/devel/libtool-base$ bmake show-var
 PKG_PHASE=buildlink3 VARNAME=BUILDLINK_LIBDIRS.gcc3c
 lib usr/gcc3/lib/gcc-lib/i386-pc-linux/3.3.2

This should have my PREFIX, but it doesn't:

 reed@puget:/usr/pkgsrc/devel/libtool-base$ bmake show-var
 PKG_PHASE=buildlink3 VARNAME=BUILDLINK_PREFIX.gcc3c


So I added to my lang/gcc3-c/buildlink3.mk:
  BUILDLINK_PREFIX.gcc3c?=        ${PREFIX}

And then:

 reed@puget:/usr/pkgsrc/devel/libtool-base$ bmake show-var
 PKG_PHASE=buildlink3 VARNAME=BUILDLINK_LIBDIRS.gcc3c
 lib gcc3/lib/gcc-lib/i386-pc-linux/3.3.2

But that didn't help. A make clean and make later and still same problem
when configuring for shlibtool.

But I think it should have the "gcc/" removed too.

But GCC_PREFIX is unknown, so I modified lang/gcc3-c/buildlink3.mk to now
have instead:
  BUILDLINK_PREFIX.gcc3c?=        ${PREFIX}/gcc3

Which did:

 reed@puget:/usr/pkgsrc/devel/libtool-base$ bmake show-var
 PKG_PHASE=buildlink3 VARNAME=BUILDLINK_LIBDIRS.gcc3c
 lib lib/gcc-lib/i386-pc-linux/3.3.2

But that made work.puget/shlibtool/.buildlink/.buildlink_gcc3c_done have

/usr/gcc3/gcc3/lib/gcc-lib/i386-pc-linux/3.3.2/include/README: not found
...
(but no lib* files)

Can anyone help with lang/gcc3-c/buildlink3.mk and buildlink3 to properly
buildlink the libraries for gcc3-c as installed to /usr/gcc3 for
libtool-base?

Thank you,

   Jeremy C. Reed
   http://bsd.reedmedia.net/

p.s. This is under Linux with localbase as /usr as I have used to build
libtool-base many times for 1.5 years.