[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
libtool 1.4.2 patch for AIX using -qmkshrobj
From: |
Don Anderson |
Subject: |
libtool 1.4.2 patch for AIX using -qmkshrobj |
Date: |
Mon, 29 Jul 2002 00:45:41 -0400 (EDT) |
Hello,
Who coordinates any patches for AIX? About a month or so ago, I sent
in a diff (against libtool 1.4.2) that uses the -qmkshrobj linker flag
in preference to the creating an export file. The idea is that
-qmkshrobj knows exactly what to export for languages that do name
mangling (like C++ or JNI libraries). Since we build C++ and JNI
libraries on AIX, this is very important to us.
It turns out that -qmkshrobj is not universally available on AIX
systems so I added something to detect its presence. The attached
patch reflects both the original change and the new detection test.
This patch is against 1.4.2 (which we use), not against the CVS
version, since that code base is somewhat different. If there's some
likelihood that this patch would be accepted, I can provide a tested,
cleaned up patch against the CVS version. I won't waste my time if
someone is already setup for delving into this or if (gasp) my efforts
would be ignored.
If possible, please copy address@hidden as well as the list.
Thanks!
- Don
*** libtool-1.4.2/libtool.m4 Mon Sep 10 23:16:01 2001
--- BerkeleyDB/aclocal/libtool.m4 Wed Jul 17 17:13:46 2002
***************
*** 1482,1487 ****
--- 1482,1496 ----
hardcode_direct=yes
archive_cmds=''
hardcode_libdir_separator=':'
+
+ #### Local change for Sleepycat's Berkeley DB [#5779]:
+ # Added $aix_export variable to control use of exports file.
+ # For non-gcc, we don't use exports files, and rather trust
+ # the binder's -qmkshrobj option to export all the mangled
+ # symbols we need for C++ and java.
+
+ aix_export="\${wl}$exp_sym_flag:\$export_symbols"
+
if test "$GCC" = yes; then
case $host_os in aix4.[[012]]|aix4.[[012]].*)
collect2name=`${CC} -print-prog-name=collect2`
***************
*** 1514,1519 ****
--- 1523,1544 ----
shared_flag='${wl}-bM:SRE'
fi
fi
+
+ # Test for -qmkshrobj and use it if it's available.
+ # It's superior for determining exportable symbols,
+ # especially for C++ or JNI libraries, which have
+ # mangled names.
+ #
+ AC_LANG_CONFTEST(void f(){})
+ if AC_TRY_EVAL(CC -c conftest.c) && AC_TRY_EVAL(CC -o conftest
conftest.$ac_objext -qmkshrobj -lC_r); then
+ lt_cv_aix_mkshrobj=yes
+ else
+ lt_cv_aix_mkshrobj=no
+ fi
+
+ if test "$lt_cv_aix_mkshrobj" = yes; then
+ aix_export="-qmkshrobj"
+ fi
fi
# It seems that -bexpall can do strange things, so it is better to
***************
*** 1524,1535 ****
# -berok will link without error, but may produce a broken library.
allow_undefined_flag='-berok'
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
! archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs
$compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo
"${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag
\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
allow_undefined_flag="-z nodefs"
! archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname
${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag}
'"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
else
hardcode_libdir_flag_spec='${wl}-bnolibpath
${wl}-blibpath:$libdir:/usr/lib:/lib'
# Warning - without using the other run time loading flags,
--- 1549,1560 ----
# -berok will link without error, but may produce a broken library.
allow_undefined_flag='-berok'
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
! archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs
$compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo
"${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag $aix_export
$shared_flag"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
allow_undefined_flag="-z nodefs"
! archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname
${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag}
'"\${wl}$no_entry_flag $aix_export"
else
hardcode_libdir_flag_spec='${wl}-bnolibpath
${wl}-blibpath:$libdir:/usr/lib:/lib'
# Warning - without using the other run time loading flags,
***************
*** 1537,1543 ****
allow_undefined_flag='${wl}-berok'
# This is a bit strange, but is similar to how AIX traditionally builds
# it's shared libraries.
! archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname
$libobjs $deplibs $compiler_flags ${allow_undefined_flag}
'"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo
$objdir/$libname$release.a $objdir/$soname'
fi
fi
;;
--- 1562,1568 ----
allow_undefined_flag='${wl}-berok'
# This is a bit strange, but is similar to how AIX traditionally builds
# it's shared libraries.
! archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname
$libobjs $deplibs $compiler_flags ${allow_undefined_flag}
'"\${wl}$no_entry_flag $aix_export"' ~$AR -crlo $objdir/$libname$release.a
$objdir/$soname'
fi
fi
;;
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Remember to send requests for assistance on
new problems to address@hidden
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Anderson address@hidden
Sleepycat Software Inc. +1-978-287-4781
118 Tower Rd. http://www.sleepycat.com
Lincoln, MA 01773
- libtool 1.4.2 patch for AIX using -qmkshrobj,
Don Anderson <=