public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/101966] New: The specified --host is not always passed correctly
@ 2021-08-18 19:29 frans at fransdb dot nl
  2021-08-18 19:42 ` [Bug c/101966] " frans at fransdb dot nl
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: frans at fransdb dot nl @ 2021-08-18 19:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101966

            Bug ID: 101966
           Summary: The specified --host is not always passed correctly
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: frans at fransdb dot nl
  Target Milestone: ---
              Host: aarch64 (cortex-a53)
            Target: same
             Build: x86-64

Issue while trying to compile the second stage of gcc-11.2, to be used on an
aarch64 architecture.

Used configure command:
  --prefix=/usr               \
  --host=aarch64-cross-linux-gnueabi \
  --build=x86_64-suse-linux   \
  CC_FOR_TARGET=aarch64-cross-linux-gnueabi-gcc  \
  --enable-languages=c,c++    \
  --disable-multilib          \
  --disable-nls               \
  --disable-decimal-float     \
  --disable-libatomic         \
  --disable-libgomp           \
  --disable-libquadmath       \
  --disable-libssp            \
  --disable-libvtv            \
  --disable-libstdcxx

First some listing:
....
gcc -c  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings
-pedantic -Wno-long-long   -DHAVE_CONFIG_H -I.
-I/mnt/lfs/sources-base/gcc-11.2.0/fixincludes -I../include
-I/mnt/lfs/sources-base/gcc-11.2.0/fixincludes/../include
/mnt/lfs/sources-base/gcc-11.2.0/fixincludes/fixopts.c
gcc   -o fixincl fixincl.o fixtests.o fixfixes.o server.o procopen.o fixlib.o
fixopts.o ../libiberty/libiberty.a
echo timestamp > full-stamp
srcdir="/mnt/lfs/sources-base/gcc-11.2.0/fixincludes" /bin/sh
/mnt/lfs/sources-base/gcc-11.2.0/fixincludes/mkfixinc.sh
aarch64-cross-linux-gnueabi
sed -e 's/@gcc_version@/11.2.0/' < mkheaders.almost > mkheadersT
mv -f mkheadersT mkheaders
make[2]: Leaving directory
'/mnt/lfs/sources-base/gcc-11.2.0/gcc-build/build-x86_64-suse-linux/fixincludes'
mkdir -p -- build-x86_64-suse-linux/libcpp
Configuring in build-x86_64-suse-linux/libcpp
configure: creating cache ./config.cache
checking build system type... x86_64-suse-linux-gnu
checking host system type... x86_64-suse-linux-gnu
checking target system type... aarch64-cross-linux-gnueabi
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
.....
config.status: executing depdir commands
mkdir -p -- .deps
make[2]: Entering directory
'/mnt/lfs/sources-base/gcc-11.2.0/gcc-build/build-x86_64-suse-linux/libcpp'
g++  -I/mnt/lfs/sources-base/gcc-11.2.0/libcpp -I.
-I/mnt/lfs/sources-base/gcc-11.2.0/libcpp/../include
-I/mnt/lfs/sources-base/gcc-11.2.0/libcpp/include  -mtune=cortex-a53 -W -Wall
-Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic
-Wno-long-long  -fno-exceptions -fno-rtti
-I/mnt/lfs/sources-base/gcc-11.2.0/libcpp -I.
-I/mnt/lfs/sources-base/gcc-11.2.0/libcpp/../include
-I/mnt/lfs/sources-base/gcc-11.2.0/libcpp/include    -c -o charset.o -MT
charset.o -MMD -MP -MF .deps/charset.Tpo
/mnt/lfs/sources-base/gcc-11.2.0/libcpp/charset.c
cc1plus: error: bad value ('cortex-a53') for '-mtune=' switch
cc1plus: note: valid arguments to '-mtune=' switch are: nocona core2 nehalem
corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2
broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake
icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake
bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm intel x86-64
eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3
opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1
bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 generic native
make[2]: *** [Makefile:226: charset.o] Error 1
make[2]: Leaving directory
'/mnt/lfs/sources-base/gcc-11.2.0/gcc-build/build-x86_64-suse-linux/libcpp'
make[1]: *** [Makefile:2898: all-build-libcpp] Error 2
make[1]: Leaving directory '/mnt/lfs/sources-base/gcc-11.2.0/gcc-build'
make: *** [Makefile:947: all] Error 2

The above is right, the only thing is that the wrong host has been forwarded.
On most others it is:
----
Configuring in ./gcc
configure: creating cache ./config.cache
checking build system type... x86_64-suse-linux-gnu
checking host system type... aarch64-cross-linux-gnueabi
checking target system type... aarch64-cross-linux-gnueabi
....

It goes wrong at this point:
....
mkdir -p -- build-x86_64-suse-linux/libiberty
Configuring in build-x86_64-suse-linux/libiberty
configure: creating cache ./config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... makeinfo --split-size=5000000
checking for perl... perl
checking build system type... x86_64-suse-linux-gnu
checking host system type... x86_64-suse-linux-gnu
checking for x86_64-suse-linux-ar... ar
....
The wrong host system is mentioned, which is passed on to fixinclude with the
resulting error.

Also, earlier on it went wrong with gmp.
....
Configuring in ./gmp
configure: creating cache ./config.cache
checking build system type... x86_64-suse-linux-gnu
checking host system type... none-cross-linux-gnueabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for none-cross-linux-gnueabi-strip... no

Somehow, the configure did not get the right host passed on.

It looks like bugs, but correct me if I am wrong.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c/101966] The specified --host is not always passed correctly
  2021-08-18 19:29 [Bug c/101966] New: The specified --host is not always passed correctly frans at fransdb dot nl
@ 2021-08-18 19:42 ` frans at fransdb dot nl
  2021-08-18 20:09 ` schwab@linux-m68k.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: frans at fransdb dot nl @ 2021-08-18 19:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101966

--- Comment #1 from frans at fransdb dot nl ---
Created attachment 51319
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51319&action=edit
partial listing of compiler

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c/101966] The specified --host is not always passed correctly
  2021-08-18 19:29 [Bug c/101966] New: The specified --host is not always passed correctly frans at fransdb dot nl
  2021-08-18 19:42 ` [Bug c/101966] " frans at fransdb dot nl
