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

unsupported linker arg: --dependency-file #206

Closed
ssmid opened this issue Jan 23, 2025 · 7 comments
Closed

unsupported linker arg: --dependency-file #206

ssmid opened this issue Jan 23, 2025 · 7 comments

Comments

@ssmid
Copy link

ssmid commented Jan 23, 2025

CMAKE_BUILD_PARALLEL_LEVEL=28. /build x86_64-linux-gnu baseline

[...]
[ 34%] Linking CXX executable ../../bin/llvm-itanium-demangle-fuzzer
[ 34%] Built target LLVMDebugInfoCodeView
[ 35%] Built target LLVMOrcTargetProcess
error: unsupported linker arg: --dependency-file=CMakeFiles/llvm-dlang-demangle-fuzzer.dir/link.d
make[2]: *** [tools/llvm-dlang-demangle-fuzzer/CMakeFiles/llvm-dlang-demangle-fuzzer.dir/build.make:125: bin/llvm-dlang-demangle-fuzzer] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:52785: tools/llvm-dlang-demangle-fuzzer/CMakeFiles/llvm-dlang-demangle-fuzzer.dir/all] Fehler 2
make[1]: *** Es wird auf noch nicht beendete Prozesse gewartet …
error: unsupported linker arg: --dependency-file=CMakeFiles/llvm-itanium-demangle-fuzzer.dir/link.d
[ 35%] Built target LLVMBinaryFormat
make[2]: *** [tools/llvm-itanium-demangle-fuzzer/CMakeFiles/llvm-itanium-demangle-fuzzer.dir/build.make:125: bin/llvm-itanium-demangle-fuzzer] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:53411: tools/llvm-itanium-demangle-fuzzer/CMakeFiles/llvm-itanium-demangle-fuzzer.dir/all] Fehler 2
[ 35%] Linking CXX executable ../../../../bin/clang-tblgen
[ 35%] Built target LLVMTableGenCommon
error: unsupported linker arg: --dependency-file=CMakeFiles/clang-tblgen.dir/link.d
make[2]: *** [tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/build.make:429: bin/clang-tblgen] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:36258: tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/all] Fehler 2
[ 35%] Linking CXX executable ../../bin/llvm-tblgen
error: unsupported linker arg: --dependency-file=CMakeFiles/llvm-tblgen.dir/link.d
make[2]: *** [utils/TableGen/CMakeFiles/llvm-tblgen.dir/build.make:844: bin/llvm-tblgen] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:11224: utils/TableGen/CMakeFiles/llvm-tblgen.dir/all] Fehler 2
[ 35%] Linking CXX executable ../../bin/llvm-microsoft-demangle-fuzzer
error: unsupported linker arg: --dependency-file=CMakeFiles/llvm-microsoft-demangle-fuzzer.dir/link.d
make[2]: *** [tools/llvm-microsoft-demangle-fuzzer/CMakeFiles/llvm-microsoft-demangle-fuzzer.dir/build.make:125: bin/llvm-microsoft-demangle-fuzzer] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:53985: tools/llvm-microsoft-demangle-fuzzer/CMakeFiles/llvm-microsoft-demangle-fuzzer.dir/all] Fehler 2
[ 35%] Linking CXX executable ../../bin/llvm-rust-demangle-fuzzer
error: unsupported linker arg: --dependency-file=CMakeFiles/llvm-rust-demangle-fuzzer.dir/link.d
make[2]: *** [tools/llvm-rust-demangle-fuzzer/CMakeFiles/llvm-rust-demangle-fuzzer.dir/build.make:125: bin/llvm-rust-demangle-fuzzer] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:55769: tools/llvm-rust-demangle-fuzzer/CMakeFiles/llvm-rust-demangle-fuzzer.dir/all] Fehler 2
[ 35%] Linking CXX executable ../../bin/llvm-special-case-list-fuzzer
error: unsupported linker arg: --dependency-file=CMakeFiles/llvm-special-case-list-fuzzer.dir/link.d
make[2]: *** [tools/llvm-special-case-list-fuzzer/CMakeFiles/llvm-special-case-list-fuzzer.dir/build.make:124: bin/llvm-special-case-list-fuzzer] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:55937: tools/llvm-special-case-list-fuzzer/CMakeFiles/llvm-special-case-list-fuzzer.dir/all] Fehler 2
[ 35%] Linking CXX executable ../../bin/llvm-yaml-parser-fuzzer
error: unsupported linker arg: --dependency-file=CMakeFiles/llvm-yaml-parser-fuzzer.dir/link.d
make[2]: *** [tools/llvm-yaml-parser-fuzzer/CMakeFiles/llvm-yaml-parser-fuzzer.dir/build.make:124: bin/llvm-yaml-parser-fuzzer] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:56573: tools/llvm-yaml-parser-fuzzer/CMakeFiles/llvm-yaml-parser-fuzzer.dir/all] Fehler 2
[ 35%] Linking CXX executable ../../bin/llvm-yaml-numeric-parser-fuzzer
error: unsupported linker arg: --dependency-file=CMakeFiles/llvm-yaml-numeric-parser-fuzzer.dir/link.d
make[2]: *** [tools/llvm-yaml-numeric-parser-fuzzer/CMakeFiles/llvm-yaml-numeric-parser-fuzzer.dir/build.make:124: bin/llvm-yaml-numeric-parser-fuzzer] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:56538: tools/llvm-yaml-numeric-parser-fuzzer/CMakeFiles/llvm-yaml-numeric-parser-fuzzer.dir/all] Fehler 2
make: *** [Makefile:156: all] Fehler 2

