public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings
@ 2020-05-25 16:28 bneumeier at gmail dot com
  2020-05-25 16:29 ` [Bug bootstrap/95318] " bneumeier at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: bneumeier at gmail dot com @ 2020-05-25 16:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95318
           Summary: gcc 10.1 on x86_64 fails to build aarch64
                    cross-compiler when using default optimization
                    settings
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bneumeier at gmail dot com
  Target Milestone: ---

This issue is seen when building an X86_64-to-AArch64 cross-compiler
using GCC 10.1.

`gcc -v` on the host computer reports:
----------
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/cbl/cbltools/libexec/gcc/x86_64-pc-linux-gnu/10.1.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /path/to/gcc-10.1.0/configure
  --prefix=/home/cbl/cbltools --with-local-prefix=/home/cbl/cbltools
  --disable-multilib --disable-nls --enable-shared
  --enable-languages=c,c++ --enable-c99 --enable-long-long
  --enable-threads=posix --with-gmp=/home/cbl/cbltools
  --with-mpfr=/home/cbl/cbltools --with-mpc=/home/cbl/cbltools
  --with-isl=/home/cbl/cbltools
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.1.1 20200507 (GCC)
----------

The cross-compiler build was configured with:

../gcc-10.1.0/configure --prefix=/home/cbl/work/cross-tools
--build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu
--target=aarch64-cbl-linux-gnu --with-sysroot=/home/cbl/work/sysroot
--with-build-sysroot=/home/cbl/work/sysroot --disable-decimal-float
--disable-libgomp --disable-libmudflap --disable-libssp --disable-multilib
--disable-nls --disable-shared --disable-threads --enable-languages=c,c++
--with-newlib --without-headers --with-gmp=/home/cbl/cbltools
--with-mpfr=/home/cbl/cbltools --with-mpc=/home/cbl/cbltools
--with-isl=/home/cbl/cbltools --enable-fix-cortex-a53-835769
--enable-fix-cortex-a53-843419 --with-cpu=cortex-a72.cortex-a53

The issue is encountered after successfully completing the `all-gcc` make
target, and running `make all-target-libgcc`. Compilation of libgcc/unwind-c.c
produces errors:

/home/cbl/work/build/build-gcc-2/./gcc/xgcc
-B/home/cbl/work/build/build-gcc-2/./gcc/
-B/home/cbl/work/cross-tools/aarch64-cbl-linux-gnu/bin/
-B/home/cbl/work/cross-tools/aarch64-cbl-linux-gnu/lib/ -isystem
/home/cbl/work/cross-tools/aarch64-cbl-linux-gnu/include -isystem
/home/cbl/work/cross-tools/aarch64-cbl-linux-gnu/sys-include
--sysroot=/home/cbl/work/sysroot   -g -O2 -O2  -g -O2 -DIN_GCC 
-DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wstrict-prototypes -Wmissing-prototypes
-Wno-error=format-diag -Wold-style-definition  -isystem ./include   -fPIC -g
-DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -fPIC -I.
-I. -I../.././gcc -I/home/cbl/work/build/gcc-10.1.0/libgcc
-I/home/cbl/work/build/gcc-10.1.0/libgcc/.
-I/home/cbl/work/build/gcc-10.1.0/libgcc/../gcc
-I/home/cbl/work/build/gcc-10.1.0/libgcc/../include  -DHAVE_CC_TLS  -o
unwind-c.o -MT unwind-c.o -MD -MP -MF unwind-c.dep -fexceptions -c
/home/cbl/work/build/gcc-10.1.0/libgcc/unwind-c.c -fvisibility=hidden
-DHIDE_EXPORTS

/tmp/cc3usGId.s: Assembler messages:
/tmp/cc3usGId.s: Error: invalid operands (*ABS* and *GAS `expr' section*
sections) for `*' when setting `.LVU94'
/tmp/cc3usGId.s: Error: can't resolve value for symbol `.LVU94'

If I add the `-fno-align-loops` directive, this avoids the errors.

I'm attaching the preprocessed source `unwind-c.i`, and the compiled
`unwind-c.s` both with `-fno-align-loops` (working) and without (error).

After adding `-fno-align-loops` as a workaround, the cross-compiler build
completes without further issues. However, actually using the resulting
cross-compiler to build a target-native GCC (again, unless -fno-align-loops is
specified) fails with similar error messages on several other files, e.g.:

aarch64-cbl-linux-gnu-g++ -fno-PIE -c   -g -O2 -DIN_GCC     -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I.
-I/home/cbl/work/build/gcc-10.1.0/gcc -I/home/cbl/work/build/gcc-10.1.0/gcc/.
-I/home/cbl/work/build/gcc-10.1.0/gcc/../include
-I/home/cbl/work/build/gcc-10.1.0/gcc/../libcpp/include
-I/home/cbl/work/sysroot/scaffolding/include
-I/home/cbl/work/sysroot/scaffolding/include
-I/home/cbl/work/sysroot/scaffolding/include 
-I/home/cbl/work/build/gcc-10.1.0/gcc/../libdecnumber
-I/home/cbl/work/build/gcc-10.1.0/gcc/../libdecnumber/dpd -I../libdecnumber
-I/home/cbl/work/build/gcc-10.1.0/gcc/../libbacktrace
-I/home/cbl/work/sysroot/scaffolding/include  -o gimple-low.o -MT gimple-low.o
-MMD -MP -MF ./.deps/gimple-low.TPo
/home/cbl/work/build/gcc-10.1.0/gcc/gimple-low.c
/tmp/ccMqyaI0.s: Assembler messages:
/tmp/ccMqyaI0.s: Error: invalid operands (*ABS* and *GAS `expr' section*
sections) for `*' when setting `.LVU289'
/tmp/ccMqyaI0.s: Error: can't resolve value for symbol `.LVU289'

If that's interesting enough to provide additional details on, please let me
know and I'll attach relevant files for those issues as well.

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

* [Bug bootstrap/95318] gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings
  2020-05-25 16:28 [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings bneumeier at gmail dot com
@ 2020-05-25 16:29 ` bneumeier at gmail dot com
  2020-05-25 16:29 ` bneumeier at gmail dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bneumeier at gmail dot com @ 2020-05-25 16:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Brett Neumeier <bneumeier at gmail dot com> ---
Created attachment 48594
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48594&action=edit
preprocessed source

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

* [Bug bootstrap/95318] gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings
  2020-05-25 16:28 [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings bneumeier at gmail dot com
  2020-05-25 16:29 ` [Bug bootstrap/95318] " bneumeier at gmail dot com
@ 2020-05-25 16:29 ` bneumeier at gmail dot com
  2020-05-25 16:30 ` bneumeier at gmail dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bneumeier at gmail dot com @ 2020-05-25 16:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Brett Neumeier <bneumeier at gmail dot com> ---
Created attachment 48595
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48595&action=edit
result of compilation with default settings

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

* [Bug bootstrap/95318] gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings
  2020-05-25 16:28 [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings bneumeier at gmail dot com
  2020-05-25 16:29 ` [Bug bootstrap/95318] " bneumeier at gmail dot com
  2020-05-25 16:29 ` bneumeier at gmail dot com
@ 2020-05-25 16:30 ` bneumeier at gmail dot com
  2020-05-25 19:31 ` [Bug middle-end/95318] " pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bneumeier at gmail dot com @ 2020-05-25 16:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Brett Neumeier <bneumeier at gmail dot com> ---
Created attachment 48596
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48596&action=edit
result of compilation with -fno-align-loop specified

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

* [Bug middle-end/95318] gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings
  2020-05-25 16:28 [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings bneumeier at gmail dot com
                   ` (2 preceding siblings ...)
  2020-05-25 16:30 ` bneumeier at gmail dot com
@ 2020-05-25 19:31 ` pinskia at gcc dot gnu.org
  2020-05-25 19:41 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-05-25 19:31 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
          Component|bootstrap                   |middle-end
   Last reconfirmed|                            |2020-05-25
     Ever confirmed|0                           |1
           Keywords|                            |assemble-failure, build

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
What binutils version you are using?

        orr     x4, x4, x7
.LVL33:
        .loc 1 170 12 view .LVU92
.LBE26:
.LBE25:
.LBE24:
        .loc 1 263 7 is_stmt 1 view .LVU93
****    .p2align 3,,7
.L36:
        .loc 1 281 4 view .LVU94
        .loc 1 282 35 is_stmt 0 view .LVU95
        and     w6, w5, 112

This seems like a bug in binutils to me.
The only difference between with/without -fno-align-loops is the line marked
with ****.

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

* [Bug middle-end/95318] gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings
  2020-05-25 16:28 [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings bneumeier at gmail dot com
                   ` (3 preceding siblings ...)
  2020-05-25 19:31 ` [Bug middle-end/95318] " pinskia at gcc dot gnu.org
@ 2020-05-25 19:41 ` pinskia at gcc dot gnu.org
  2020-05-25 19:45 ` bneumeier at gmail dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-05-25 19:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The assembler code works for me with binutils 2.33.1.  So again which version
of binutils are you using for the cross compiler?

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

* [Bug middle-end/95318] gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings
  2020-05-25 16:28 [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings bneumeier at gmail dot com
                   ` (4 preceding siblings ...)
  2020-05-25 19:41 ` pinskia at gcc dot gnu.org
@ 2020-05-25 19:45 ` bneumeier at gmail dot com
  2020-05-25 20:34 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bneumeier at gmail dot com @ 2020-05-25 19:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Brett Neumeier <bneumeier at gmail dot com> ---
The host binutils (used to compile the cross-toolchain):

$ as --version
GNU assembler (GNU Binutils) 2.34.0.20200507
Copyright (C) 2020 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-pc-linux-gnu'.

The cross-binutils is:

$ ./aarch64-cbl-linux-gnu-as --version
GNU assembler (GNU Binutils) 2.34.0.20200517
Copyright (C) 2020 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `aarch64-cbl-linux-gnu'.

So, pretty much the same, the cross-toolchain has more updates from the
binutils 2.34 branch.

I can try again with 2.33.1 and see if I get different results, if that would
help?

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

* [Bug middle-end/95318] gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings
  2020-05-25 16:28 [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings bneumeier at gmail dot com
                   ` (5 preceding siblings ...)
  2020-05-25 19:45 ` bneumeier at gmail dot com
@ 2020-05-25 20:34 ` pinskia at gcc dot gnu.org
  2020-05-25 20:37 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-05-25 20:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Brett Neumeier from comment #6)
> I can try again with 2.33.1 and see if I get different results, if that
> would help?

If it works with 2.33.1, can you report this directly to binutils:
https://sourceware.org/bugzilla ?  Since this is a bug in binutils as far as I
can tell.

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

* [Bug middle-end/95318] gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings
  2020-05-25 16:28 [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings bneumeier at gmail dot com
                   ` (6 preceding siblings ...)
  2020-05-25 20:34 ` pinskia at gcc dot gnu.org
@ 2020-05-25 20:37 ` pinskia at gcc dot gnu.org
  2020-05-25 21:36 ` bneumeier at gmail dot com
  2020-05-25 21:39 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-05-25 20:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note I think it is related to the fixes that was done for
https://sourceware.org/bugzilla/show_bug.cgi?id=24444 which was fixed in 2.34.

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

* [Bug middle-end/95318] gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings
  2020-05-25 16:28 [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings bneumeier at gmail dot com
                   ` (7 preceding siblings ...)
  2020-05-25 20:37 ` pinskia at gcc dot gnu.org
@ 2020-05-25 21:36 ` bneumeier at gmail dot com
  2020-05-25 21:39 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: bneumeier at gmail dot com @ 2020-05-25 21:36 UTC (permalink / raw)
  To: gcc-bugs

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

Brett Neumeier <bneumeier at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
                 CC|                            |bneumeier at gmail dot com
             Status|WAITING                     |RESOLVED

--- Comment #9 from Brett Neumeier <bneumeier at gmail dot com> ---
Confirmed, the issue does not occur with 2.33.1. Thank you for your attention
and help!

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

* [Bug middle-end/95318] gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings
  2020-05-25 16:28 [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings bneumeier at gmail dot com
                   ` (8 preceding siblings ...)
  2020-05-25 21:36 ` bneumeier at gmail dot com
@ 2020-05-25 21:39 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-05-25 21:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Brett Neumeier from comment #9)
> Confirmed, the issue does not occur with 2.33.1. Thank you for your
> attention and help!

Please CC me on the binutils bug (just so I can keep track of it).

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

end of thread, other threads:[~2020-05-25 21:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 16:28 [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings bneumeier at gmail dot com
2020-05-25 16:29 ` [Bug bootstrap/95318] " bneumeier at gmail dot com
2020-05-25 16:29 ` bneumeier at gmail dot com
2020-05-25 16:30 ` bneumeier at gmail dot com
2020-05-25 19:31 ` [Bug middle-end/95318] " pinskia at gcc dot gnu.org
2020-05-25 19:41 ` pinskia at gcc dot gnu.org
2020-05-25 19:45 ` bneumeier at gmail dot com
2020-05-25 20:34 ` pinskia at gcc dot gnu.org
2020-05-25 20:37 ` pinskia at gcc dot gnu.org
2020-05-25 21:36 ` bneumeier at gmail dot com
2020-05-25 21:39 ` pinskia at gcc dot gnu.org

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