Subject: libtool on a.out - again!
To: None <packages@netbsd.org, tech-pkg@netbsd.org>
From: Nick Hudson <nick@nthcliff.demon.co.uk>
List: tech-pkg
Date: 09/06/2000 13:17:27
This is a multi-part message in MIME format.
--------------2E95DE8227809E2CDBA5A5A4
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

It seems as though libtool is broken for a couple (if not more) a.out
platforms. The platforms being arm32 (see PR/10908) and sparc (see
PR/8669). I've attached a patch that will revert libtool to using ld for
a.out platforms that I would like to commit during the freeze. Is this
OK?

The original reasoning for the cc -dumpspecs check was that /usr/lib
shouldn't be hardcoded as this breaks cross-compilation. I don't believe
that we need to be able to use libtool in a cross compilation enviroment
especially not in pkgsrc - a proper package would go in pkgsrc/cross,
right?

Comments, thoughts?

Nick
--------------2E95DE8227809E2CDBA5A5A4
Content-Type: text/plain; charset=us-ascii;
 name="libtool-diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="libtool-diff"

*** ../../patches/patch-aa	Sat Aug 26 08:35:19 2000
--- patch-ab	Wed Sep  6 12:38:18 2000
***************
*** 1,22 ****
! $NetBSD: patch-aa,v 1.12 2000/08/26 07:35:19 veego Exp $
! --- ./ltconfig.in.orig	Sat May 27 02:58:57 2000
! +++ ./ltconfig.in	Thu Jun 29 09:00:00 2000
! @@ -1194,11 +1194,20 @@
   
     netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  -      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  -      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
! +      if $CC -dumpspecs | grep 'c++rt0' >/dev/null; then
! +        # This a.out compiler supports the -shared option
! +        archive_cmds='$CC -shared -o $lib $libobjs $deplibs $wllinkopts'
! +      else
! +        archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
! +        wlarc=
! +        if test -f /usr/lib/c++rt0.o; then
! +          # Add in C++ constructor/destructor support
! +          archive_cmds="$archive_cmds /usr/lib/c++rt0.o"
! +        fi
  +      fi
       else
  -      archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
--- 1,18 ----
! $NetBSD$
! 
! --- ltconfig.in.orig	Sat May 27 02:58:57 2000
! +++ ltconfig.in
! @@ -1194,11 +1194,15 @@
   
     netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  -      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  -      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
! +      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
! +      wlarc=
! +      if test -f /usr/lib/c++rt0.o; then
! +        # Add in C++ constructor/destructor support
! +        archive_cmds="$archive_cmds /usr/lib/c++rt0.o"
  +      fi
       else
  -      archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
***************
*** 26,46 ****
       fi
       ;;
   
! @@ -1392,9 +1401,22 @@
   
     netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  -      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'  # a.out
! +      if $CC -dumpspecs | grep 'c++rt0' > /dev/null; then
! +        # This a.out compiler supports the -shared option
! +        archive_cmds='$CC -shared -o $lib $libobjs $deplibs $wllinkopts'
! +      else
! +        archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
! +        wl=
! +        if test -f /usr/lib/c++rt0.o; then
! +          # Add in C++ constructor/destructor support
! +          archive_cmds="$archive_cmds /usr/lib/c++rt0.o"
! +        fi
  +      fi
       else
  +      # I don't think there are any ELF toolchains with non-gnu ld.
--- 22,37 ----
       fi
       ;;
   
! @@ -1392,9 +1396,17 @@
   
     netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  -      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'  # a.out
! +      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
! +      wl=
! +      if test -f /usr/lib/c++rt0.o; then
! +        # Add in C++ constructor/destructor support
! +        archive_cmds="$archive_cmds /usr/lib/c++rt0.o"
  +      fi
       else
  +      # I don't think there are any ELF toolchains with non-gnu ld.
***************
*** 50,56 ****
       fi
       hardcode_libdir_flag_spec='${wl}-R$libdir'
       hardcode_direct=yes
! @@ -2012,6 +2034,9 @@
       finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
       dynamic_linker='NetBSD (a.out) ld.so'
     else
--- 41,47 ----
       fi
       hardcode_libdir_flag_spec='${wl}-R$libdir'
       hardcode_direct=yes
! @@ -2012,6 +2024,9 @@
       finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
       dynamic_linker='NetBSD (a.out) ld.so'
     else
***************
*** 60,66 ****
       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
       soname_spec='${libname}${release}.so$major'
       dynamic_linker='NetBSD ld.elf_so'
! @@ -2069,6 +2094,6 @@
     ;;
   
   solaris*)
--- 51,57 ----
       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
       soname_spec='${libname}${release}.so$major'
       dynamic_linker='NetBSD ld.elf_so'
! @@ -2069,7 +2084,7 @@
     ;;
   
   solaris*)


--------------2E95DE8227809E2CDBA5A5A4--