Arch Linux
master/50d8e88b

@kassane
Copy link

kassane commented Jan 23, 2025

Related:

Try add:

if (CMAKE_HOST_UNIX)
	set(CMAKE_C_LINKER_DEPFILE_SUPPORTED FALSE)
	set(CMAKE_CXX_LINKER_DEPFILE_SUPPORTED FALSE)
endif()

Works for me! Same problem in archlinux - cmake version 3.31.4.

@ssmid
Copy link
Author

ssmid commented Jan 23, 2025

Didn't work for me but I also didn't any variables with those names. Neither online nor with cmake --help-variable-list.

@ssmid
Copy link
Author

ssmid commented Jan 25, 2025

Nevermind. It didn't work when using exported environment variables but when adding them as command line arguments (-DCMAKE_C_LINKER_DEPFILE_SUPPORTED).

@ssmid
Copy link
Author

ssmid commented Jan 25, 2025

In case someone's interested in it:

diff --git a/build b/build
index fb259b0ff..773f3cb15 100755
--- a/build
+++ b/build
@@ -28,6 +34,8 @@ cmake "$ROOTDIR/llvm" \
   -DCMAKE_INSTALL_PREFIX="$ROOTDIR/out/host" \
   -DCMAKE_PREFIX_PATH="$ROOTDIR/out/host" \
   -DCMAKE_BUILD_TYPE=Release \
+  -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \
+  -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE \
   -DLLVM_ENABLE_BINDINGS=OFF \
   -DLLVM_ENABLE_LIBEDIT=OFF \
   -DLLVM_ENABLE_LIBPFM=OFF \
@@ -65,6 +73,8 @@ cmake "$ROOTDIR/zig" \
   -DCMAKE_INSTALL_PREFIX="$ROOTDIR/out/host" \
   -DCMAKE_PREFIX_PATH="$ROOTDIR/out/host" \
   -DCMAKE_BUILD_TYPE=Release \
+  -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \
+  -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE \
   -DZIG_VERSION="$ZIG_VERSION"
 cmake --build . --target install
 
@@ -86,7 +96,9 @@ cmake "$ROOTDIR/zlib" \
   -DCMAKE_ASM_COMPILER="$ZIG;cc;-fno-sanitize=all;-s;-target;$TARGET;-mcpu=$MCPU" \
   -DCMAKE_RC_COMPILER="$ROOTDIR/out/host/bin/llvm-rc" \
   -DCMAKE_AR="$ROOTDIR/out/host/bin/llvm-ar" \
-  -DCMAKE_RANLIB="$ROOTDIR/out/host/bin/llvm-ranlib"
+  -DCMAKE_RANLIB="$ROOTDIR/out/host/bin/llvm-ranlib" \
+  -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \
+  -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE
 cmake --build . --target install
 
 # Same deal for zstd.
@@ -149,6 +161,8 @@ cmake "$ROOTDIR/llvm" \
   -DCMAKE_RC_COMPILER="$ROOTDIR/out/host/bin/llvm-rc" \
   -DCMAKE_AR="$ROOTDIR/out/host/bin/llvm-ar" \
   -DCMAKE_RANLIB="$ROOTDIR/out/host/bin/llvm-ranlib" \
+  -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \
+  -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE \
   -DLLVM_ENABLE_BACKTRACES=OFF \
   -DLLVM_ENABLE_BINDINGS=OFF \
   -DLLVM_ENABLE_CRASH_OVERRIDES=OFF \

@alexrp
Copy link
Member

alexrp commented Jan 25, 2025

Let's track this on the ziglang/zig repo: ziglang/zig#22213

@alexrp alexrp closed this as completed Jan 25, 2025
@alexrp alexrp closed this as completed Jan 25, 2025
@ssmid
Copy link
Author

ssmid commented Jan 25, 2025

It might be worth to push above fix to the repo as long as this flag isn't implemented by zig, no?

@alexrp
Copy link
Member

alexrp commented Jan 25, 2025

I'm not yet convinced that this isn't a CMake bug. I can't find any good reason why CMake would conclude that zig cc supports this flag when it very obviously doesn't by virtue of, well, failing when it's used.

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

3 participants