vapier 15/05/30 04:30:58 Modified: common.eblit Log: Fix -march setting when building x86 multilib on x86_64 #528708 by devsk. Also note some future work related to bootstrapping here. (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
Revision Changes Path 1.46 sys-libs/glibc/files/eblits/common.eblit file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit?rev=1.46&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit?rev=1.46&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit?r1=1.45&r2=1.46 Index: common.eblit =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- common.eblit 18 Oct 2014 23:09:51 -0000 1.45 +++ common.eblit 30 May 2015 04:30:58 -0000 1.46 @@ -1,6 +1,6 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit,v 1.45 2014/10/18 23:09:51 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit,v 1.46 2015/05/30 04:30:58 vapier Exp $ alt_prefix() { is_crosscompile && echo /usr/${CTARGET} @@ -58,6 +58,13 @@ case $(tc-arch) in x86) # -march needed for #185404 #199334 + # TODO: When creating the first glibc cross-compile, this test will + # always fail as it does a full link which in turn requires glibc. + # Probably also applies when changing multilib profile settings (e.g. + # enabling x86 when the profile was amd64-only previously). + # We could change main to _start and pass -nostdlib here so that we + # only test the gcc code compilation. Or we could do a compile and + # then look for the symbol via scanelf. if ! glibc_compile_test "" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n' 2>/dev/null ; then local t=${CTARGET_OPT:-${CTARGET}} t=${t%%-*} @@ -68,9 +75,15 @@ ;; amd64) # -march needed for #185404 #199334 + # Note: This test only matters when the x86 ABI is enabled, so we could + # optimize a bit and elide it. + # TODO: See cross-compile issues listed above for x86. if ! glibc_compile_test "${CFLAGS_x86}" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n' 2>/dev/null ; then local t=${CTARGET_OPT:-${CTARGET}} t=${t%%-*} + # Normally the target is x86_64-xxx, so turn that into the -march that + # gcc actually accepts. #528708 + [[ ${t} == "x86_64" ]] && t="x86-64" filter-flags '-march=*' # ugly, ugly, ugly. ugly. CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}")