This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: darwin8 libjava support
Peter O'Gorman wrote:
Geoffrey Keating wrote:
Mike Stump <mrs@apple.com> writes:
I think this needs to be sent to the upstream libtool first...
I don't like this, I don't think it is necessary in upstream libtool. As
far as I know upstream libtool does not use $LD directly on darwin
anywhere, but gcc's libtool does, in reload_cmds. I think you need to
patch ltconfig to use "$CC -nostdlib ${wl}-r" instead of "$LD$reload_flag".
The attached patch should have the same effect as yours, it is the same,
more or less, as current upstream libtool. I haven't tested it properly,
sorry, but am about to go away for 4 days so thought it best to post it now
anyway. I needed to change ltcf-cxx.sh to use CC as CXX wasn't being set
anywhere, kinda strange. I also had some difficulties with fastjar not being
found during the build, but cheated and just edited the generated makefile
to point it at fastjar.
Peter
--
Peter O'Gorman - http://www.pogma.com
2005-03-29 Peter O'Gorman <peter@poga.com>
* ltcf-cxx.sh (archive_cmds) [darwin]: Use $CC, CXX is not set.
* ltconfig (reload_cmds) [darwin]: Use $CC -nostdlib ${wl}-r.
Index: ltcf-cxx.sh
===================================================================
RCS file: /cvsroot/gcc/gcc/ltcf-cxx.sh,v
retrieving revision 1.30
diff -u -r1.30 ltcf-cxx.sh
--- ltcf-cxx.sh 2 Oct 2004 16:33:06 -0000 1.30
+++ ltcf-cxx.sh 28 Mar 2005 22:31:39 -0000
@@ -255,7 +255,7 @@
esac
output_verbose_link_cmd='echo'
- archive_cmds='$CXX -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag,
Index: ltconfig
===================================================================
RCS file: /cvsroot/gcc/gcc/ltconfig,v
retrieving revision 1.32
diff -u -r1.32 ltconfig
--- ltconfig 2 Oct 2004 16:33:06 -0000 1.32
+++ ltconfig 28 Mar 2005 22:31:40 -0000
@@ -958,7 +958,12 @@
"" | " "*) ;;
*) reload_flag=" $reload_flag" ;;
esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+*darwin*)
+reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs' ;;
+*)
+reload_cmds='$LD$reload_flag -o $output$reload_objs' ;;
+esac
test -z "$deplibs_check_method" && deplibs_check_method=unknown
# PORTME Fill in your ld.so characteristics
@@ -1118,7 +1123,7 @@
can_build_shared=yes
;;
esac
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH