#55086 closed defect (wontfix)
clang-4.0 w/ trace mode: Error running link command: Invalid argument (cmake bug?)
Reported by: | Ionic (Mihai Moldovan) | Owned by: | jeremyhu (Jeremy Huddleston Sequoia) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | tracemode | Cc: | larryv (Lawrence Velázquez), ryandesign (Ryan Carsten Schmidt), yan12125 (Chih-Hsuan Yen), chrstphrchvz (Christopher Chavez) |
Port: | clang-4.0 |
Description
Hit this error late in the build process on both 10.10 and 10.12, relevant excerpt:
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/build/tools/clang/lib/StaticAnalyzer/Checkers && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/clang StaticAnalyzerCheckers.dir/link.txt --verbose=ON /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -no_warning_for_no_symbols -o ../../../../../lib/libclangStaticAnalyzerCheckers.a CMakeFiles/clangStaticAnalyzerCheckers.dir/AllocationDiagnostics.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/AnalysisOrderChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/AnalyzerStatsChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ArrayBoundChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ArrayBoundCheckerV2.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/BasicObjCFoundationChecks.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/BlockInCriticalSectionChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/BoolAssignmentChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/BuiltinFunctionChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CStringChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CStringSyntaxChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CallAndMessageChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CastSizeChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CastToStructChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CheckObjCDealloc.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CheckObjCInstMethSignature.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CheckSecuritySyntaxOnly.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CheckSizeofPointer.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CheckerDocumentation.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ChrootChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ClangCheckers.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CloneChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ConversionChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/CXXSelfAssignmentChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DeadStoresChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DebugCheckers.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DereferenceChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DirectIvarAssignment.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DivZeroChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DynamicTypePropagation.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/DynamicTypeChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ExprInspectionChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/FixedAddressChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/GenericTaintChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/GTestChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/IdenticalExprChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/IteratorPastEndChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/IvarInvalidationChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/LLVMConventionsChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/LocalizationChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MacOSKeychainAPIChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MacOSXAPIChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MallocChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MallocOverflowSecurityChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MallocSizeofChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MPI-Checker/MPIBugReporter.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MPI-Checker/MPIChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/MPI-Checker/MPIFunctionClassifier.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/NSAutoreleasePoolChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/NSErrorChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/NoReturnFunctionChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/NonNullParamChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/NullabilityChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/NumberObjectConversionChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCAtSyncChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCContainersASTChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCContainersChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCMissingSuperCallChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCPropertyChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCSelfInitChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCSuperDeallocChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCUnusedIVarsChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/PaddingChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/PointerArithChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/PointerSubChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/PthreadLockChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/RetainCountChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ReturnPointerRangeChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ReturnUndefChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/SimpleStreamChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/StdLibraryFunctionsChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/StreamChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/TaintTesterChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/TestAfterDivZeroChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/TraversalChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UndefBranchChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UndefCapturedBlockVarChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UndefResultChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UndefinedArraySubscriptChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UndefinedAssignmentChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UnixAPIChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/UnreachableCodeChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/VforkChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/VLASizeChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/ValistChecker.cpp.o CMakeFiles/clangStaticAnalyzerCheckers.dir/VirtualCallChecker.cpp.o Error running link command: Invalid argument make[2]: *** [lib/libclangStaticAnalyzerCheckers.a] Error 2 make[2]: *** Deleting file `lib/libclangStaticAnalyzerCheckers.a' make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/build' make[1]: *** [tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/all] Error 2 make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/build' make: *** [all] Error 2
If I restart the process without cleaning clang-4.0
, the build continues for a bit, but eventually fails again:
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/build' [ 95%] Building CXX object tools/clang/tools/extra/include-fixer/tool/CMakeFiles/clang-include-fixer.dir/ClangIncludeFixer.cpp.o cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/build/tools/clang/tools/extra/include-fixer/tool && /usr/bin/clang++ -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_OBJC_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/build/tools/clang/tools/extra/include-fixer/tool -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/llvm-4.0.1.src/tools/clang/tools/extra/include-fixer/tool -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/llvm-4.0.1.src/tools/clang/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/build/tools/clang/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/llvm-4.0.1.src/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/llvm-4.0.1.src/tools/clang/tools/extra/include-fixer/tool/.. -pipe -Os -std=c++11 -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=date-time -std=c++11 -fno-common -Woverloaded-virtual -Wno-nested-anon-types -DNDEBUG -arch x86_64 -mmacosx-version-min=10.10 -fno-exceptions -o CMakeFiles/clang-include-fixer.dir/ClangIncludeFixer.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/llvm-4.0.1.src/tools/clang/tools/extra/include-fixer/tool/ClangIncludeFixer.cpp [ 95%] Linking CXX executable ../../../../../../bin/clang-include-fixer cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/build/tools/clang/tools/extra/include-fixer/tool && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/clang-include-fixer.dir/link.txt --verbose=ON /usr/bin/clang++ -pipe -Os -std=c++11 -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=date-time -std=c++11 -fno-common -Woverloaded-virtual -Wno-nested-anon-types -DNDEBUG -arch x86_64 -mmacosx-version-min=10.10 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-dead_strip CMakeFiles/clang-include-fixer.dir/ClangIncludeFixer.cpp.o -o ../../../../../../bin/clang-include-fixer -Wl,-rpath,/opt/local/libexec/llvm-4.0/lib ../../../../../../lib/libclangBasic.a ../../../../../../lib/libclangFormat.a ../../../../../../lib/libclangFrontend.a ../../../../../../lib/libclangIncludeFixer.a ../../../../../../lib/libclangRewrite.a ../../../../../../lib/libclangTooling.a ../../../../../../lib/libclangToolingCore.a ../../../../../../lib/libfindAllSymbols.a ../../../../../../lib/libclangTooling.a ../../../../../../lib/libclangFormat.a ../../../../../../lib/libclangFrontend.a ../../../../../../lib/libclangSerialization.a ../../../../../../lib/libclangToolingCore.a ../../../../../../lib/libclangRewrite.a ../../../../../../lib/libclangDriver.a ../../../../../../lib/libclangASTMatchers.a ../../../../../../lib/libclangParse.a ../../../../../../lib/libclangSema.a ../../../../../../lib/libclangEdit.a ../../../../../../lib/libclangAnalysis.a ../../../../../../lib/libclangAST.a ../../../../../../lib/libclangLex.a ../../../../../../lib/libclangBasic.a ../../../../../../lib/libLLVM.dylib sh: /bin/ps: Operation not permitted Error running link command: Invalid argument make[2]: *** [bin/clang-include-fixer] Error 2 make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/build' make[1]: *** [tools/clang/tools/extra/include-fixer/tool/CMakeFiles/clang-include-fixer.dir/all] Error 2 make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-4.0/clang-4.0/work/build' make: *** [all] Error 2
Feel free to ignore the sh: /bin/ps: Operation not permitted
message, that's a known trace mode issue but shouldn't cause issues.
I guess this failure is triggerd by cmake, since old reports of that (for other software) can be found every now and then.
Attachments (2)
Change History (11)
Changed 7 years ago by Ionic (Mihai Moldovan)
Attachment: | main-clang-4.0-10.10-second.log.bz2 added |
---|
Changed 7 years ago by Ionic (Mihai Moldovan)
Attachment: | main-clang-4.0-10.12-second.log.bz2 added |
---|
Logfile of clang-4.0
on 10.12. First try, then second try without cleaning.
comment:1 Changed 7 years ago by Ionic (Mihai Moldovan)
Keywords: | tracemode added |
---|---|
Summary: | clang-4.0: Error running link command: Invalid argument (cmake bug?) → clang-4.0 w/ trace mode: Error running link command: Invalid argument (cmake bug?) |
Turns out that this issue is not showing up in non-trace-mode builds. Adjusting ticket.
comment:2 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to Ionic:
Error running link command: Invalid argument
I guess this failure is triggerd by cmake, since old reports of that (for other software) can be found every now and then.
I am seeing the same problem when building mariadb-10.2 (which uses cmake) in trace mode, with Apple LLVM version 9.0.0 (clang-900.0.39.2) from Xcode 9.2 on macOS Sierra.
comment:3 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | ryandesign added |
---|
comment:4 Changed 6 years ago by yan12125 (Chih-Hsuan Yen)
Cc: | yan12125 added |
---|
comment:5 Changed 5 years ago by yan12125 (Chih-Hsuan Yen)
Resolution: | → wontfix |
---|---|
Status: | new → closed |
llvm-4.0 & clang-4.0 have been declared obsoleted in [7615202b212d36d0598b5775cb33020a916462ac/macports-ports].
comment:6 Changed 4 years ago by neverpanic (Clemens Lang)
Still happens with modern clang, likely a bug in trace mode. Probably need some patching and printf debugging of CMake source to figure out what the problem is.
comment:7 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Cc: | chrstphrchvz added |
---|
comment:8 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Similar issue encountered for mysql8: #63455
comment:9 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Possibly caused by CMake issue triggered by trace mode: #64368
Logfile of
clang-4.0
on 10.10. First try, than second try without cleaning.