[flang-commits] [flang] [clang] [flang][driver] Don't use -whole-archive on Darwin (PR #75393)

via flang-commits flang-commits at lists.llvm.org
Thu Dec 14 10:27:01 PST 2023


kkwli wrote:

> > I build and `check-flang` on `arm64-apple-darwin22.6.0`. `Driver/no-duplicate-main.f90` fails in the 3rd RUN. The test passes with HEAD.
> > ```
> > kelvin at neutrino2 build % /Users/kelvin/wrk/llvm/tmp/build/bin/flang-new -o /Users/kelvin/wrk/llvm/tmp/build/tools/flang/test/Driver/Output/no-duplicate-main.f90.tmp.exe /Users/kelvin/wrk/llvm/tmp/build/tools/flang/test/Driver/Output/no-duplicate-main.f90.tmp /Users/kelvin/wrk/llvm/tmp/build/tools/flang/test/Driver/Output/no-duplicate-main.f90.tmp.c-object
> > 
> > kelvin at neutrino2 build % echo $?
> > 0
> > ```
> 
> Unrelated to this PR, but may I ask how do you configure flang, to make it link without errors and without extra flags? I need to add `-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib`.

I do not have any special configure. Here is my `cmake` command:
```
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release $HOME/wrk/llvm/tmp/llvm-project/llvm \
  -DCMAKE_INSTALL_PREFIX=$HOME/wrk/llvm/tmp/llvm-install -DLLVM_TARGETS_TO_BUILD="AArch64" \
  -DCMAKE_OSX_ARCHITECTURES="arm64" -DLLVM_ENABLE_PROJECTS="clang;flang;mlir" \
  -DLLVM_ENABLE_RUNTIMES="openmp;compiler-rt" -DDEFAULT_SYSROOT="$(xcrun --show-sdk-path)" \
  -DCMAKE_CXX_COMPILER=$HOME/wrk/llvm/17.0.4/bin/clang++ \
  -DCMAKE_C_COMPILER=$HOME/wrk/llvm/17.0.4/bin/clang \
  -DBUILTINS_CMAKE_ARGS=-DCOMPILER_RT_ENABLE_IOS=OFF \
  -DLLVM_LIT_ARGS="--threads=8 -v --show-unsupported"
```

https://github.com/llvm/llvm-project/pull/75393


More information about the flang-commits mailing list