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

"ld: unknown option: -nostdlib" on macos #4959

Closed
stellaraccident opened this issue Feb 28, 2021 · 1 comment · Fixed by #5164
Closed

"ld: unknown option: -nostdlib" on macos #4959

stellaraccident opened this issue Feb 28, 2021 · 1 comment · Fixed by #5164
Labels
bug 🐞 Something isn't working codegen/llvm LLVM code generation compiler backend platform/macos 🍎 MacOS-specific build, execution, benchmarking, and deployment

Comments

@stellaraccident
Copy link
Collaborator

Looks like the linker tool updates need some more attention paid to them for MacOS.

2021-02-27T23:26:09.5427130Z FAILED: iree/test/e2e/tosa_ops/check_dylib-llvm-aot_dylib_floor.mlir_module.vmfb 
2021-02-27T23:26:09.5442770Z cd /Users/runner/work/iree/iree/iree-build/iree/test/e2e/tosa_ops && /Users/runner/work/iree/iree/iree-build/iree/tools/iree-translate -iree-mlir-to-vm-bytecode-module --iree-hal-target-backends=dylib-llvm-aot /Users/runner/work/iree/iree/main_checkout/iree/test/e2e/tosa_ops/floor.mlir -o check_dylib-llvm-aot_dylib_floor.mlir_module.vmfb
2021-02-27T23:26:09.5445370Z ld: unknown option: -nostdlib
2021-02-27T23:26:09.5446290Z Linking failed; command line returned exit code 256:
2021-02-27T23:26:09.5446940Z 
2021-02-27T23:26:09.5448850Z /usr/bin/ld -nostdlib -shared -undefined suppress -o /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tensor_float_ex_dispatch_0-7a32af.so -dylib -flat_namespace /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tensor_float_ex_dispatch_0-7a32af.obj
2021-02-27T23:26:09.5450030Z 
2021-02-27T23:26:09.5451220Z /Users/runner/work/iree/iree/main_checkout/iree/test/e2e/tosa_ops/floor.mlir:3:13: error: failed to link executable and generate target dylib using linker toolchain /usr/bin/ld
2021-02-27T23:26:09.5453060Z   %result = "tosa.floor"(%0) : (tensor<4xf32>) -> tensor<4xf32>
@stellaraccident stellaraccident added the platform/macos 🍎 MacOS-specific build, execution, benchmarking, and deployment label Feb 28, 2021
@ScottTodd
Copy link
Member

Also discussed here: #4719 (comment)

@ScottTodd ScottTodd added bug 🐞 Something isn't working codegen/llvm LLVM code generation compiler backend labels Mar 1, 2021
ScottTodd added a commit that referenced this issue Mar 22, 2021
Fixes #4959

I don't fully understand the static/shared distinction between these platforms/toolchains, particularly while we still have some calls to functions like `floorf`, but our tests seem to build+run+pass on macOS and Linux with these changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working codegen/llvm LLVM code generation compiler backend platform/macos 🍎 MacOS-specific build, execution, benchmarking, and deployment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants