jayduhon / inferno-os

Automatically exported from code.google.com/p/inferno-os
2 stars 0 forks source link

Chang in ld default comportement break build on Fedora 14 (and probably 13 also) #247

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Try to compile the latest revision on a Fedora 14 box

What is the expected output? What do you see instead?
The compilation fails because of a change in the default behaviour of ld in 
Fedora (http://fedoraproject.org/wiki/UnderstandingDSOLinkChange). libpthread 
is not automatically added to the list  of needed library anymore.

Which operating system are you using?
Linux (Fedora 14)

Please provide any additional information below.
The following patch seems to solve the problem :

diff -r 3f4ed0babba7 emu/Linux/mkfile
--- a/emu/Linux/mkfile  Tue Feb 08 16:05:18 2011 +0000
+++ b/emu/Linux/mkfile  Thu Feb 17 16:55:25 2011 +0100
@@ -33,7 +33,7 @@
 HFILES=\

 CFLAGS='-DROOT="'$ROOT'"' -DEMU -I. -I../port -I$ROOT/$SYSTARG/$OBJTYPE/include -I$ROOT/include -I$ROOT/libinterp $CTHREADFLAGS $CFLAGS $EMUOPTIONS
-SYSLIBS= $X11LIBS -lm -lrt
+SYSLIBS= $X11LIBS -lm -lrt -lpthread
 KERNDATE=`{$NDATE}

 default:V: $O.$CONF

Original issue reported on code.google.com by edouardk...@gmail.com on 17 Feb 2011 at 4:07

GoogleCodeExporter commented 9 years ago
I had this problem as well.

This issue doesn't come to the forefront by searching for the specific error so 
I'm adding the error I got here:

/usr/bin/ld: os.o: undefined reference to symbol 'sem_init@@GLIBC_2.1'
/usr/bin/ld: note: 'sem_init@@GLIBC_2.1' is defined in DSO /lib/libpthread.so.0 
so try adding it to the linker command line
/lib/libpthread.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
mk: cc -c -m32 ...  : exit status=exit(1)
mk: echo "(cd $SYSTARG; ...  : exit status=exit(1)
mk: for j in ...  : exit status=exit(1)

By making the change noted above the compliation works just fine.

Enjoy

Derek aka goozbach

Original comment by frioco...@gmail.com on 28 Mar 2011 at 8:04

GoogleCodeExporter commented 9 years ago
the version required is actually the -lrt one, not the one in pthreads (which 
aren't used by that version of os.c). the pthreads variant maintains a lot of 
state assuming use of pthreads. still, if it not only links but works, we'll 
try it with -lrt -lpthread search order.

a revised os.c will use pthreads directly, since there is too much crud in 
glibc that assumes it, specifically the handling of errno.

Original comment by Charles....@gmail.com on 29 Mar 2011 at 7:58

GoogleCodeExporter commented 9 years ago
committed changeset 499:f23dbde4c2ff

Original comment by Charles....@gmail.com on 29 Mar 2011 at 8:00