facebookarchive / BOLT

Binary Optimization and Layout Tool - A linux command-line utility used for optimizing performance of binaries
2.51k stars 177 forks source link

Change -fuse-ld=ld.lld to -fuse-ld=lld #270

Closed MaskRay closed 2 years ago

MaskRay commented 2 years ago

-fuse-ld=lld (-fuse-ld=word) is a more supported way to specify ld.lld. Clang reserves the right to do linker option dispatch on -fuse-ld=lld in the future.

(Note: -fuse-ld=relative/path and -fuse-ld=/absolute/path are deprecated. If you want to use ld.lld but with a different path, specify -fuse-ld=lld --ld-path=/absolute/path: bazelbuild/bazel#13252 )

(Note: don't test exact addresses when -fuse-ld=lld is used. ld reserves the right to change layout.)

rafaelauler commented 2 years ago

I agree testing against exact addresses is a bad idea and I'll change tests that rely on that.

I changed our -fuse-ld=ld.lld invocations but I'm getting: lld is a generic driver. Invoke ld.lld (Unix), ld64.lld (macOS), lld-link (Windows), wasm-ld (WebAssembly) instead clang-14: error: linker command failed with exit code 1 (use -v to see invocation)

rafaelauler commented 2 years ago

Oh, LIT is replacing my lld string with a full path.

aaupov commented 2 years ago

Done: 7a1af48d2f032dbd4a7dbd939954c61b28aa0837