[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
/usr/bin/nm and dlopen fix for HP-UX 10.20, 11.00
From: |
libtool-patches |
Subject: |
/usr/bin/nm and dlopen fix for HP-UX 10.20, 11.00 |
Date: |
Wed, 20 Jun 2001 13:41:55 -0500 |
User-agent: |
Mutt/1.2.5i |
/usr/bin/nm -p on HP-UX outputs one or two symbols. The current case
catches only one symbol. The patch below fixes this so two symbols are
recognized. The correct fix is to propagate $symcode to ltmain.sh
somehow but I've taken the short approach. I have run 'make check' and
all tests pass. This patch is against the 1.4 branch.
I'd also like to recommend a policy decision change in libtool.m4. We
should check for shl_load *first* on HP-UX. While dlopen() is
available, it works only when a patch is applied. Therefore, I suggest
we default to shl_load on HP-UX which requires no patch to work
properly.
2001-06-20 Albert Chin-A-Young <address@hidden>
* libtool.m4: Quote $symcode. Prefer shl_load to dlopen
on HP-UX because dlopen won't work properly without
a patch.
* ltmain.in: Handle case when output of /usr/bin/nm -p
emits more than one symbol. HP-UX sometimes emits two
symbols. Correct thing to do is recognized as many
$symcode symbols as output but we don't have access
to $symcode here.
--
albert chin (address@hidden)
-- snip snip
Index: libtool.m4
===================================================================
RCS file: /home/cvs/libtool/libtool.m4,v
retrieving revision 1.166
diff -u -3 -p -r1.166 libtool.m4
--- libtool.m4 2001/04/24 23:40:42 1.166
+++ libtool.m4 2001/06/20 18:32:06
@@ -188,7 +188,7 @@ cygwin* | mingw* | pw32*)
[symcode='[ABCDGISTW]']
;;
hpux*) # Its linker distinguishes data from code symbols
- lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char
\1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char
\1();/p' -e 's/^'$symcode'* .* \(.*\)$/extern char \1;/p'"
;;
irix*)
[symcode='[BCDEGRST]']
@@ -614,13 +614,14 @@ else
;;
*)
- AC_CHECK_LIB(dl, dlopen, [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_FUNC(dlopen, lt_cv_dlopen="dlopen",
- [AC_CHECK_FUNC(shl_load, lt_cv_dlopen="shl_load",
- [AC_CHECK_LIB(svld, dlopen,
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB(dld, shl_load,
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ AC_CHECK_FUNC(shl_load, lt_cv_dlopen="shl_load",
+ [AC_CHECK_LIB(dld, shl_load,
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"],
+ [AC_CHECK_LIB(dl, dlopen,
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_FUNC(dlopen, lt_cv_dlopen="dlopen",
+ [AC_CHECK_LIB(svld, dlopen,
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"])
])
])
])
Index: ltmain.in
===================================================================
RCS file: /home/cvs/libtool/ltmain.in,v
retrieving revision 1.259
diff -u -3 -p -r1.259 ltmain.in
--- ltmain.in 2001/04/24 23:22:34 1.259
+++ ltmain.in 2001/06/20 18:32:07
@@ -3302,8 +3306,13 @@ lt_preloaded_symbols[] =
{\
"
+ # Ick! No guarantee that symbol is one character. On
+ # HP-UX, it could be two. But what happens when some
+ # other OS has three or more? We no longer have
+ # access to $symcode though.
sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
-e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
+ -e 's/^.. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
< "$nlist" >> "$output_objdir/$dlsyms"
$echo >> "$output_objdir/$dlsyms" "\
- /usr/bin/nm and dlopen fix for HP-UX 10.20, 11.00,
libtool-patches <=