Bug 250932 - lang/gcc10: fails to build on aarch64
Summary: lang/gcc10: fails to build on aarch64
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm64 Any
: --- Affects Some People
Assignee: freebsd-toolchain (Nobody)
URL:
Keywords:
Depends on:
Blocks: 246700
  Show dependency treegraph
 
Reported: 2020-11-07 20:10 UTC by Mikael Urankar
Modified: 2020-11-24 09:13 UTC (History)
2 users (show)

See Also:


Attachments
v1 (1.27 KB, patch)
2020-11-07 20:10 UTC, Mikael Urankar
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Urankar freebsd_committer 2020-11-07 20:10:22 UTC
Created attachment 219435 [details]
v1

c++ -std=gnu++98 -fno-PIE -c   -g -DIN_GCC    -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wno-format -
Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -I. -I/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc -I/usr/ports
/lang/gcc10/work/gcc-10.2.0/gcc/. -I/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/../include -I/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/../libcpp/include -I/usr/local/include  -I/usr/ports/lang/gcc10/work/gcc-10.2
.0/gcc/../libdecnumber -I/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/../libbacktrace  -DLIBICONV_PLUG -I. -I. -I/usr/ports/lang/gc
c10/work/gcc-10.2.0/gcc -I/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/. -I/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/../include -I/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/../libcpp/include -I/usr/local/include  -
I/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/../libdecnumber -I/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/../libbacktrace  \       
        /usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/config/aarch64/aarch64-builtins.c


/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/config/aarch64/aarch64-builtins.c:1231:3: error: expected expression
  AARCH64_INIT_MEMTAG_BUILTINS_DECL (IRG, irg, irg, fntype);
  ^   
/usr/ports/lang/gcc10/work/gcc-10.2.0/gcc/config/aarch64/aarch64-builtins.c:1227:5: note: expanded from macro 'AARCH64_INIT_MEMTAG_BUILTINS_DECL'
                                {T, CODE_FOR_##I};
                                ^

aarch64-builtins.c needs to be compiled with std=gnu++11, and the rest with gnu++98...
Comment 1 Gerald Pfeifer freebsd_committer 2020-11-07 22:29:55 UTC
Do you also see the error your report with lang/gcc10-devel, i.e., the
current upstream state of the GCC 10 release branch?

If that's the same, how about lang/gcc11-devel?

Mixing different C++ standards within one project/binary is not generally
going to succeed, and ideally we'd get a fix from upstream.  That said I
am surprised nobody else has reported this before.  Which version of FreeBSD
and clang (I assume?) are you using?  Any non-standard settings?
Comment 2 Mikael Urankar freebsd_committer 2020-11-08 14:39:40 UTC
(In reply to Gerald Pfeifer from comment #1)
It's 13-current

cc -v
FreeBSD clang version 11.0.0 (git@github.com:llvm/llvm-project.git llvmorg-11.0.0-0-g176249bd673)


gcc11-devel already use std=c++11, it seems to build so far, it'll take a while before it's done:
c++ -std=c++11  -fno-PIE -c   -g -DIN_GCC    -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -I. -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/. -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/../include -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/../libcpp/include -I/usr/local/include  -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/../libdecnumber -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/../libbacktrace  -DLIBICONV_PLUG -I. -I. -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/. -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/../include -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/../libcpp/include -I/usr/local/include  -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/../libdecnumber -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/../libbacktrace  \
        /usr/ports/lang/gcc11-devel/work/gcc-11-20201101/gcc/config/aarch64/aarch64-builtins.c

I'll try gcc10-devel when it's done.
Comment 3 Mikael Urankar freebsd_committer 2020-11-08 17:03:10 UTC
lang/gcc10-devel fails with the same error.
Comment 4 Gerald Pfeifer freebsd_committer 2020-11-13 21:30:14 UTC
Thanks for giving gcc10-devel a spin, too. 

To me this looks like clang induced breakage, and on 13-CURRENT only?
Is it possible this is something clang should/could address, or should
we see whether upstream GCC has an idea?
Comment 5 Mikael Urankar freebsd_committer 2020-11-14 08:54:59 UTC
(In reply to Gerald Pfeifer from comment #4)
I haven't tried an earlier FreeBSD version

llvm8, llvm90, llvm10 and llvm10 all fail the same way.

with gcc9, it's only a warning:
gcc/config/aarch64/aarch64-builtins.c:1227:21: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11'

gcc11-devel has switched to std=c++11 so it's a gcc problem not a llvm one
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2020-11-17 17:19:25 UTC
I can confirm gcc10 builds on aarch64 under qemu using this patch.