Hello,
I get the following error building fiasco-ux:
==> Linking kernel.image /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: errno: TLS definition in /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../libc.a(errno.o) section .tbss mismatches non-TLS reference in boot_info-ux.o /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../libc.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [kernel.image] Error 1 make[2]: Leaving directory `/home/sts/hellomodule/l4/kernel/fiasco/build' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/sts/hellomodule/l4/kernel/fiasco/build' make: *** [all] Error 2 Real: 91.12s User: 74.26s System: 11.10s Percent: 93% Cmd: make
So is this an gcc, glibc or binutils issue in the first place? And which versions are supposed to be able to build fiasco-ux?
I'm using binutils 2.16.92 and glibc 2.4 and various gcc versions btw.
Thanks in advance
Stefan
On Thu, 20 Apr 2006 21:08:11 +0200 Stefan Scheler (SS) wrote:
SS> I get the following error building fiasco-ux: SS> SS> ==> Linking kernel.image SS> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: SS> errno: TLS definition in SS> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../libc.a(errno.o) SS> section .tbss mismatches non-TLS reference in boot_info-ux.o SS> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../libc.a: could not read SS> symbols: Bad value SS> collect2: ld returned 1 exit status
How is errno declared on your system, e.g. in /usr/include/errno.h? extern int errno; or extern __thread int errno; ?
- Udo
On Thu, 20 Apr 2006 22:18:08 +0200 Stefan Scheler (SS) wrote:
SS> Udo A. Steinberg wrote: SS> > How is errno declared on your system, e.g. in /usr/include/errno.h? SS> > extern int errno; or SS> > extern __thread int errno; ? SS> SS> It's "extern int errno;".
Does it help if you replace occurrences of
#include <cerrno>
in kernel/fiasco/src/kern/ux with
extern __thread int errno;
If so, your header files in /usr/include don't match your libc.a
- Udo
Hello,
Does it help if you replace occurrences of
#include <cerrno>
in kernel/fiasco/src/kern/ux with
extern __thread int errno;
Yes, that helps indeed but reveals the same problem with irq0.
So I made the above change in kernel/fiasco/src/lib/amm/errno.h which seems to fix this issue for all files. Thanks for the pointer.
If so, your header files in /usr/include don't match your libc.a
Hmm?! That sounds weird. I'm using of course the headers shipped with my glibc.
Stefan
On Fri, 21 Apr 2006 12:45:45 +0200 Stefan Scheler (SS) wrote:
SS> So I made the above change in kernel/fiasco/src/lib/amm/errno.h which SS> seems to fix this issue for all files. Thanks for the pointer.
Ok, that reveals who the culprit is. The errno.h file in lib/amm declares errno as global rather than per-thread, which is bogus on a TLS system. In fact, the whole errno.h file there is misplaced. Your libc include files are not at fault.
Official fix is to remove that errno.h file completely, and to apply the following patches. I've just committed them and they will propagate to remote CVS shortly.
- Udo
Index: Makeconf =================================================================== RCS file: /home/cvs/l4/kernel/fiasco/src/Makeconf,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- Makeconf 19 Apr 2006 06:58:23 -0000 1.75 +++ Makeconf 21 Apr 2006 12:29:29 -0000 1.76 @@ -2,7 +2,7 @@ # Fiasco make configuration file # # created 1996/04/20 by hohmuth -# $Id: Makeconf,v 1.75 2006/04/19 06:58:23 aw11 Exp $ +# $Id: Makeconf,v 1.76 2006/04/21 12:29:29 us15 Exp $ #
CHECKCC = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ @@ -89,7 +89,7 @@ LIBGCC := $(shell $(CXX) -print-libgcc-file-name)
L4ALL_INCDIR ?= $(addprefix -I, $(PRIVATE_INCDIR)) -L4STD_INCDIR ?= -nostdinc +L4STD_INCDIR ?= L4STD_INCDIR_LAST ?= -I$(wildcard $(dir $(LIBGCC))/include \ $(dir $(LIBGCC))/../include) Index: kern/tb_entry_output.cpp =================================================================== RCS file: /home/cvs/l4/kernel/fiasco/src/kern/tb_entry_output.cpp,v retrieving revision 1.78 diff -u -r1.78 tb_entry_output.cpp --- kern/tb_entry_output.cpp 21 Jan 2006 22:43:41 -0000 1.78 +++ kern/tb_entry_output.cpp 21 Apr 2006 12:03:08 -0000 @@ -528,7 +528,7 @@ : "#%02x: %-*s err=%04x @ "L4_PTR_FMT " cs=%04x sp="L4_PTR_FMT" eax="L4_PTR_FMT, e->trapno(), - tidlen, tidstr, e->errno(), e->ip(), e->cs(), e->sp(), + tidlen, tidstr, e->error(), e->ip(), e->cs(), e->sp(), e->trapno() == 14 ? e->cr2() : e->eax());
return maxlen; Index: kern/amd64/tb_entry-amd64.cpp =================================================================== RCS file: /home/cvs/l4/kernel/fiasco/src/kern/amd64/tb_entry-amd64.cpp,v retrieving revision 1.2 diff -u -r1.2 tb_entry-amd64.cpp --- kern/amd64/tb_entry-amd64.cpp 1 Dec 2005 13:14:57 -0000 1.2 +++ kern/amd64/tb_entry-amd64.cpp 21 Apr 2006 12:03:08 -0000 @@ -22,7 +22,7 @@ { private: char _trapno; - Unsigned16 _errno; + Unsigned16 _error; Mword _rbp, _rdx, _cr2, _rax, _rflags, _rsp; Unsigned16 _cs, _ds; }; @@ -119,7 +119,7 @@ { set_global(Tbuf_trap, ctx, rip); _trapno = ts->_trapno; - _errno = ts->_err; + _error = ts->_err; _rdx = ts->_rdx; _cr2 = ts->_cr2; _rax = ts->_rax; @@ -143,8 +143,8 @@
PUBLIC inline Unsigned16 -Tb_entry_trap::errno() const -{ return _errno; } +Tb_entry_trap::error() const +{ return _error; }
PUBLIC inline Mword Index: kern/arm/tb_entry-arm.cpp =================================================================== RCS file: /home/cvs/l4/kernel/fiasco/src/kern/arm/tb_entry-arm.cpp,v retrieving revision 1.3 diff -u -r1.3 tb_entry-arm.cpp --- kern/arm/tb_entry-arm.cpp 18 Feb 2006 16:49:52 -0000 1.3 +++ kern/arm/tb_entry-arm.cpp 21 Apr 2006 12:03:08 -0000 @@ -22,7 +22,7 @@ { private: Unsigned8 _trapno; - Unsigned16 _errno; + Unsigned16 _error; Mword _cpsr, _sp; };
@@ -107,8 +107,8 @@
PUBLIC inline Unsigned16 -Tb_entry_trap::errno() const -{ return _errno; } +Tb_entry_trap::error() const +{ return _error; }
PUBLIC inline Mword Index: kern/shared/tb_entry-ia32-ux.cpp =================================================================== RCS file: /home/cvs/l4/kernel/fiasco/src/kern/shared/tb_entry-ia32-ux.cpp,v retrieving revision 1.10 diff -u -r1.10 tb_entry-ia32-ux.cpp --- kern/shared/tb_entry-ia32-ux.cpp 1 Dec 2005 13:14:58 -0000 1.10 +++ kern/shared/tb_entry-ia32-ux.cpp 21 Apr 2006 12:03:08 -0000 @@ -22,7 +22,7 @@ { private: Unsigned8 _trapno; - Unsigned16 _errno; + Unsigned16 _error; Mword _ebp, _edx, _cr2, _eax, _eflags, _esp; Unsigned16 _cs, _ds; }; @@ -119,7 +119,7 @@ { set_global(Tbuf_trap, ctx, eip); _trapno = ts->_trapno; - _errno = ts->_err; + _error = ts->_err; _edx = ts->_edx; _cr2 = ts->_cr2; _eax = ts->_eax; @@ -145,8 +145,8 @@
PUBLIC inline Unsigned16 -Tb_entry_trap::errno() const -{ return _errno; } +Tb_entry_trap::error() const +{ return _error; }
PUBLIC inline Mword
l4-hackers@os.inf.tu-dresden.de