[Top][All Lists]
[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: |
Thu, 3 May 2001 13:11:09 -0500 |
User-agent: |
Mutt/1.1.12i |
On Mon, Apr 23, 2001 at 03:28:52PM -0500, address@hidden wrote:
> 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.
Ok, one more problem. Check out the following from ltmain.in (line
~3300):
sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
-e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
< "$nlist" >> "$output_objdir/$dlsyms"
It still assumes one $symcode. The side-effect of this is that self
dlopen fails (well, variables cannot be found). Making the change here
is more difficult because we don't have access to $symcode anymore. In
my patch, I used $symcode to be more precise in the sed statement than
simply adding 's/^.. ' to the already-existing 's/^. '. However, what
do we do here? Do we add the ugly hack of:
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"
I have tested this and it works.
--
albert chin (address@hidden)