@ 2021-08-18 20:09 ` schwab@linux-m68k.org
  2021-08-18 20:21 ` [Bug bootstrap/101966] " pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: schwab@linux-m68k.org @ 2021-08-18 20:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101966

--- Comment #2 from Andreas Schwab <schwab@linux-m68k.org> ---
Why are you overriding CC_FOR_TARGET?

All build modules need to be executable on the build system, so host=build is
correct.

Where does -mtune=cortex-a53 come from?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/101966] The specified --host is not always passed correctly
  2021-08-18 19:29 [Bug c/101966] New: The specified --host is not always passed correctly frans at fransdb dot nl
  2021-08-18 19:42 ` [Bug c/101966] " frans at fransdb dot nl
  2021-08-18 20:09 ` schwab@linux-m68k.org
@ 2021-08-18 20:21 ` pinskia at gcc dot gnu.org
  2021-08-18 20:24 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-18 20:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101966

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---

This configure works for me:
TOP=`pwd`
target=aarch64-marvell-linux-gnu
GCC_CONFIG_ARGS="--disable-fixed-point --without-ppl --without-python
--disable-werror --enable-plugins --with-system-zlib --with-system-zstd
--enable-initfini-array --disable-source-highlight"
ENABLE_CHECKING=""
languages="c,c++,fortran"
extra_config="--disable-sim --enable-symvers=gnu --enable-__cxa_atexit""
SYSROOT=${prefix}/${target}/sys-root
libs=${TOP}/libs-${target}


CC="$target-gcc -L${libs}/lib -I${libs}/include" \
CXX="$target-g++ -L${libs}/lib -I${libs}/include" \
${TOP}/src/configure $GCC_CONFIG_ARGS $ENABLE_CHECKING $extra_config
--target=${target} --host=${target} --enable-languages=${languages}
--prefix=/usr --with-sysroot=/ --with-build-sysroot=${SYSROOT}  
--with-pkgversion="$pkgversion"  --with-bugurl="$bugurl"
--with-libexpat-prefix=${libs}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/101966] The specified --host is not always passed correctly
  2021-08-18 19:29 [Bug c/101966] New: The specified --host is not always passed correctly frans at fransdb dot nl
                   ` (2 preceding siblings ...)
  2021-08-18 20:21 ` [Bug bootstrap/101966] " pinskia at gcc dot gnu.org
@ 2021-08-18 20:24 ` pinskia at gcc dot gnu.org
  2021-08-19  7:51 ` frans at fransdb dot nl
  2021-08-19  8:13 ` frans at fransdb dot nl
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-18 20:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101966

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
And then I just do for building:
PMAKE="make -j24"

$PMAKE all-host
make install-host DESTDIR=${SYSROOT}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/101966] The specified --host is not always passed correctly
  2021-08-18 19:29 [Bug c/101966] New: The specified --host is not always passed correctly frans at fransdb dot nl
                   ` (3 preceding siblings ...)
  2021-08-18 20:24 ` pinskia at gcc dot gnu.org
@ 2021-08-19  7:51 ` frans at fransdb dot nl
  2021-08-19  8:13 ` frans at fransdb dot nl
  5 siblings, 0 replies; 7+ messages in thread
From: frans at fransdb dot nl @ 2021-08-19  7:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101966

--- Comment #5 from frans at fransdb dot nl ---
On 8/18/21 10:09 PM, schwab@linux-m68k.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101966
>
> --- Comment #2 from Andreas Schwab <schwab@linux-m68k.org> ---
> Why are you overriding CC_FOR_TARGET?
>
> All build modules need to be executable on the build system, so host=build is
> correct.
>
> Where does -mtune=cortex-a53 come from?
>
Overriding CC_FOR_TARGET: just to make sure that the right cross 
compiler - build in the first phase - is used and not the compiler from 
the build system. This is the second phase where I compile gcc into an 
aarch64 native compiler.
So, host is not equal build system in this (second) phase.

-mtune-core-a53: from CFLAGS, just to make sure that no code is 
generated for the cortex-a72.

--- Frans.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug bootstrap/101966] The specified --host is not always passed correctly
  2021-08-18 19:29 [Bug c/101966] New: The specified --host is not always passed correctly frans at fransdb dot nl
                   ` (4 preceding siblings ...)
  2021-08-19  7:51 ` frans at fransdb dot nl
@ 2021-08-19  8:13 ` frans at fransdb dot nl
  5 siblings, 0 replies; 7+ messages in thread
From: frans at fransdb dot nl @ 2021-08-19  8:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101966

--- Comment #6 from frans at fransdb dot nl ---
I noticed that you are not using the --build switch, but rather the --target
switch. I tried that too - without the --build switch - to no avail.
I shall study your setup and report back with my result(s).

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-19  8:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18 19:29 [Bug c/101966] New: The specified --host is not always passed correctly frans at fransdb dot nl
2021-08-18 19:42 ` [Bug c/101966] " frans at fransdb dot nl
2021-08-18 20:09 ` schwab@linux-m68k.org
2021-08-18 20:21 ` [Bug bootstrap/101966] " pinskia at gcc dot gnu.org
2021-08-18 20:24 ` pinskia at gcc dot gnu.org
2021-08-19  7:51 ` frans at fransdb dot nl
2021-08-19  8:13 ` frans at fransdb dot nl

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).