[PATCH] D138451: [lld/mac] Add support for distributed ThinLTO

Haowei Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 16:14:50 PST 2023


haowei added a comment.

We are seeing a linker error on Mac builder today when we try to roll the clang toolchain for Flutter, error message (build task: https://ci.chromium.org/ui/p/flutter/builders/try/Mac%20Unopt/25679/overview):

  [3356/6995] LINK ./geometry_benchmarks
  [3357/6995] SOLINK libtessellator.dylib libtessellator.dylib.TOC
  FAILED: libtessellator.dylib libtessellator.dylib.TOC 
  if [ ! -e ./libtessellator.dylib -o ! -e ./libtessellator.dylib.TOC ] || otool -l ./libtessellator.dylib | grep -q LC_REEXPORT_DYLIB ; then ../../buildtools/mac-x64/clang/bin/clang++ -shared -isysroot /Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk -mmacosx-version-min=10.14.0  -Wl,-object_path_lto,./lto_libtessellator.o -arch x86_64 -nostdlib++ -Wl,-search_paths_first -L. -Wl,-rpath, at loader_path/. -Wl,-rpath, at loader_path/../../.. -o ./libtessellator.dylib -Wl,-filelist,./libtessellator.dylib.rsp   -framework Foundation && { otool -l ./libtessellator.dylib | grep LC_ID_DYLIB -A 5; nm -gP ./libtessellator.dylib | cut -f1-2 -d' ' | grep -v U$$; true; } > ./libtessellator.dylib.TOC; else ../../buildtools/mac-x64/clang/bin/clang++ -shared -isysroot /Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk -mmacosx-version-min=10.14.0  -Wl,-object_path_lto,./lto_libtessellator.o -arch x86_64 -nostdlib++ -Wl,-search_paths_first -L. -Wl,-rpath, at loader_path/. -Wl,-rpath, at loader_path/../../.. -o ./libtessellator.dylib -Wl,-filelist,./libtessellator.dylib.rsp   -framework Foundation && { otool -l ./libtessellator.dylib | grep LC_ID_DYLIB -A 5; nm -gP ./libtessellator.dylib | cut -f1-2 -d' ' | grep -v U$$; true; } > ./libtessellator.dylib.tmp && if ! cmp -s ./libtessellator.dylib.tmp ./libtessellator.dylib.TOC; then mv ./libtessellator.dylib.tmp ./libtessellator.dylib.TOC ; fi; fi
  ld64.lld: error: No available targets are compatible with triple ""
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)

We did a manual bisecting clang prebuilts and we think this patch is causing the issue.

The bug can be reproduced on a Mac x64 with following steps:

- Create a source file `foo.c` containing `int foo() { return 123; }`
- Run `clang++ -c -o foo.o foo.c `
- Run `clang++ -shared -nostdlib -Wl,-object_path_lto,foo.o -o foo.dylib foo.o`

With this patch, it will output: `ld64.lld: error: No available targets are compatible with triple ""`. Without this patch, the clang++ will return 0.
Would you mind take a look please?

We are still trying to understand why this patch is causing this issue, maybe it uncovered a bug somewhere else.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138451/new/

https://reviews.llvm.org/D138451



More information about the llvm-commits mailing list