public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/96168] New: Cannot bootstrap with Xcode 12 Beta on aarch64, macOS 11.0/Darwin, Apple Silicon
@ 2020-07-11 16:32 gcczilla at cpellegrino dot de
  2020-07-11 16:39 ` [Bug bootstrap/96168] " gcczilla at cpellegrino dot de
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: gcczilla at cpellegrino dot de @ 2020-07-11 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96168
           Summary: Cannot bootstrap with Xcode 12 Beta on aarch64, macOS
                    11.0/Darwin, Apple Silicon
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcczilla at cpellegrino dot de
  Target Milestone: ---

Created attachment 48864
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48864&action=edit
Minimal shell script to reproduce the failure

Dear GCC team,


Thanks in advance for hearing me out even though I have near-zero experience in
C/C++ programming.

I assume you have heard of Apple’s plans to switch to aarch64 hardware for
Macs.
As a maintainer for the Homebrew package manager for macOS, I’m trying to
figure out how to build the most important FOSS projects on the new Apple
Silicon hardware.

IIRC, there have been successful third-party efforts to build older GCC
versions (such as GCC 4) for aarch64/Darwin already, targeting iOS. I have
learned that it’s completely unfeasible to forward-port those so I haven’t
tried that yet. But it shows that it’s not entirely unrealistic to build GCC 10
for aarch64/Darwin so I gave it a try.


Required information according to https://gcc.gnu.org/bugs/:

Exact version of gcc:
- I’m trying to build (bootstrap) gcc 10.1.0 from the source tarball.
- I’m running macOS 11.0 beta 1 on Apple Silicon.
- I’m using clang from Xcode 12 Beta 2.
- I have GNU make 3.81 installed, which was built from source using `brew
install make`.

System type:
- Hardware rented out from Apple
- Based on Apple Silicon, which currently is an A12z SoC based on the armv8.3
architecture.

Options when GCC was configured/built:
- See attached shell script.

Exact command line passed to the gcc program triggering the bug:
- Not applicable because I’m trying to build GCC.
- For the exact command lines passed to clang, configure and make, please see
the attached shell script.

Collection of source files for reproducing the bug, preferably a minimal set:
- See attached shell script.

Expected behavior:
- `make` builds GCC 10.1.0 and exits successfully.

Actual behavior:
- See description below.

Using information from the `gccint.info` file from GCC’s source tree, I managed
to patch a few things to the best of my knowledge. But now I’m stuck with
`make` failing at `config/aarch64/aarch64-builtins.c` as follows (edited for
clarity):

```
../../gcc/config/aarch64/aarch64-builtins.c:1225:3: error: expected expression
  AARCH64_INIT_MEMTAG_BUILTINS_DECL (IRG, irg, irg, fntype);
  ^
../../gcc/config/aarch64/aarch64-builtins.c:1221:5: note: expanded from macro
'AARCH64_INIT_MEMTAG_BUILTINS_DECL'
                                {T, CODE_FOR_##I};
                                ^

[…]

149 warnings and 6 errors generated.
make[3]: *** [aarch64-builtins.o] Error 1
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2
```

After `make` fails, I can immediately reproduce the exact same error messages
again by running:

```
cd gcc && clang++ -DIN_GCC -Wno-invalid-offsetof -Wno-ignored-attributes
-Wno-deprecated -Wno-macro-redefined -Wno-array-bounds -I. -I../../gcc
-I../../include -I../../gcc/../libcpp/include -o aarch64.o
../../gcc/config/aarch64/aarch64-builtins.c
```

I have attached a shell script showing my exact build steps. The shell script
is self-contained in the sense that it also applies the exact patches I made.
(The bug tracker seems to allow only a single attachment.)

The name of the AARCH64_INIT_MEMTAG_BUILTINS_DECL macro suggests that this is
about memory tagging. My test hardware is an Apple A12Z SoC, which is based on
armv8.3, and I know it definitely doesn’t support memory tagging, nor any other
armv8.5 feature. I aim to build for vanilla armv8 so I want to ignore any
armv8.3 or .5 features for now, such as memory tagging and pointer
authentication.

How do I tell `make` to ignore those features? What other things can I try for
`make` to get past `aarch64-builtins.c` and to help get GCC building?


Thank you very much for your time and help.

Regards and greetings from Darmstadt, Germany,  
Claudia

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

end of thread, other threads:[~2023-02-20 17:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-11 16:32 [Bug bootstrap/96168] New: Cannot bootstrap with Xcode 12 Beta on aarch64, macOS 11.0/Darwin, Apple Silicon gcczilla at cpellegrino dot de
2020-07-11 16:39 ` [Bug bootstrap/96168] " gcczilla at cpellegrino dot de
2020-07-11 16:40 ` pinskia at gcc dot gnu.org
2020-07-11 16:42 ` pinskia at gcc dot gnu.org
2020-07-11 16:50 ` gcczilla at cpellegrino dot de
2020-07-11 20:19 ` egallager at gcc dot gnu.org
2020-07-11 20:56 ` [Bug bootstrap/96168] GCC support for Apple Silicon (Arm64) on macOS requested iains at gcc dot gnu.org
2020-07-11 21:40 ` [Bug target/96168] " gcczilla at cpellegrino dot de
2020-07-11 23:40 ` keno at juliacomputing dot com
2020-07-12  0:48 ` pinskia at gcc dot gnu.org
2020-08-18  6:45 ` tkoenig at gcc dot gnu.org
2020-08-18  7:47 ` iains at gcc dot gnu.org
2021-04-26 18:19 ` noloader at gmail dot com
2021-11-05 23:18 ` timturnerc at yahoo dot com
2023-02-20 17:41 ` iains 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).