8000 macOS build failure: "archive member '/' not a mach-o file" during linking · Issue #20806 · iree-org/iree · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

macOS build failure: "archive member '/' not a mach-o file" during linking #20806

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

Closed
aabhinavg1 opened this issue May 14, 2025 · 4 comments
Closed

Comments

@aabhinavg1
Copy link

Bug Report: Build Failure on macOS — "archive member '/' not a mach-o file"

🫩 Description

While building IREE on macOS using Clang, the build fails during linking with errors indicating that certain .a archive members are not Mach-O files. This issue appears during the final stages of linking and affects multiple static libraries.


🧪 Steps to Reproduce

First, clone the IREE repository:

git clone https://github.com/openxla/iree.git
cd iree

Then run the following commands to build IREE on macOS:

cmake -G Ninja -B ../iree-build/ -S . \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DIREE_ENABLE_ASSERTIONS=ON \
  -DCMAKE_C_COMPILER=clang \
  -DCMAKE_CXX_COMPILER=clang++ \
  -DIREE_ENABLE_LLD=ON

Then run:

cmake --build ../iree-build/

💥 Actual Behavior

The build fails with multiple errors like:

archive member '/' not a mach-o file in '/Users/compile_sanatan/ai_asm/iree-build/runtime/src/iree/io/libiree_io_scope_map.a'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

This repeats for multiple .a files in the build directory.

Attached the buildlog

build.log

@benvanik
Copy link
Collaborator

this looks like a local toolchain issue:
https://stackoverflow.com/questions/77444892/xcode-15-0-1-macos-sonoma-clang-archive-or-linking-issue

you'll need to also set an appropriate archiver command if you are overriding the compiler

@aabhinavg1
Copy link
Author

Thanks! After switching ar from /opt/path/to/ar to /usr/bin/ar, the build worked correctly.

Would it be okay if I added a small note about this in the IREE macOS setup docs to help others avoid the same issue?

@benvanik
Copy link
Collaborator

If we have in the docs the clang overrides on macos then yes, otherwise it's not an IREE issue. I'd rather remove any override suggestion we have.

@aabhinavg1
Copy link
Author

Thanks a lot for the clarification! That really helps.

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

No branches or pull requests

2 participants
0