From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54482 invoked by alias); 12 Oct 2015 12:54:01 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 54469 invoked by uid 89); 12 Oct 2015 12:54:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com From: "Wilco Dijkstra" To: "'Joseph Myers'" Cc: "'GNU C Library'" References: <000401d102aa$8db859e0$a9290da0$@com> <000801d102b1$3e4f33e0$baed9ba0$@com> <000901d104e0$069f65b0$13de3110$@com> In-Reply-To: Subject: RE: [PATCH 2/2] Remove ancient GCC string inlines Date: Mon, 12 Oct 2015 12:54:00 -0000 Message-ID: <000a01d104ed$0b7a9c00$226fd400$@com> MIME-Version: 1.0 X-MC-Unique: Zj41c8oWSz-8a5qp5GrGdQ-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-10/txt/msg00318.txt.bz2 > Joseph Myers wrote: > On Mon, 12 Oct 2015, Wilco Dijkstra wrote: >=20 > > So what is the magic to do a cross build for 32-bit? I can't find anyth= ing in > > the GLIBC documentation that gives the correct recipe to do this, and w= hen I > > try to force it to use 32-bit using -m32 -arch=3Di686 I only get config= ure and > > build failures... >=20 > 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=3Di686-pc-linux-gnu when configuring. If you want to treat it as a > native build for testing purposes, --build=3Di686-pc-linux-gnu is a good > idea as well. This is in addition to usual configure options such as > --prefix=3D/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=3D"/work/install/gcc_x64/bin/gcc -m32" CXX=3D"/work/install/gcc_x64/bin/g++ -m32" CFLAGS=3D"-O2" CXXFLAGS=3D"-O2" export CFLAGS export CXXFLAGS export CC export CXX cd ${build} ${src}/configure --prefix=3D/usr --enable-add-ons --target=3Di686-pc-linux-= gnu --host=3Di686-pc-linux-gnu --build=3Di686-pc-linux-gnu=20 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_ar= ea' 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_SY= SCALL' _result =3D INTERNAL_SYSCALL (set_thread_area, err, 1, &_segdescr.des= c); \ ^ libc-tls.c:188:25: note: in expansion of macro 'TLS_INIT_TP' const char *lossage =3D TLS_INIT_TP ((char *) tlsblock + tcb_offset); This is a common error (lots of hits on Google) but nobody seems to offer a= n actual fix... Wilco