Opened 7 years ago

Closed 5 years ago

#7620 closed defect (worksforme)

system /usr/bin/ranlib called sporadically, instead of proper cross-compiler-toolchain ranlib

Reported by: mystica555 Owned by: developers
Priority: normal Milestone:
Component: toolchain Version: Trunk
Keywords: ranlib toolchain cross binutils Cc:


Started building a bunch of new packages to put on my ext3 root device, an 8 gig flash stick. Wanted samba, a few other things, as soon I plan to also add a USB-HDD of a terabyte or so to the router.

MOST things compile just fine. 3 things so far (i've yet to have a complete, non-erroring compile with the new packages enabled) have tried to use the SYSTEM ranlib (/usr/bin/ranlib) , and NOT the proper one (~/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.4.4_uClibc-0.9.32/usr/bin/mips-openwrt-linux-uclibc-ranlib)

This was first found as samba wouldn't link properly:
(code block has been manually-line-broken so as to show up without taking 10 monitors in width for bugreport)

Linking bin/smbd
ccache mips-openwrt-linux-uclibc-gcc  -Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float  
-Os -D_SAMBA_BUILD_ -DAVM_NO_PRINTING -DAVM_SMALLER -I./popt -Iinclude -I`pwd`/include -I`pwd`/ubiqx  -I.
-I/home/mike/openwrt/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.4.4_uClibc-0.9.32/include -D_GNU_SOURCE -I`pwd` -I`pwd`/tdb      
-o bin/smbd smbd/server.o popt/findme.o popt/popt.o popt/poptconfig.o popt/popthelp.o popt/poptparse.o lib/popt_common.o  
-L/home/mike/openwrt/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.4.4_uClibc-0.9.32/lib \
		-lcrypt  \
		-Lbin -lsmbd \
		-L/lib \
		-lcrypt -ldl -lpthread
bin/libsmbd.a: could not read symbols: Archive has no index; run ranlib to add one
collect2: ld returned 1 exit status
make[4]: *** [bin/smbd] Error 1

Kept going through it, saw the ranlib as exec'd only 20 lines prior.. The make backscroll simply stated

ranlib bin/libsmbd.a 

as the command run. I thought this to be odd.. got me wondering.. is it really calling the right ranlib? I chocked it up to a programming fluke with samba3. Manually ran the proper ranlib out of the mips toolchain on the .a file, boom, it linked fine and I was compiling again.

Then 2 more ranlib errors got me thinking this has got to be something else than just a single package.

The ones I've found *SO FAR* : samba3, lsof, postgresql .

So, to diagnose this problem and see that indeed, /usr/bin/ranlib WAS being called instead of the cross-compiler's, I made the system ranlib return an echo..

cd /usr/bin
mv ranlib ranlib.real (which is symlinked tox86_64-pc-linux-gnu-ranlib so this moved symlink)
cat > ranlib
echo 'DO NOT RUN ME----------------------------------(line chopped for width; much longer in real file to stand out)'
chmod +x ranlib

So, every time ranlib gets run from /usr/bin/ i get the nice line of doom in my scrollback.
(this code block has been broken up by command, and manually linebroken for width)

gcc -I../../libpq -I../../src/port -DFRONTEND -I../../src/include -D_GNU_SOURCE   -c thread.c

ar crs libpgport.a strlcat.o strlcpy.o chklocale.o copydir.o dirmod.o exec.o noblock.o 
     path.o pipe.o pgsleep.o pgstrcasecmp.o qsort.o qsort_arg.o sprompt.o thread.o

ranlib libpgport.a
DO NOT RUN ME-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

gcc -I../../libpq  -I../../src/port  -I../../src/include -D_GNU_SOURCE  -c strlcat.c -o strlcat_srv.o

So, I wonder, what is making the toolchain (or the packages themselves?) refuse to use the proper ranlib?

If I see any more, I'll update the bug.

I've attached the the samba3 and postgres compiles; also pastebinned for click-brevity:


I didn't save the lsof one, nor do I plan to redo it. It's got the same error as the rest: ranlib runs, does nothing (as its system ranlib and not the cross-ranlib) and you get archive missing index errors upon linking.

Attachments (3)

samba3.txt (108.7 KB) - added by mystica555 7 years ago.
Samba3 full V=99 compile output.
pgsql.txt (474.9 KB) - added by mystica555 7 years ago.
pgsql full compile *including the system ranlib marker*
.config (115.2 KB) - added by anonymous 7 years ago.
.config for current build that has yet to finish…

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by mystica555

Samba3 full V=99 compile output.

Changed 7 years ago by mystica555

pgsql full compile *including the system ranlib marker*

comment:1 Changed 7 years ago by anonymous

Hm might want to give a bit more info.

KAMIKAZE (bleeding edge, r22176)

WNDR3700, GCC 4.4.4+ppl+cloog+graphite; uClibc 0.9.32-nptl; binutils 2.20.1

Also, heres el .config attached.

Changed 7 years ago by anonymous

.config for current build that has yet to finish...

comment:2 Changed 7 years ago by mystica555 <mystica@…>

And the default 'non username' of anonymous has kicked me..

Also: the revision listed above, 22176, was the revision that worked -before- i tried the larger packages. 22190 is the current building revision.

comment:3 Changed 7 years ago by mystica555

cyrus-sasl is also affected by this..

comment:4 Changed 5 years ago by nbd

  • Resolution set to worksforme
  • Status changed from new to closed

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.