This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Pass external project source directories to sub-configures
ClosedPublic

Authored by smeenai on Oct 16 2019, 5:54 PM.

Details

Summary

We're passing LLVM_EXTERNAL_PROJECTS to cross-compilation configures, so
we also need to pass the source directories of those projects, otherwise
configuration can fail from not finding them.

Diff Detail

Event Timeline

smeenai created this revision.Oct 16 2019, 5:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 16 2019, 5:54 PM
compnerd accepted this revision.Oct 17 2019, 11:53 AM

I’m not sure that this is the best direction long term. This is specific to the LLVM build, the runtimes builds do not take these parameters, and they are the primary things we’re trying to cross compile with this infrastructure. But the monorepo makes this more complicated and makes the configure the same, so, yes, I suppose this needs to be preserved. *sigh*

This revision is now accepted and ready to land.Oct 17 2019, 11:53 AM

I’m not sure that this is the best direction long term. This is specific to the LLVM build, the runtimes builds do not take these parameters, and they are the primary things we’re trying to cross compile with this infrastructure. But the monorepo makes this more complicated and makes the configure the same, so, yes, I suppose this needs to be preserved. *sigh*

I believe the runtimes builds use the ExternalProject infrastructure. The CrossCompile infrastructure is used for e.g. building native tablegen binaries when you're cross-compiling LLVM.

This revision was automatically updated to reflect the committed changes.

Either this or https://reviews.llvm.org/D69031 broke the lldb-cmake bot: http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/2706/

Script:
--
: 'RUN: at line 4';   /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/clang --driver-mode=cl -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -fmodules-cache-path=/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/lldb-test-build.noindex/module-cache-clang/lldb-shell --target=i386-windows-msvc -Od -Z7 -c /Fo/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/test/SymbolFile/NativePDB/Output/function-types-calling-conv.cpp.tmp.obj -- /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp
: 'RUN: at line 5';   /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/lld-link -debug:full -nodefaultlib -entry:main /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/test/SymbolFile/NativePDB/Output/function-types-calling-conv.cpp.tmp.obj -out:/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/test/SymbolFile/NativePDB/Output/function-types-calling-conv.cpp.tmp.exe -pdb:/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/test/SymbolFile/NativePDB/Output/function-types-calling-conv.cpp.tmp.pdb
: 'RUN: at line 6';   env LLDB_USE_NATIVE_PDB_READER=1 /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/lldb --no-lldbinit -S /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/test/Shell/lit-lldb-init -f /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/test/SymbolFile/NativePDB/Output/function-types-calling-conv.cpp.tmp.exe -s      /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit | /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/FileCheck /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp
--
Exit Code: 1

Command Output (stderr):
--
clang-10: warning: unknown argument ignored in clang-cl: '-isysroot' [-Wunknown-argument]
clang-10: warning: unknown argument ignored in clang-cl: '-fmodules-cache-path=/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/lldb-test-build.noindex/module-cache-clang/lldb-shell' [-Wunknown-argument]
clang-10: error: cannot specify '/Fo/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/test/SymbolFile/NativePDB/Output/function-types-calling-conv.cpp.tmp.obj' when compiling multiple source files
clang-10: warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk: 'linker' input unused [-Wunused-command-line-argument]

If I had to guess it's probably https://reviews.llvm.org/D69031.

I think that's unrelated? The other diff got reverted and the build seems to be happy now.