This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
RE: [PATCH 2/2] Remove ancient GCC string inlines
- From: "Wilco Dijkstra" <wdijkstr at arm dot com>
- To: "'Joseph Myers'" <joseph at codesourcery dot com>
- Cc: "'GNU C Library'" <libc-alpha at sourceware dot org>
- Date: Mon, 12 Oct 2015 13:53:51 +0100
- Subject: RE: [PATCH 2/2] Remove ancient GCC string inlines
- Authentication-results: sourceware.org; auth=none
- References: <000401d102aa$8db859e0$a9290da0$ at com> <alpine dot DEB dot 2 dot 10 dot 1510091558180 dot 20476 at digraph dot polyomino dot org dot uk> <000801d102b1$3e4f33e0$baed9ba0$ at com> <alpine dot DEB dot 2 dot 10 dot 1510091657190 dot 20476 at digraph dot polyomino dot org dot uk> <000901d104e0$069f65b0$13de3110$ at com> <alpine dot DEB dot 2 dot 10 dot 1510121131000 dot 16894 at digraph dot polyomino dot org dot uk>
> 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