From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB1A1388A824; Mon, 25 May 2020 16:28:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB1A1388A824 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590424112; bh=YNmfjUqaKAVxt2bx2hBZetdS1TEXJY1pMIwbfpRNtDw=; h=From:To:Subject:Date:From; b=OqKglxwOncJX9ve1RwIwKCPIAlwC+bOyLYQApO7Yn/NwKdkrynWNFcJJLL7HOGlSO QsAcl9cdM+racFQ1k4NZPK4YCHXL32VVy3bLQyYA7WHDrI4SL3l9wIWvar1ibguUiY 2qhQ7lZkHH+k15iKArW0Ums4nCXATf5W3rx/sEXc= From: "bneumeier at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/95318] New: gcc 10.1 on x86_64 fails to build aarch64 cross-compiler when using default optimization settings Date: Mon, 25 May 2020 16:28:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bneumeier at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2020 16:28:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95318 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=3Dgcc COLLECT_LTO_WRAPPER=3D/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=3D/home/cbl/cbltools --with-local-prefix=3D/home/cbl/cbltools --disable-multilib --disable-nls --enable-shared --enable-languages=3Dc,c++ --enable-c99 --enable-long-long --enable-threads=3Dposix --with-gmp=3D/home/cbl/cbltools --with-mpfr=3D/home/cbl/cbltools --with-mpc=3D/home/cbl/cbltools --with-isl=3D/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=3D/home/cbl/work/cross-tools --build=3Dx86_64-unknown-linux-gnu --host=3Dx86_64-unknown-linux-gnu --target=3Daarch64-cbl-linux-gnu --with-sysroot=3D/home/cbl/work/sysroot --with-build-sysroot=3D/home/cbl/work/sysroot --disable-decimal-float --disable-libgomp --disable-libmudflap --disable-libssp --disable-multilib --disable-nls --disable-shared --disable-threads --enable-languages=3Dc,c++ --with-newlib --without-headers --with-gmp=3D/home/cbl/cbltools --with-mpfr=3D/home/cbl/cbltools --with-mpc=3D/home/cbl/cbltools --with-isl=3D/home/cbl/cbltools --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419 --with-cpu=3Dcortex-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=3D/home/cbl/work/sysroot -g -O2 -O2 -g -O2 -DIN_GCC=20 -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=3Dformat-diag -Wstrict-prototypes -Wmissing-prototyp= es -Wno-error=3Dformat-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=3Dhidden -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-stri= ngs -Wcast-qual -Wno-error=3Dformat-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=20 -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-lo= w.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.=