Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#62775 closed defect (fixed)

gcc10 @10.3.0: gcc10 failed to build from source on Big Sur 11.3

Reported by: ferdy (Giuseppe `ferdy` Miceli) Owned by: Chris Jones <jonesc@…>
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc: cjones051073 (Chris Jones), kencu (Ken)
Port: gcc10

Description

gcc@10.3.0 fails to build from source on Big Sur 11.3

please find /opt/mp/var/macports/logs/_opt_mp_macports-ports_lang_gcc10/gcc10/main.log attached.

terminal input/output

ferdy@wabi:~$ sudo port clean --all --work gcc10
--->  Cleaning gcc10
ferdy@wabi:~$ sudo port -s install libgcc10
<...>
--->  Building gcc10
Error: Failed to build gcc10: command execution failed
Error: See /opt/mp/var/macports/logs/_opt_mp_macports-ports_lang_gcc10/gcc10/main.log for details.

system information

ferdy@wabi:~$ sw_vers
ProductName:	macOS
ProductVersion:	11.3
BuildVersion:	20E232
ferdy@wabi:~$ uname -a
Darwin wabi.ferdy.lan 20.4.0 Darwin Kernel Version 20.4.0: Fri Mar  5 01:14:14 PST 2021; root:xnu-7195.101.1~3/RELEASE_X86_64 x86_64 i386 MacBookPro16,1 Darwin
ferdy@wabi:~$ xcodebuild -version
Xcode 12.5
Build version 12E262
ferdy@wabi:~$ xcode-select -version
xcode-select version 2384.
ferdy@wabi:~$ port version
Version: 2.6.4

Attachments (1)

maingcc.log.gz (1.8 MB) - added by ferdy (Giuseppe `ferdy` Miceli) 3 years ago.
/opt/mp/var/macports/logs/_opt_mp_macports-ports_lang_gcc10/gcc10/main.log

Download all attachments as: .zip

Change History (18)

Changed 3 years ago by ferdy (Giuseppe `ferdy` Miceli)

Attachment: maingcc.log.gz added

/opt/mp/var/macports/logs/_opt_mp_macports-ports_lang_gcc10/gcc10/main.log

comment:1 Changed 3 years ago by jmroot (Joshua Root)

Port: @10.3.0 removed

See also #62773. Could well be the same issue and thus a duplicate, but I'm not familiar enough with GCC to say.

comment:2 Changed 3 years ago by jmroot (Joshua Root)

Cc: cjones051073 kencu added

comment:3 Changed 3 years ago by kencu (Ken)

This is a known issue upstream, and has to do with the way clang now generates objects differently between debug and non-debug cases, leading to a bootstrap compare failure.

"The workaround will be to configure GCC without debug-compare in bootstrap."

comment:4 Changed 3 years ago by kencu (Ken)

I don't believe this is a configure.arg we pass to the gcc build, but I think it is a flag that needs to be changed internally in the build of the bootstrap compiler.

We'll have to watch Iain's repos for a fix.

comment:5 Changed 3 years ago by kencu (Ken)

Maybe not <https://gcc.gnu.org/install/build.html>

right now our build uses --with-build-config=bootstrap-debug which is failing.

If we (at least for now, on 11.3+) used --disable-bootstrap instead, I suspect we might get it building again, but without the bootstrapping, which is not ideal.

comment:6 Changed 3 years ago by cjones051073 (Chris Jones)

An alternative might be to blacklist (for now) the newer 11.3+ compilers.... I would prefer that to disabling the bootstrapping.

comment:7 Changed 3 years ago by cjones051073 (Chris Jones)

p.s. Ken, do you have a link to the upstream issue ?

comment:9 Changed 3 years ago by kencu (Ken)

this apparently worked --without-build-config

comment:10 Changed 3 years ago by kencu (Ken)

blacklisting the compiler won't fix it, as it is due to changes in the assembler implementation.

we could force our older cctools to be used, perhaps, but that is a total yuck option.

edit: forcing our older cctools actually wouldn't work, as they all would just pass to clang to assemble anyway

Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:11 Changed 3 years ago by cjones051073 (Chris Jones)

Yeah, I realised blacklist the compiler wouldn't cut it soon after looking into it a bit more....

I think assuming --without-build-config also works for us adding this (for now) as a work around specifically for Xcode 12.5 is the best option.

comment:12 Changed 3 years ago by kencu (Ken)

that indeed just disables bootstrapping I believe, but no other good option right now

edit: it actually might still bootstrap, but differently.

Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:13 Changed 3 years ago by cjones051073 (Chris Jones)

I also think it might work redirecting the build to use ld from one of the newer LLVM releases instead of cctools {which in turn is just providing a wrapper around the Xcode ld).

comment:14 Changed 3 years ago by kencu (Ken)

it's the assembler, according to upstream, so if so, a linker change would not likely be the fix

comment:15 Changed 3 years ago by ferdy (Giuseppe `ferdy` Miceli)

(for what is worth) i do confirm that `--without-build-config works and allows building from sources libgcc10 and gcc10.

ferdy@wabi:~$ sudo port -svpfRN install gcc10
<...>
ferdy@wabi:~$ port installed | grep gcc
  gcc10 @10.3.0_20210430 (active)
  gcc_select @0.1_9 (active)
  libgcc @3.0_0 (active)
  libgcc10 @10.3.0_20210430 (active)
ferdy@wabi:~$ 

comment:16 Changed 3 years ago by Chris Jones <jonesc@…>

Owner: set to Chris Jones <jonesc@…>
Resolution: fixed
Status: newclosed

In 3ec93e3430e65f5cb9fb02eab86dfb1803f0a64c/macports-ports (master):

(lib)gcc10: Add configuration work around for macOS 11.3 / Xcode 12.5
Closes: #62775

comment:17 Changed 3 years ago by kencu (Ken)

Quick work, everyone!

Note: See TracTickets for help on using tickets.