irclog2html for uclibc on 2002.08.22

00:00:05tzangerI have a small .tgz that demonstrates it if you have a couple of minutes
00:10:37bug1is the library your calling stripped ?
00:10:54bug1that might muck things up
00:11:12tzangerno
00:11:20tzangeror at least I'm pretty sure it's not
00:11:31tzangerwww.mixdown.org/andrewtest.tgz is the mini test
00:11:47tzangerall it is is a shared lib that calls a zlib function and two test apps
00:19:21bug1looks like the mylib is the problem rather than zlib
00:19:29tzangeryeah?
00:19:51tzangerI thought it was zlib since the unresolved symbols are coming from it
00:20:13tzangeryou got a bunch of symbol 'somezlibsym': blah blah right?
00:20:41bug1./mytest: error while loading shared libraries: libmylib.so: cannot open shared object file: No such file or directory
00:20:46tzangeroh
00:20:52tzangerLD_LIBRARY_PATH=. ./mytest
00:20:58tzangerthe shared lib is outside the normal path
00:21:02bug1oh yea
00:21:12tzangermytest should work fine, it's mytest2 that should confuse you
00:22:03bug1home:/home/bug1/shlib/test# LD_LIBRARY_PATH=. ./mytest2
00:22:04bug1This is libfunc.
00:22:04bug1lib: zlib version is 1.1.4
00:22:12tzangeryes that's mytest
00:22:15tzangerwhoa wait
00:22:24bug1i didnt do anything special
00:22:29tzangermytest2 gave you that??  mytest2 never calls libfunc
00:22:35tzangeror did I screw up the makefile
00:23:14tzangerno the makefile looks right
00:23:19tzangerbut mytest2 never calls libfunc
00:23:36bug1mytest2 works for me but mytest doesnt
00:23:42tzanger??
00:24:19tzanger# LD_LIBRARY_PATH=. ./mytest
00:24:20tzangerThis is main()
00:24:20tzangerThis is libfunc.
00:24:20tzangerlib: zlib version is 1.1.4
00:24:49tzanger# LD_LIBRARY_PATH=. ./mytest2
00:24:49tzanger./mytest2: symbol '_length_code': can't resolve symbol 'L'
00:24:49tzanger./mytest2: symbol 'adler32': can't resolve symbol 'L'
00:24:49tzanger./mytest2: symbol 'zcfree': can't resolve symbol 'L'
00:24:52tzanger./mytest2: symbol 'inflate_mask': can't resolve symbol 'L'
00:24:52tzanger./mytest2: symbol '_dist_code': can't resolve symbol 'L'
00:24:52tzanger./mytest2: symbol 'z_errmsg': can't resolve symbol 'L'
00:24:54tzanger./mytest2: symbol 'zcalloc': can't resolve symbol 'L'
00:25:17bug1home:/home/bug1/shlib/test# LD_LIBRARY_PATH=. ./mytest
00:25:17bug1This is main()
00:25:17bug1This is libfunc.
00:25:17bug1lib: zlib version is 1.1.4
00:25:33bug1home:/home/bug1/shlib/test# LD_LIBRARY_PATH=. ./mytest2
00:25:33bug1This is libfunc.
00:25:33bug1lib: zlib version is 1.1.4
00:25:57tzangerwtf
00:26:02tzangeryou're in uclibc?
00:26:12bug1oh... no
00:26:13tzangeror a glibc/uclibc environment
00:26:16bug1glibc
00:26:18tzangerah
00:26:24bug1sorry
00:26:29tzangerI think all apps are linked against ld-linux.so.2 in glibc
00:26:36tzangerer not just apps... but everything
00:26:46tzangerI don't know if that is the case in a pure-uclibc environment, which would epxlain my problem I think
00:26:53tzangerI need andersee or mjn3 though :-)
00:27:10bug1yea, i think its a bit beyond my help
00:27:18tzangerI appreciate your help  :-)
00:27:24bug1n.p.
00:28:08tzangercould you tell me what the ldd output is for both those programs and libmylib?
00:28:55bug1libmylib.so:
00:28:56bug1libz.so.1 => /usr/lib/libz.so.1 (0x40011000)
00:28:56bug1libc.so.6 => /lib/libc.so.6 (0x4001f000)
00:28:56bug1/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
00:29:07bug1mytest:
00:29:07bug1libmylib.so => not found
00:29:07bug1libc.so.6 => /lib/libc.so.6 (0x40022000)
00:29:07bug1/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
00:29:17bug1mytest2:
00:29:17bug1libdl.so.2 => /lib/libdl.so.2 (0x40022000)
00:29:17bug1libc.so.6 => /lib/libc.so.6 (0x40025000)
00:29:17bug1/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
00:29:23bug1not found /
00:29:26bug1?
00:29:32tzangeryeah because it's not in the linker path remember
00:29:37bug1yep
00:29:39tzangerwhat abot your /lib/libz.so.1?
00:30:10bug1home:/home/bug1/shlib/test# ldd /usr/lib/libz.so.1
00:30:10bug1libc.so.6 => /lib/libc.so.6 (0x4001d000)
00:30:11bug1/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
00:30:12tzangerI'm betting it has ld-linux.so.2
00:30:12tzangeryup
00:30:42bug1so dou you have your libz linked against uclibc ?
00:30:48tzangeryes
00:30:49tzangerbut not ld
00:30:52tzangerhmm
00:32:12bug1can you use your libz as normal static or shared library as opposed to a dynamic one
00:32:19tzangeryes
00:32:24tzangerunfortunately it has to by dynamic
00:32:25tzangerfor perl
00:32:34tzanger(zlib is just my test lib, the actual one I need is expat)
00:33:01bug1expat is xml isnt it
00:33:05tzangeryes
00:33:10tzangerI need it for the perl xml-rpc lib
00:33:27tzangerbut it won't load because it's not getting linked against the dynamic linker I think
00:33:29tzanger**I think**
00:33:44tzangeroffhand I didn't know there was any difference between shared and dynamic libs until just now
00:34:55bug1the linker still has to find the symbols when using it as a normal shared (not dynamic) libarary
00:35:14tzangerright
00:36:18bug1a normal shared library is just linked against at compile time
00:36:29bug1dynamic is at runtime
00:36:38bug1to the best of my knowledge
00:36:42tzangeryes
00:36:58tzangerbut on uclibc libmylib is not dyamic
00:37:00tzangerjust shared
00:37:03tzangeras seen my by ld output
00:37:05tzangerer ldd output
00:37:19tzangerer
00:37:20tzanger?
00:37:23tzangerit is dyanmic?
00:37:24bug1i think the library is the same, its just how you use it
00:37:40tzangerthen why can't I get at zlib...
00:39:07bug1In the example in the man page they compile it with gcc -rdynamic -o foo foo.c -ldl
00:39:34tzangeryeah
00:40:03bug1do you need the -rdynamic ?
00:40:29tzangerI think that may have done it...
00:40:30tzangertesting...
00:42:32tzangerit's still not linked against ld-linux.so.2
00:42:48tzangernope
00:44:08tzangerdammit
01:11:23tzangerBZFlag: do you know much about uclibc's dynamic loader?
01:23:36BZFlagnot as much and andersee. ;-)
01:23:42tzangerheh
01:24:12tzangerdo you have a uclibc system there? (pure uclibc)
01:26:33BZFlagthe TuxScreen, but mines not up at the moment.
01:28:09tzangerah
01:32:53tzangerhow can I exclude /kernel but not initrd/kernel/ with tar -X?  I've tried /kernel and ./kernel...  
01:33:00tzangerha
01:33:01tzangerwrong window
01:39:41aaronlyay andersee
01:39:52aaronlyou get to hope andre will fix your ide problems!
01:41:32anderseeheh
01:42:02anderseeI've been trading patches w/him this evening
01:55:27anderseeaaronl: one more bug to fix, and uClibc will be ready for another release.
01:59:04aaronlcool
01:59:12aaronlhas anyone tried linking BZFlag to uclibc?
01:59:40anderseeIt now passes all tests in both the perl and python test suites w and w/o threads.  :)
02:01:27anderseeaaronl: You might wanna ask BZFlag.  :)
02:01:50anderseeBZFlag: hey Tim, anyone tried linking BZFlag vs uClibc?
02:09:34anderseeevening sjhill
02:09:38sjhillhey andersee
02:09:44sjhillis here for just a little bit
02:09:52sjhilli'm addicted to my new mips board
02:11:18anderseeOh?
02:11:21BZFlagaaronl: nope, I don't have any uclibc based systems with glx so I didn't see the point. ;-)
02:11:22anderseeFast?
02:12:10sjhillandersee: (2) 500MHz MIPS ISA V instruction set cores with (3) gigabit ethernets, (2) ddr memory controllers, 64-bit pci, and hypertransport bus
02:12:37sjhilli love it
02:14:16anderseesjhill: wow
02:14:31anderseesjhill: Sounds pretty cool.  hows the power consumption?
02:14:44anderseeHow many PCI slots?
02:14:55sjhill(2) 64-bit (2) 32-bit pci slots
02:15:03sjhillpower consumption..hehe...5w
02:15:12tzangerwow
02:15:21sjhillit kicks ass
02:15:27tzangerlet me say that again... WOW
02:15:44anderseesjhill: got an extra one?  ;-)
02:15:54sjhillandersee: sure, for $30k
02:16:49anderseesjhill: Lemme sell my children on ebay first to see how much I can raise.
02:16:54sjhilllol
02:16:54tzangerhahaha

Generated by irclog2html.pl by Jeff Waugh - find it at freshmeat.net! Modified by Tim Riker to work with infobot logs, split per channel and by date, etc.
11:55:56tzangermorning Mr. Andersen 11:56:05tzangerWhat will it be today? 12:12:25anderseeprobably 0.9.15 I guess 12:12:26andersee:) 12:12:42tzanger:-) 12:16:14tzangerthis is perhaps more a question for mjn3 but maybe you know -- on a uclibc-only system -- take for example the third party lib zlib-1.1.4.  If I make a program that accesses it (-lz or dlopen()) it works fine.  Now if I make a shared lib (call it mylib) that needs zlib I can use mylib if I link it (-lmylib) but not if I dlopen() mylib; dlopen gives me all kinds of errors about not being able to find symbols from zlib 12:17:00tzangersomeone told me it's because zlib (or perhaps mylib) isn't linked against the dynamic linker but I've tried compiling with -Wl,-Bdynamic -rdynamic, etc, etc. 12:34:41anderseetzanger: http://uclibc.org/cgi-bin/cvsweb/buildroot/make/zlib.mk?rev=1.2&content-type=text/vnd.viewcvs-markup 12:34:50anderseeCompilied -fPIC? 12:35:27tzangermylib? yes.  and I believe zlib was as well but I will double-check 12:35:32tzangerI can't imagine it not being compiled -fPIC 12:36:55tzangerandersee: that looks like a zlib get/build script? 12:37:08anderseeyup 12:37:34anderseeI've pointed you to buildroot several times I believe... 12:37:50tzangerthis is the first I remember but I apologize if you had in the past 12:37:53tzangerI am not usually this thick 12:37:58anderseeHere is another variant on buildroot 12:38:01anderseehttp://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tuxscreen/buildroot-tux/ 12:38:32anderseeIf you look in the make dir, there are examples of how to build a whole bunch of stuff 12:38:38tzanger*nod* I'm looking there right now 12:39:14anderseeThis is what I use to build a uClibc based world for my tuxscreen phone:  http://tuxscreen.net/ 12:39:37tzangerI see.  I appreciate your help! 12:39:57tzangerI know others have done this so I'm not breaking any new ground but I've been beating my head against a wall against this one problem 13:01:36anderseeI hope the examples help some... 13:01:56tzangerI'm looking at them but the build is not different than what I'm doing from what I can tell 13:02:12anderseek 13:02:15tzangerand as I said, I can dlopen zlib on its own, just not a shared lib that has zlib as a dependency 13:02:21tzanger(or any lib for that matter) 13:02:27anderseeDo you build zlib -fPIC 13:02:27andersee? 13:02:30tzangeryes 13:02:32tzangerabsolutely 13:02:35anderseek 13:02:39tzangerdouble and triple checked :-) 13:08:22tzangerurgh 13:08:32tzangerdouble and triple, quadruple and quintuple urgh 13:09:00tzangermytest needs mylib which needs mylib2 -- use -lmylib -- no problem 13:09:16tzangermytest2 dlopens mylib which needs mylibs -- use -ld -- errors 13:14:20tzangerif you have a couple of minutes the code is up at www.mixdown.org/~andrew/uclibc -- I cannot see what I'm doing wrong at all, I've stripped it down to the bare minimum 13:15:29anderseetzanger: I'd love to -- but I've got a major deadline 8 days from now so I really don't have many spare cycles at the moment. 13:15:30andersee:( 13:16:02tzangerandersee: believe me I understand about deadlines.  :-)   13:16:32tzangeryou've been very helpful and let me "think out loud" while I'm going through this 13:17:02tzangerI've been ignoring a deadline working on this because I just can't leave it alone :-) 13:47:31tzangerhey mjn3 13:47:51tzangerI've got the problem narrowed down about as far as I can get 13:48:03tzangerjust libc and two of my own shared libs, one dependent on the other 13:48:26tzangerand two test programs -- one which links to mylib, and one which dlopens mylib 13:48:55tzangerif you've got a couple minutes, the (simple) code is at www.mixdown.org/~andrew/uclibc 13:50:34mjn3tzanger: i'll take a look 13:54:25tzangerthanks 13:54:37tzangerI'm really at my wits end with it, I cant see what I've done wrong 14:00:50mjn3tzanger: everything works for me as expected... 14:00:53mjn3mjn3@mars:~/work/tzanger/andrew$ LD_LIBRARY_PATH=. PATH=~/i386-linux-uclibc/usr/bin/:$PATH make 14:00:53mjn3gcc -fPIC -g -fPIC -c mylib.c -o mylib.o 14:00:53mjn3gcc -fPIC -g -fPIC -c mylib2.c -o mylib2.o 14:00:53mjn3gcc -fPIC -g -shared -o libmylib2.so -Wl,-soname,libmylib2.so mylib2.o 14:00:53mjn3gcc -fPIC -g -shared -o libmylib.so -Wl,-soname,libmylib.so mylib.o -Wl,-rpath-link,. -L. -lmylib2 14:00:53mjn3gcc -fPIC -g mytest.c -o mytest -L. -lmylib 14:00:55mjn3gcc -fPIC -g mytest2.c -o mytest2 -ldl 14:00:57mjn3mjn3@mars:~/work/tzanger/andrew$ LD_LIBRARY_PATH=. ./mytest 14:00:59mjn3This is main() 14:01:03mjn3This is libfunc. 14:01:05mjn3This is lib2func. 14:01:08mjn3mjn3@mars:~/work/tzanger/andrew$ LD_LIBRARY_PATH=. ./mytest2 14:01:09mjn3This is libfunc. 14:01:11mjn3This is lib2func. 14:01:15mjn3mjn3@mars:~/work/tzanger/andrew$ LD_LIBRARY_PATH=. ~/ureadelf mytest 14:01:16mjn3Type:           EXEC (Executable file) 14:01:17mjn3Machine:        Intel 80386 14:01:19mjn3Class:          ELF32 14:01:21mjn3Data:           2's complement, little endian 14:01:24mjn3Version:        1 (current) 14:01:25mjn3OS/ABI:         UNIX - System V 14:01:27mjn3ABI Version:    0 14:01:29mjn3Interpreter:    /home/mjn3/i386-linux-uclibc/lib/ld-uClibc.so.0 14:01:33mjn3Dependancies: 14:01:35mjn3        libmylib.so 14:01:38mjn3        libc.so.0 14:01:39mjn3mjn3@mars:~/work/tzanger/andrew$ LD_LIBRARY_PATH=. ~/ureadelf mytest2 14:01:42mjn3Type:           EXEC (Executable file) 14:01:43mjn3Machine:        Intel 80386 14:01:45mjn3Class:          ELF32 14:01:47mjn3Data:           2's complement, little endian 14:01:49mjn3Version:        1 (current) 14:01:56mjn3OS/ABI:         UNIX - System V 14:01:56mjn3ABI Version:    0 14:01:56mjn3Interpreter:    /home/mjn3/i386-linux-uclibc/lib/ld-uClibc.so.0 14:01:58mjn3Dependancies: 14:01:59mjn3        libdl.so.0 14:02:04mjn3        libc.so.0 14:02:06mjn3mjn3@mars:~/work/tzanger/andrew$ LD_LIBRARY_PATH=. ~/ureadelf libmylib.so 14:02:08mjn3Type:           DYN (Shared object file) 14:02:11mjn3Machine:        Intel 80386 14:02:11mjn3Class:          ELF32 14:02:14mjn3Data:           2's complement, little endian 14:02:15mjn3Version:        1 (current) 14:02:17mjn3OS/ABI:         UNIX - System V 14:02:19mjn3ABI Version:    0 14:02:21mjn3Dependancies: 14:02:23mjn3        libmylib2.so 14:02:25mjn3        libc.so.0 14:02:27mjn3mjn3@mars:~/work/tzanger/andrew$ LD_LIBRARY_PATH=. ~/ureadelf libmylib2.so 14:02:30mjn3Type:           DYN (Shared object file) 14:02:34mjn3Machine:        Intel 80386 14:02:36mjn3Class:          ELF32 14:02:38mjn3Data:           2's complement, little endian 14:02:39mjn3Version:        1 (current) 14:02:41mjn3OS/ABI:         UNIX - Sys 14:03:36tzangerwell what the hell 14:04:01anderseetzanger: perhaps your toolchain is broken 14:04:44tzangerI'm not sure how but it's the only explanation 14:06:55tzangerthat patch I mentioned which helped make uclibc the main lib creates a link from /lib/ld-uClibc-0.9.14.so to /lib/ld-linux.so.2 14:07:11tzangerthat's really the only difference I can see between a "normal" uclibc build and this 14:07:41tzangeram I supposed to get "Invalid elf header" when I run /lib/ld-uClibc-0.9.11.so? 14:07:42tzangerer 14 14:08:38mjn3tzanger: just out of curisosity, why are you linkeing ld-uClibc-0.9.14 to ld-linux.so.2 ??? 14:09:14tzangermjn3: it's what was recommended to me in the linux from scratch build 14:10:22tzangerI didn't (still don't!) understand all the details of linux dynamic linking so I figured I'd best go with what he claimed worked 14:10:35anderseemjn3: I'm guessing its instead of fixing gcc to point to the right shared lib loader.... 14:11:04anderseetzanger: if you look in my toolchain building scripts, I fix gcc instead 14:11:15mjn3tzanger: and where did you see this dubious advice? 14:11:41tzangerhttp://hints.linuxfromscratch.org/hints/uclibc-lfs.txt 14:12:59tzangerthe patch that was applied is at http://www.mixdown.org/~andrew/uClibc-0.9.14.patch 14:14:36tzangerandersee: I'm looking for it now 14:16:41tzangerwhere are the patches that the buildroot scripts access? 14:17:29anderseetzanger: some are downloaded.  Some are in buildroot/sources 14:19:18tzangerI see where you alter binutils to use the proper interpreter 14:19:47tzangerI wonder if I specify that to ld for my test if it will fix it (maybe something goofy with following links to the interpreter?) 14:19:58tzangerah and further down I see it to GCC 14:20:41tzangeror maybe ld assumes too much if the interpreter is ld-linux-* 14:21:38anderseetzanger: btw, updating that to use gcc 3.2 works fine 14:21:48tzangerI'm still using 2.95.3-2 14:22:33bug1aaronl: static inline is smaller than extern inline, any reason why you use extern ? 14:26:18tzangerit's got to be something with what I did...  the guy who wrote the patch claims he is having no problems 14:26:22tzangerwonders wtf he did wrong 14:28:40tzangerandersee: any specific tool you'd recommend starting with or just redo the whole shebang? 14:29:14anderseetzanger: dunno. 14:29:19tzangerok  :-) 18:34:34tzangerandersee: busybox vi does *not* like opening up binary files.  :-) 18:34:49anderseetzanger: ahh 18:35:11tzangervi mylib.o is not quite the same as vi mylib.c  :-) 18:35:50tzangerbtw: if I compile that test program with -rdynamic it works...  but if my test lib links against zlib or bzlib or anything but that other simple lib I made I'm back at square 1 :-( 18:36:01tzangerso it's been a good news, bad news day :-) 18:41:00aaronlhmmm 18:41:45aaronlyeah busybox vi has some major bugs with binary files it appears 18:42:29aaronlit looks like nulls are confusing it 19:44:21tzangermjn3: partial success!  adding -rdynamic to the compile line for the dlopen() test makes it work with my own libs 19:47:10mjn3tzanger: odd that it would find libc.so but not any other shared libs in the same dir... 19:47:21tzangeryeah 19:47:32tzangerwell I think it finds them since dlopen isn't returning file not found 19:47:44tzangerit just can't resolve any external libs (other than libc) 19:47:53tzangermy own test lib works fine with it 19:49:27tzangerI tried compiling libz and libbz2 with --export-dynamic but that isn't helping much at all 19:49:33tzangeranyway I just wanted to share my partial success  :-) 19:50:37mjn3and it fails if you don't add -rdyanmic but set then LD_LIBRARY_PATH env var? 19:50:50tzangeryes 19:51:02tzangerI'm talking about where mylib depends on mylib2 and I dlopen mylib 19:51:11tzangerthat requires -rdynamic and -ldl 19:51:36tzangerhowever those switches don't help where mylib depends on something like zlib or bzlib 19:53:39tzangerhmm 19:53:55tzangerthe libc shared compile uses ld --whole-archive 19:55:35mjn3what i meant was having LD_LIBRARY_PATH set at app runtime, as i did when running your tests 19:56:40tzangerwell yes I have it set to .:/lib:/usr/lib since libmylib.so is in . 19:58:35tzangeranyway it is dinner time for me and I've got a headache :-(   19:58:41tzangerthanks for your help, you guys are great
Generated by irclog2html.pl by Jeff Waugh - find it at freshmeat.net! Modified by Tim Riker to work with infobot logs, split per channel and by date, etc.