libraryopt
emBuild Software Design
vendor at embuildsw.com
Wed Sep 26 15:54:19 UTC 2007
On Tuesday 25 September 2007 11:52:00 pm Christian MICHON wrote:
> I found back the script: it's still in the uClibc tarball.
>
> Have a look at libstrip:
>
> uClibc-0.9.29\extra\libstrip\
Thanks very much.
The libstrip script is certainly a lot smaller than libraryopt.
The use by libstrip of a generated linker script with "EXTERN" statements is a
good solution, much better than what libraryopt does.
This is a step forward.
I worry about the following:
-- The invocation of gcc is missing most of the arguments that are used when
originally building libuClibc-0.9.28.so (presumeably 0.9.29 is similar), as
determined by turning on verbosity in the build for my particular target
(mips).
I would guess that libstrip has not been kept up to date or was never correct.
I of course would really like a solution that would "just work" when upgrading
to a new version of uClibc and that would "just work" for any target, perhaps
by using the same configuration information that is used for the original
build of the libraries....?
-- The script is for libuClibc-0.9.5.so . Apart from the version problem, the
script doesn't do anything for the other libraries.
-- The libstrip script doesn't pull in any non-referenced yet "required"
objects... from my experience so far, at least __uClibc_main.oS is required
but doesn't contain any symbols referenced from executables... and possibly
other objects are needed... in fact, this is one of my biggest questions
(alternately a list of "required" symbols could do the job).
Here is the invocation of gcc from libstrip:
`gcc -s -nostdlib -Wl,-warn-common -shared \\
-o libuClibc-0.9.5.so \\
-Wl,-soname,libc.so.0 -Wl,--script=ldscript \\
$topdir/libc/libc.a \\
$topdir/libc/tmp/libgcc-need.a`
And here is what i've found that i need for my target and libuClibc-0.9.8, to
regenerate the library exactly as it was originally made (to produce an
optimized version of the library of course requires changes):
soname=libc.so.0
striparg=-s
$archdir/bin/$archprefix'ld' \
-EB \
-shared \
--warn-common \
--warn-once \
-z combreloc \
-z relro \
-z now \
-init __uClibc_init \
-soname $soname \
$striparg \
-L $archdir/lib \
-o $dest.ref \
--whole-archive \
libc_so.a \
--no-whole-archive \
interp.os \
ld-uClibc.so.0 \
uclibc_nonshared.a \
libgcc.a
Any further insight into these issues would be appreciated, and of course an
entire fix would be nice... i'd like to help but can't really spare the time
to come sufficiently up to speed with the uClibc way of doing things to
propose such a fix.
Thanks again
-Ted Merrill
emBuild Software Design
More information about the uClibc
mailing list