public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "K. B." <kbinny62@gmail.com>
To: gcc@gcc.gnu.org
Subject: Wrong header included in cross build with asymmetric GCC versions
Date: Thu, 25 May 2017 18:23:00 -0000	[thread overview]
Message-ID: <CAB4a+N-bmyGb=yb8DigX0Z_t=Af5f1u_NW7bY=M=pQf2uvZiXw@mail.gmail.com> (raw)

A non-bootstrapped build:
build triplet is x86_64-linux-gnu
host,target triplet is x86_64-none-linux-musl
host compiler is gcc version 6.3.0

./configure --prefix=/usr --sysconfdir=/etc
--target=x86_64-none-linux-musl --host=x86_64-none-linux-musl
--libexecdir=/usr/lib --enable-threads=posix --libdir=/usr/lib
--disable-nls --with-sysroot=/ --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --with-system-zlib
--with-target-system-zlib --with-tune=generic

libgcc/config/i386/cpuinfo.c: fails on undeclared identifiers where
included "cpuid.h" ends up being incorrectly sourced from the 6.3.0
host compiler.
I believe this error is not unique to this file and exposes a larger
flaw within the build system in the handling of include paths for
non-boostrapping/cross builds and is otherwise undetected until a
header mismatch of this sort occurs.


make[3]: Leaving directory
'/home/deb/src/build/buildroot-x86/custom/gcc-7.1.0/x86_64-none-linux-musl/libgcc'
x86_64-none-linux-musl-cc   -g -O2 -O2  -g -O2 -DIN_GCC    -W -Wall
-Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include
-fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2
-fbuilding-libgcc -fno-stack-protector   -fpic -mlong-double-80
-DUSE_ELF_SYMVER -I. -I. -I../../host-x86_64-none-linux-musl/gcc
-I../.././libgcc -I../.././libgcc/. -I../.././libgcc/../gcc
-I../.././libgcc/../include  -DHAVE_CC_TLS  -DUSE_TLS -o cpuinfo.o -MT
cpuinfo.o -MD -MP -MF cpuinfo.dep  -c
../.././libgcc/config/i386/cpuinfo.c -fvisibility=hidden
-DHIDE_EXPORTS
../.././libgcc/config/i386/cpuinfo.c: In function ‘get_available_features’:
../.././libgcc/config/i386/cpuinfo.c:278:17: error:
‘bit_AVX512VPOPCNTDQ’ undeclared (first use in this function)
       if (ecx & bit_AVX512VPOPCNTDQ)
                 ^~~~~~~~~~~~~~~~~~~
../.././libgcc/config/i386/cpuinfo.c:278:17: note: each undeclared
identifier is reported only once for each function it appears in
../.././libgcc/config/i386/cpuinfo.c:280:17: error: ‘bit_AVX5124VNNIW’
undeclared (first use in this function)
       if (edx & bit_AVX5124VNNIW)
                 ^~~~~~~~~~~~~~~~
../.././libgcc/config/i386/cpuinfo.c:282:17: error: ‘bit_AVX5124FMAPS’
undeclared (first use in this function)
       if (edx & bit_AVX5124FMAPS)
                 ^~~~~~~~~~~~~~~~
../.././libgcc/shared-object.mk:14: recipe for target 'cpuinfo.o' failed
make[2]: *** [cpuinfo.o] Error 1
make[2]: Leaving directory
'/home/deb/src/build/buildroot-x86/custom/gcc-7.1.0/x86_64-none-linux-musl/libgcc'
Makefile:13316: recipe for target 'all-target-libgcc' failed
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory '/home/deb/src/build/buildroot-x86/custom/gcc-7.1.0'
Makefile:897: recipe for target 'all' failed
make: *** [all] Error 2

                 reply	other threads:[~2017-05-25 18:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAB4a+N-bmyGb=yb8DigX0Z_t=Af5f1u_NW7bY=M=pQf2uvZiXw@mail.gmail.com' \
    --to=kbinny62@gmail.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).