[PATCH 2/2] Remove ancient GCC string inlines
Wilco Dijkstra
wdijkstr@arm.com
Mon Oct 12 12:54:00 GMT 2015
> Joseph Myers wrote:
> On Mon, 12 Oct 2015, Wilco Dijkstra wrote:
>
> > So what is the magic to do a cross build for 32-bit? I can't find anything in
> > the GLIBC documentation that gives the correct recipe to do this, and when I
> > try to force it to use 32-bit using -m32 -arch=i686 I only get configure and
> > build failures...
>
> Assuming you have a compiler with working -m32 support (startup files etc.
> installed), you should set CC and CXX to include -m32, and use
> --host=i686-pc-linux-gnu when configuring. If you want to treat it as a
> native build for testing purposes, --build=i686-pc-linux-gnu is a good
> idea as well. This is in addition to usual configure options such as
> --prefix=/usr --enable-add-ons.
Thanks, that seems to pass the configure correctly. However it fails later
compiling tls code with either GCC 4.8.2 or trunk:
CC="/work/install/gcc_x64/bin/gcc -m32"
CXX="/work/install/gcc_x64/bin/g++ -m32"
CFLAGS="-O2"
CXXFLAGS="-O2"
export CFLAGS
export CXXFLAGS
export CC
export CXX
cd ${build}
${src}/configure --prefix=/usr --enable-add-ons --target=i686-pc-linux-gnu --host=i686-pc-linux-gnu
--build=i686-pc-linux-gnu
make -j20
It reports on latest GLIBC:
In file included from ../sysdeps/i386/nptl/tls.h:28:0,
from ../sysdeps/i386/i686/nptl/tls.h:33,
from ../include/errno.h:27,
from libc-tls.c:19:
libc-tls.c: In function '__libc_setup_tls':
../sysdeps/unix/sysv/linux/i386/sysdep.h:409:12: error: '__NR_set_thread_area' undeclared (first use
in this function)
: "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc")
^
../sysdeps/unix/sysv/linux/i386/sysdep.h:346:5: note: in expansion of macro
'INTERNAL_SYSCALL_MAIN_INLINE'
INTERNAL_SYSCALL_MAIN_INLINE(name, err, 1, args)
^
../sysdeps/unix/sysv/linux/i386/sysdep.h:374:5: note: in expansion of macro
'INTERNAL_SYSCALL_MAIN_1'
INTERNAL_SYSCALL_MAIN_##nr (name, err, args); \
^
../sysdeps/i386/nptl/tls.h:213:16: note: in expansion of macro 'INTERNAL_SYSCALL'
_result = INTERNAL_SYSCALL (set_thread_area, err, 1, &_segdescr.desc); \
^
libc-tls.c:188:25: note: in expansion of macro 'TLS_INIT_TP'
const char *lossage = TLS_INIT_TP ((char *) tlsblock + tcb_offset);
This is a common error (lots of hits on Google) but nobody seems to offer an actual fix...
Wilco
More information about the Libc-alpha
mailing list