linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* RE: Reducing glibc with mklibs.sh
@ 2001-10-18 13:07 Jean-Denis Boyer
  2001-10-24  2:04 ` Michael Habermann
  0 siblings, 1 reply; 16+ messages in thread
From: Jean-Denis Boyer @ 2001-10-18 13:07 UTC (permalink / raw)
  To: 'Michael Habermann'; +Cc: linuxppc-embedded


A couple of things are missing in your configuration for mklibs.sh
to properly work. I spent many hours finding what was the exact
configuration to have mklibs.sh properly works.
I understood when I installed Debian Linux on a PC,
and looked how the boot-floppies package was installed.
That was a lot easier than understanding the script.

First, the map files should be present along with the pic files.
Next, to properly reduce libc, mklibs.sh needs two or three
(depending on the glibc version) objects files:
    soinit.o sofini.o interp.o
AFAIK, mklibs.sh needs extra object files only for libc.

As an example, I successfully cross-reduced glibc-2.2.4 for powerpc-linux,
on my ix86 Redhat.
The files were installed in the following hierarchy:
  /usr/local/powerpc-linux/lib/libc_pic.a
  /usr/local/powerpc-linux/lib/libc_pic.map
  /usr/local/powerpc-linux/lib/libc_pic/interp.o
  /usr/local/powerpc-linux/lib/libc_pic/soinit.o
  /usr/local/powerpc-linux/lib/libc_pic/sofini.o

The map file is generated along with the pic file, when building the libc
package.
It may have a different name, like 'libc.map', but mklibs.sh looks for
'libc_pic.map'.
The object files are found under the directory elf/ (also in glibc build)
with the extension .os.

Note: I successfully reduced libpthread.so, also.

Good luck.
--------------------------------------------
 Jean-Denis Boyer, B.Eng., Technical Leader
 Mediatrix Telecom Inc.
 4229 Garlock Street
 Sherbrooke (Québec)
 J1L 2C8  CANADA
 (819)829-8749 x241
--------------------------------------------

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Reducing glibc with mklibs.sh
@ 2005-08-08 16:44 Orlov, Leonid
  0 siblings, 0 replies; 16+ messages in thread
From: Orlov, Leonid @ 2005-08-08 16:44 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

Hi,
Does anyone has an example of successful use of either libopt or
mklib.sh in redhat environmet?
I am having hard time to make it work.
I created a myLib library with 3 1 statement function and a main that
use only 2 of the myLib functions.
I am trying to have either tool to detect that only 2 out of 3 functions
are used and reduce myLib correspondingly. So far I have hard time to
have it work.
BTW does mklib dependent on Debian environment. I am using redhat
I am also wondering if Lineo released LIPO for public use.
I called them trying to get a commercial version, they excluded LIPO
from their offerings.
Thanks for your help.
Leonid Orlov

[-- Attachment #2: Type: text/html, Size: 1813 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Reducing glibc with mklibs.sh
@ 2005-07-26 16:53 Orlov, Leonid
  0 siblings, 0 replies; 16+ messages in thread
From: Orlov, Leonid @ 2005-07-26 16:53 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

Do you have an example of library reduction experience using mklibs.
I created a library with 3 functions and use only 2 in main.
I have hard time to make it work in this simple environment.
I must be missing something.
Thanks for your help.
Leonid Orlov
Los Angeles

[-- Attachment #2: Type: text/html, Size: 1085 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: Reducing glibc with mklibs.sh
@ 2001-10-29 22:36 Jean-Denis Boyer
  2001-10-30  2:00 ` Michael Habermann
  0 siblings, 1 reply; 16+ messages in thread
From: Jean-Denis Boyer @ 2001-10-29 22:36 UTC (permalink / raw)
  To: 'Michael Habermann'; +Cc: linuxppc-embedded


It looks like mklibs.sh does not find the map file for libm.

In your script:
> cp *.map ../lib/
might be bad, because the makefile of glibc produces libm.map,
while mklibs.sh looks for libm_pic.map (the name differs).

Either you rename the file when copying it, or you modify mklibs.sh.

--------------------------------------------
 Jean-Denis Boyer, B.Eng., Technical Leader
 Mediatrix Telecom Inc.
 4229 Garlock Street
 Sherbrooke (Québec)
 J1L 2C8  CANADA
 (819)829-8749 x241
--------------------------------------------

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: Reducing glibc with mklibs.sh
@ 2001-10-24 14:16 Jean-Denis Boyer
  2001-10-26  1:33 ` Michael Habermann
  0 siblings, 1 reply; 16+ messages in thread
From: Jean-Denis Boyer @ 2001-10-24 14:16 UTC (permalink / raw)
  To: 'Michael Habermann'; +Cc: linuxppc-embedded


> How have you done the libthread? Standard compilation for
> glibc produces
> _pic only for libc on my system. My libm is still quite large.

If the linuxthreads add-on is enabled in your glibc configuration, that
should produce pic & map files, in the following manner:
  ./linuxthreads/libpthread_pic.a
  ./libpthread.map

For libm, it is created in the same way:
  ./math/libm_pic.a
  ./libm.map

And it seems to work very weel for libm too.
No additional object files seems to be necessary, as for libc.

Regards,
--------------------------------------------
 Jean-Denis Boyer, B.Eng., Technical Leader
 Mediatrix Telecom Inc.
 4229 Garlock Street
 Sherbrooke (Québec)
 J1L 2C8  CANADA
 (819)829-8749 x241
--------------------------------------------

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Reducing glibc with mklibs.sh
@ 2001-10-17  8:03 Michael Habermann
  2001-10-17 12:30 ` Wolfgang Denk
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Habermann @ 2001-10-17  8:03 UTC (permalink / raw)
  To: linuxppc-embedded


I tried to reduce the size of my self-compiled glibc 2.2.2, with the debian
script mklibs.sh, but it terminates with the following output:

---
++ echo :/usr/local/powerpc-linux/glibc-2.2.2
++ sed -e 's/::*/:/g' -e 's/^://' -e 's/:$//' -e 's/:/ -L/g'
++ cat /tmp/,mklibs.21079/lib-dependencies
++ sed 's/^/-l/'
+ powerpc-linux-gcc -nostdlib -nostartfiles -shared -Wl,-soname=libc.so
-uabort -ualarm -uatoi -uatol -ubcopy -ubindtextdomain -ubzero -uchdir
-uclearerr -uclose -uclosedir -uconfstr -u__ctype_b -u__ctype_tolower
-udcgettext -udup -udup2 -uendpwent -uenviron -u_environ -u__environ
-u__errno_location -uexecve -uexit -ufclose@GLIBC_2.0 -ufclose@@GLIBC_2.1
-ufcntl -ufdopen@GLIBC_2.0 -ufdopen@@GLIBC_2.1 -uferror -ufflush -ufileno
-ufnmatch -ufork -ufprintf -ufputs -ufree -ufwrite -u__fxstat64@GLIBC_2.1
-u__fxstat64@@GLIBC_2.2 -ugetcwd -ugetdtablesize -ugetegid -ugetenv
-ugeteuid -ugetgid -ugetgroups -ugethostname -ugetpeername -ugetpid
-ugetppid -ugetpwnam -ugetpwuid -ugetrlimit64@GLIBC_2.1
-ugetrlimit64@@GLIBC_2.2 -ugetrusage -ugetuid -uglob_pattern_p
-ugroup_member -u_init -u_IO_putc -uisalpha -uisatty -uisdigit -ukill
-u__libc_start_main -ulongjmp -ulseek64 -u__lxstat64@GLIBC_2.1
-u__lxstat64@@GLIBC_2.2 -umalloc -umemcpy -uopen64 -uopendir -upathconf
-upipe -uprintf -uputchar -uputs -uqsort -uread -ureaddir64@GLIBC_2.1
-ureaddir64@@GLIBC_2.2 -ureadlink -urealloc -usbrk -usetgid -u_setjmp
-usetlocale -usetrlimit64 -usetuid -usetvbuf -usigaction -usigaddset
-usigdelset -usigemptyset -usiginterrupt -usigprocmask -usprintf -ustderr
-ustdin -ustdout -ustrcasecmp -ustrcat -ustrchr -ustrcmp -ustrcpy
-ustrerror -ustrlen -ustrncmp -ustrncpy -ustrrchr -ustrsignal -ustrtod
-ustrtol -ustrtoul -usysconf -utcgetattr -utcsetattr -utextdomain -utime
-uttyname -uumask -uunlink -uvfprintf -uwaitpid -uwrite
-u__xstat64@GLIBC_2.1 -u__xstat64@@GLIBC_2.2 -o /tmp/,mklibs.21079/lib-so
/usr/local/powerpc-linux/glibc-2.2.2/libc_pic.a -L/ppcroot/smalllib
-L/usr/local/powerpc-linux/glibc-2.2.2
/usr/local/powerpc-linux/bin/ld: /tmp/,mklibs.21079/lib-so: undefined
versioned symbol name sys_siglist@@GLIBC_2.1
/usr/local/powerpc-linux/bin/ld: failed to set dynamic section sizes: Bad value
collect2: ld returned 1 exit status
+ echo ./mklibs.sh: install-small-lib: powerpc-linux-gcc or
powerpc-linux-objcopy failed.
./mklibs.sh: install-small-lib: powerpc-linux-gcc or powerpc-linux-objcopy
failed.
+ exit 1
+ rm -fr /tmp/,mklibs.21079
---

The program call was:
----
#!/bin/sh
GCC=powerpc-linux-gcc \
OBJDUMP=powerpc-linux-objdump \
OBJCOPY=powerpc-linux-objcopy \
./mklibs.sh --verbose -L /usr/local/powerpc-linux/glibc-2.2.2 \
--dest-dir /ppcroot/smalllib \
/ppcroot/bin/bash
---

By default, only the libc_pic.a file is created. How can I create the other
PICs?

If you know any other tools to do this task, please let me know. Seems that
LIPO (Lineo) and LOT(HardHat) are not free.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2005-08-08 16:44 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-18 13:07 Reducing glibc with mklibs.sh Jean-Denis Boyer
2001-10-24  2:04 ` Michael Habermann
2001-10-24  2:21   ` Mark Hatle
  -- strict thread matches above, loose matches on Subject: below --
2005-08-08 16:44 Orlov, Leonid
2005-07-26 16:53 Orlov, Leonid
2001-10-29 22:36 Jean-Denis Boyer
2001-10-30  2:00 ` Michael Habermann
2001-10-24 14:16 Jean-Denis Boyer
2001-10-26  1:33 ` Michael Habermann
2001-10-17  8:03 Michael Habermann
2001-10-17 12:30 ` Wolfgang Denk
2001-10-17 16:28   ` Joe Green
2001-10-18  4:39     ` Michael Habermann
     [not found]       ` <01101808315200.14753@minotaur.mvista.com>
2001-10-19  0:04         ` Michael Habermann
2001-10-24  2:18         ` Michael Habermann
2001-10-26 17:48           ` Joe Green

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).