libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HP-UX 11.00 and parsing /bin/nm -p output (failing)


From: libtool-patches
Subject: Re: HP-UX 11.00 and parsing /bin/nm -p output (failing)
Date: Mon, 23 Apr 2001 15:28:52 -0500
User-agent: Mutt/1.1.12i

On Mon, Apr 23, 2001 at 02:11:52PM -0500, address@hidden wrote:
> This pertains to the HEAD branch.
> 
> When parsing the output of /bin/nm -p, libtool.m4 contains the
> following sed statement to massage the output:
> 
> # Try without a prefix undercore, then with it.
> for ac_symprfx in "" "_"; do
> 
>   # Write the raw and C identifiers.
> [lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[        ]\($symcode\)[
> ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"]
>
> So, there can be only *one* $symcode between spaces in the /bin/nm -p
> output. While creating demo/libtool during a run of 'make tests' for
> demo-conf.test, /bin/nm -p generates the following on the sample
> conftest.o file:
>   $ /bin/nm -p conftest.o
>   0000000008 t  D$0
>   0000000060 t  D$1
>   0000000008 T  main
>   0000000000 T  nm_test_func
>   0000000001 CS nm_test_var
> 
> [snip ...]
> 
> So, it seems there can be *more* than one $symcode. So, how about we
> change the sed statement to look for *more* than one $symcode
> separated by spaces? I have looked at the man pages of nm on Solaris
> and Tru64 UNIX and don't see anywhere that there is only one $symcode
> output.

Patch below.

-- 
albert chin (address@hidden)

-- snip snip
Index: libtool.m4
===================================================================
RCS file: /home/cvs/libtool/libtool.m4,v
retrieving revision 1.160
diff -u -3 -p -r1.160 libtool.m4
--- libtool.m4  2001/04/20 20:55:18     1.160
+++ libtool.m4  2001/04/23 20:21:37
@@ -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/^. .* \(.*\)$/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]']
@@ -218,7 +218,7 @@ fi
 for ac_symprfx in "" "_"; do
 
   # Write the raw and C identifiers.
-[lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[       ]\($symcode\)[  ][      
]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"]
+[lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[       ]\($symcode$symcode*\)[ 
        ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"]
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -274,7 +274,7 @@ const struct {
 [lt_preloaded_symbols[] =]
 {
 EOF
-         sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> 
conftest.$ac_ext
+         sed "s/^$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < 
"$nlist" >> conftest.$ac_ext
          cat <<\EOF >> conftest.$ac_ext
   {0, (lt_ptr_t) 0}
 };



reply via email to

[Prev in Thread] Current Thread [Next in Thread]