Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precompiled header broken on Mac #1549

Open
slipher opened this issue Feb 11, 2025 · 1 comment
Open

Precompiled header broken on Mac #1549

slipher opened this issue Feb 11, 2025 · 1 comment

Comments

@slipher
Copy link
Member

slipher commented Feb 11, 2025

Precompiled headers on Mac are still broken since #982. The problem of #1508 that USE_PRECOMPILED_HEADER is ignored was fixed: now it attempts to build a PCH. But the build does not succeed.

[ 53%] Generating CMakeFiles/engine-lib.h.gch
/Library/Developer/CommandLineTools/usr/bin/c++ -DBUILD_ENGINE -DDAEMON_ARCH_amd64 -DARCH_STRING=amd64 -DNACL_ARCH_STRING=amd64 -DDAEMON_USE_ARCH_INTRINSICS=1 -DDAEMON_USE_ARCH_INTRINSICS_amd64=1 -DDAEMON_USE_ARCH_INTRINSICS_i686=1 -DDAEMON_C_COMPILER_AppleClang=1 -DDAEMON_C_COMPILER_STRING=AppleClang_15.0.0/Clang_15.0.0:cc -DDAEMON_CXX_COMPILER_AppleClang=1 -DDAEMON_CXX_COMPILER_STRING=AppleClang_15.0.0/Clang_15.0.0:c++ -DDAEMON_BUILD_RelWithDebInfo -DDAEMON_USE_COMPILER_INTRINSICS=1 -DDAEMON_USE_COMPILER_CUSTOMIZATION=1 -DMACOS_X -DTHIS_IS_NOT_A_DEBUG_BUILD -DUSE_MUMBLE -DNACL_WINDOWS=0 -DNACL_LINUX=0 -DNACL_ANDROID=0 -DNACL_FREEBSD=0 -DNACL_OSX=1 -DNACL_BUILD_ARCH=x86 -DNACL_BUILD_SUBARCH=64 -DPDC_WIDE -DPDC_FORCE_UTF8 -DPDC_RGB -DUSE_CURSES -I/Users/slipher/Unvanquished/daemon/src -I/Users/slipher/Unvanquished/daemon/libs -I/Users/slipher/Unvanquished/daemon/libs/nacl -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/OpenGL.framework -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include -I/Users/slipher/Unvanquished/daemon/libs/pdcursesmod -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include/opus -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Library/Frameworks/Mono.framework/Headers -I/Library/Frameworks/Mono.framework/Headers -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include -I/Library/Frameworks/Mono.framework/Headers -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include/freetype2 -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include/AL -I/Users/slipher/Unvanquished/daemon/src -I/Users/slipher/Unvanquished/daemon/libs -I/Users/slipher/Unvanquished/daemon/libs/nacl -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/OpenGL.framework -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include -I/Users/slipher/Unvanquished/daemon/libs/pdcursesmod -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include/opus -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Library/Frameworks/Mono.framework/Headers -I/Library/Frameworks/Mono.framework/Headers -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include -I/Library/Frameworks/Mono.framework/Headers -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include/freetype2 -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include -I/Users/slipher/Unvanquished/daemon/external_deps/macos-amd64-default_10/include/AL -I/Users/slipher/Unvanquished/daemon/src/engine -I/Users/slipher/Unvanquished/daemon/src -I/Users/slipher/Unvanquished/daemon/libs -std=gnu++14 -ffast-math -fvisibility=hidden -fno-strict-aliasing -march=x86-64 -mtune=generic -mcx16 -Wall -Wextra -Wno-pragmas -Wno-unknown-pragmas -Wno-old-style-cast -Woverloaded-virtual -Wno-sign-compare       -O2 -g -DNDEBUG -g3 -D_FORTIFY_SOURCE=2    -x c++-header /Users/slipher/Unvanquished/daemon/src/common/Common.h -o /Users/slipher/Unvanquished/daemon/build/CMakeFiles/engine-lib.h.gch
clang: error: unsupported argument 'x86-64' to option '-march='
@illwieckz
Copy link
Member

illwieckz commented Feb 14, 2025

I don't reproduce that bug on an amd64 macOS Sequoia. Is that reproduced on an arm64 mac? What is the macOS version and compiler version?

On my end I have:

$ uname -srm
Darwin 24.2.0 x86_64

$ sw_vers
ProductName:		macOS
ProductVersion:		15.2
BuildVersion:		24C101

$ clang --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: x86_64-apple-darwin24.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

$ clang -print-targets

  Registered Targets:
    aarch64    - AArch64 (little endian)
    aarch64_32 - AArch64 (little endian ILP32)
    aarch64_be - AArch64 (big endian)
    arm        - ARM
    arm64      - ARM64 (little endian)
    arm64_32   - ARM64 (little endian ILP32)
    armeb      - ARM (big endian)
    thumb      - Thumb
    thumbeb    - Thumb (big endian)
    x86        - 32-bit X86: Pentium-Pro and above
    x86-64     - 64-bit X86: EM64T and AMD64

It may be a compiler bug if the bug happens on arm64 compiling amd64 but not on amd64 compiling amd64.

It may also be a compiler bug if the bug only happens with PCH as if the build succeeds without PCH it means the -march=x86-64 options isn't unsupported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants