libtool
[Top][All Lists]
Advanced

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

RE: Got shared libraries to build with libtool on MinGW, but it was a st


From: Alan W. Irwin
Subject: RE: Got shared libraries to build with libtool on MinGW, but it was a struggle
Date: Fri, 16 Sep 2005 14:25:42 -0700 (PDT)

On 2005-09-16 21:16+0200 Peter Ekberg wrote:

* Alan W. Irwin wrote on Friday, September 16, 2005 19:22 CEST:
He reported for a specific case the following bad result from
the command line:

nm -f posix -A zlib.dll.a | \
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'

The expected "import" output did not appear.

However, if he tries instead

nm -f posix -A zlib.dll.a | \
sed -n -e '1,100{/ I /{x;/import/!{s/^.*/import/;h;p;};x;};}'
import

Note the expected "import" output does appear with this
change to the sed
logic.  To complete this here is the result of nm -f posix -A
zlib.dll.a
without the sed filtering:

zlib.dll.a[dt.o]: .bss b 00000000
zlib.dll.a[dt.o]: .data d 00000000
zlib.dll.a[dt.o]: .idata$4 i 00000000
zlib.dll.a[dt.o]: .idata$5 i 00000000
zlib.dll.a[dt.o]: .idata$7 i 00000000
zlib.dll.a[dt.o]: .text t 00000000
zlib.dll.a[dt.o]: __zlib_dll_a_iname I 00000000
zlib.dll.a[dh.o]: .bss b 00000000
zlib.dll.a[dh.o]: .data d 00000000
zlib.dll.a[dh.o]: .idata$2 i 00000000
zlib.dll.a[dh.o]: .idata$4 i 00000000
zlib.dll.a[dh.o]: .idata$5 i 00000000
zlib.dll.a[dh.o]: .text t 00000000
zlib.dll.a[dh.o]: __head_zlib_dll_a I 00000000
zlib.dll.a[dh.o]: __zlib_dll_a_iname U        
zlib.dll.a[dh.o]: fthunk i 00000004
zlib.dll.a[dh.o]: hname i 00000004
...

The strings with " I " in them trigger the rest of the sed
script which
is why at least the second form produces the "import" response.

I bet this is an end-of-line issue. There is probably a \r
that destroys something.

Anyway, this sed script should simler, faster, more robust
and equivalent.

sed -n -e '1,100{/ I /{s/.*/import/;p;q;};}'

However, I can't reproduce here so someone better test first...


Another huge virtue of your proposed change to the sed script is it is much
easier to understand without having to mentally juggle what is in pattern
space and what is in hold space.  I am most impressed by that
simplification, and I hope it is adopted by libtool (after testing).  For
what it is worth, it works fine on Linux

cat test.dat |sed -n -e '1,100{/ I /{s/.*/import/;p;q;};}'
import

where test.dat is filled with the above zlib.dll.a.... data.

I will pass on this version to the PLplot MinGW developer for him to test
using

nm -f posix -A zlib.dll.a | \
sed -n -e '1,100{/ I /{s/.*/import/;p;q;};}'

but I am positive it will work.

Alan

__________________________
Alan W. Irwin
email: address@hidden
phone: 250-727-2902

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________




reply via email to

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