Opened 12 months ago

Last modified 11 months ago

#72427 new defect

libgcc14: error: '_Alignof' was not declared in this scope

Reported by: cgilles (HumanDynamo) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.10.6
Keywords: haspatch sequoia Cc:
Port: libgcc14

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Macbook pro M1
MacOS Sequoia 15.4.1
XCode 16.3

--->  Building clang-18
--->  Staging clang-18 into destroot
--->  Installing clang-18 @18.1.8_4+analyzer
--->  Activating clang-18 @18.1.8_4+analyzer
--->  Cleaning clang-18
--->  Fetching distfiles for gcc14-libcxx
--->  Verifying checksums for gcc14-libcxx
--->  Extracting gcc14-libcxx
--->  Configuring gcc14-libcxx
--->  Building gcc14-libcxx
--->  Staging gcc14-libcxx into destroot
--->  Installing gcc14-libcxx @14.2.0_3+clang18
--->  Activating gcc14-libcxx @14.2.0_3+clang18
--->  Cleaning gcc14-libcxx
--->  Fetching distfiles for libgcc14
--->  Attempting to fetch gcc-14.2.0.tar.xz from https://distfiles.macports.org/gcc14
--->  Verifying checksums for libgcc14
--->  Extracting libgcc14
--->  Applying patches to libgcc14
--->  Configuring libgcc14
--->  Building libgcc14
Error: Failed to build libgcc14: command execution failed
Error: See /opt/digikam.org.arm64/var/macports/logs/_opt_digikam.org.arm64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc14/libgcc14/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port qt6-qtmultimedia failed
FAILED COMMAND: port install qt$DK_QTVERSION$MP_QTSUBVERSION-qtmultimedia -examples -tests

Attachments (1)

main.log.gz (471.3 KB) - added by cgilles (HumanDynamo) 12 months ago.
gziped libgcc14 log file

Download all attachments as: .zip

Change History (8)

Changed 12 months ago by cgilles (HumanDynamo)

Attachment: main.log.gz added

gziped libgcc14 log file

comment:1 Changed 12 months ago by cgilles (HumanDynamo)

Note: for backward compatibility, MacOS SDK version 11.3 is installed and used to compile all Macports packages. From my /opt/digikam.org.arm64/etc/macports/macports.conf:

...
macosx_deployment_target 11.3
build_arch arm64
...

comment:2 Changed 12 months ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: haspatch sequoia added
Summary: libgcc14 build fail while installing Qt6-Multimedialibgcc14: error: '_Alignof' was not declared in this scope

Error in log is:

/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:627:35: error: expected primary-expression before 'unsigned'
  627 | } __attribute__((aligned(_Alignof(unsigned int))));
      |                                   ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:627:26: error: '_Alignof' was not declared in this scope
  627 | } __attribute__((aligned(_Alignof(unsigned int))));
      |                          ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:633:35: error: expected primary-expression before 'unsigned'
  633 | } __attribute__((aligned(_Alignof(unsigned int))));
      |                                   ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:633:26: error: '_Alignof' was not declared in this scope
  633 | } __attribute__((aligned(_Alignof(unsigned int))));
      |                          ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:639:35: error: expected primary-expression before 'unsigned'
  639 | } __attribute__((aligned(_Alignof(unsigned int))));
      |                                   ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:639:26: error: '_Alignof' was not declared in this scope
  639 | } __attribute__((aligned(_Alignof(unsigned int))));
      |                          ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:645:35: error: expected primary-expression before 'unsigned'
  645 | } __attribute__((aligned(_Alignof(unsigned int))));
      |                                   ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:645:26: error: '_Alignof' was not declared in this scope
  645 | } __attribute__((aligned(_Alignof(unsigned int))));
      |                          ^~~~~~~~
make[5]: *** [aarch64-apple-darwin24/bits/stdc++.h.gch/O2ggnu++0x.gch] Error 1

I found a corresponding Homebrew report but it just says it has already been fixed.

I believe the fix was this commit from this PR.

This seems to be a new problem caused by the macOS 15.4 SDK, so your macOS 11.3 SDK is evidently not being used here.

comment:3 Changed 12 months ago by jvianalopes (João Lopes)

I have the same error... To compile, I am adding "#define _Alignof alignof" at the beginning of each C++ code.

comment:4 Changed 12 months ago by cgilles (HumanDynamo)

The patch listed in comment 2 is the right way and libgcc14 compile fine with some little modifications. All is given here:

https://invent.kde.org/graphics/digikam/-/tree/master/project/bundles/macports/patches/lang/gcc14?ref_type=heads

Last edited 12 months ago by cgilles (HumanDynamo) (previous) (diff)

comment:5 Changed 11 months ago by pfusik (Piotr Fusik)

I'm also affected by this.

Homebrew fixed it.

comment:6 Changed 11 months ago by RobertoBagnara (Roberto Bagnara)

I am also affected by this problem.

comment:7 Changed 11 months ago by rickyegeland (Ricky Egeland)

I was able to workaround this issue by installing Command Line Tools for Xcode 16.4 released May 27.

Note: See TracTickets for help on using tickets.