This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: objc/2902: collect2 doesn't ...: libtool should use collect2?
- To: aoliva at redhat dot com (Alexandre Oliva)
- Subject: Re: objc/2902: collect2 doesn't ...: libtool should use collect2?
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Thu, 31 May 2001 18:38:53 -0400 (EDT)
- Cc: nicola at brainstorm dot co dot uk, gcc-bugs at gcc dot gnu dot org, libtool at gnu dot org
> OTOH, since we do know it is safe to link in libgcc, because it's PIC,
> we might just get rid of the -nostdlib, and let GCC do the library
> magic by itself. This should be good enough for objc.
>
> Could you test such a change and re-post the patch, in case it works?
It does. Test results for hppa1.1-hp-hpux10.20 are here:
<http://gcc.gnu.org/ml/gcc-testresults/2001-05/msg00734.html>. I
also ran `-static'. The revised patch is enclosed.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2001-05-31 John David Anglin <dave@hiauly1.hia.nrc.ca>
* ltcf-c.sh (archive_cmd): Use gcc to link shared archives when
$with_gcc = yes.
--- ltcf-c.sh.orig Sun May 20 14:57:40 2001
+++ ltcf-c.sh Thu May 31 18:34:37 2001
@@ -411,10 +411,17 @@
;;
hpux9* | hpux10* | hpux11*)
- case $host_os in
- hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
- *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
- esac
+ if test $with_gcc = yes; then
+ case "$host_os" in
+ hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
+ *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;;
+ esac
+ else
+ case $host_os in
+ hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
+ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
+ esac
+ fi
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes