Skip to content

mold: fatal: unknown command line option: -flat_namespace #785

@georgemorgan

Description

@georgemorgan

When building Clang 16.0.0 on M1 Mac, using the latest version of mold, a fatal error is encountered: mold: fatal: unknown command line option: -flat_namespace.

Software:

    System Software Overview:

      System Version: macOS 12.6 (21G115)
      Kernel Version: Darwin 21.6.0

Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro18,3
      Chip: Apple M1 Pro
      Total Number of Cores: 10 (8 performance and 2 efficiency)
      Memory: 32 GB
mold 1.5.1 (341705e4a2593c4f64321130a2aedee9c46a66a3; compatible with GNU ld)
[961/5312] Linking CXX shared module lib/LLVMHello.dylib
FAILED: lib/LLVMHello.dylib
: && /opt/homebrew/opt/llvm/bin/clang++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -W
extra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi
 -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wn
o-comment -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -O3 -DNDEBUG -arch arm64 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -bundle -Wl,-headerpad_max_install_n
ames --ld-path=/usr/local/bin/ld64.mold -L/opt/homebrew/opt/qt@5/lib -L/opt/homebrew/opt/openssl@3/lib -L/opt/homebrew/opt/bison/lib -L
/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib -L/usr/local/lib -L/opt/homebrew/lib -fuse-ld=/usr/local/bin/ld64.mold
 -L/opt/homebrew/opt/qt@5/lib -L/opt/homebrew/opt/openssl@3/lib -L/opt/homebrew/opt/bison/lib -L/opt/homebrew/opt/llvm/lib -Wl,-rpath,/
opt/homebrew/opt/llvm/lib -L/usr/local/lib -L/opt/homebrew/lib -Wl,-flat_namespace -Wl,-undefined -Wl,suppress -Wl,--color-diagnostics
  -Wl,-dead_strip -Wl,-exported_symbols_list,"llvm-project/build/lib/Transforms/Hello/LLVMHello.exports"
-o lib/LLVMHello.dylib lib/Transforms/Hello/CMakeFiles/LLVMHello.dir/Hello.cpp.o  -Wl,-rpath,@loader_path/../lib && :
mold: fatal: unknown command line option: -flat_namespace
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
[972/5312] Building CXX object lib/Transforms/Vectorize/CMakeFiles/LLVMVectorize.dir/SLPVectorizer.cpp.o
ninja: build stopped: subcommand failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions