[MacPorts] #55086: clang-4.0: Error running link command: Invalid argument (cmake bug?)

MacPorts noreply at macports.org
Fri Oct 13 22:57:13 UTC 2017


#55086: clang-4.0: Error running link command: Invalid argument (cmake bug?)
--------------------+-----------------------
 Reporter:  Ionic   |      Owner:  jeremyhu
     Type:  defect  |     Status:  new
 Priority:  Normal  |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  clang-4.0
--------------------+-----------------------
 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.

--
Ticket URL: <https://trac.macports.org/ticket/55086>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list