Open helje5 opened 4 years ago
One would think it is part of the libstdc++-5-dev
package, but maybe it is not.
It is
root@afca478e1ba9:/# dpkg -S /usr/include/c++/5/parallel/iterator.h
libstdc++-5-dev:amd64: /usr/include/c++/5/parallel/iterator.h
Getting closer to get this working, but it still fails, presumably because the host compiler attempts to lookup the headers in a different location (not "c++/5").
Sample call which fails (looks basically correct, but the -sdk is missing):
/Users/helge/dev/Swift/SPMDestinations/buildscripts/ubuntu16.04/.build/swift-5.3-ubuntu16.04.xtoolchain/swift.xctoolchain/usr/bin/clang \
-target x86_64-unknown-linux \
--sysroot /Users/helge/dev/Swift/SPMDestinations/buildscripts/ubuntu16.04/.build/swift-5.3-ubuntu16.04.xtoolchain/x86_64-ubuntu16.04.sdk \
-fPIC -g -O0 -DSWIFT_PACKAGE=1 -DDEBUG=1 -fblocks -fmodules -fmodule-name=libllbuild \
-I /Users/helge/tmp/swift-package-manager/.build/checkouts/swift-llbuild/products/libllbuild/include \
-I /Users/helge/tmp/swift-package-manager/.build/checkouts/swift-llbuild/lib/BuildSystem/include \
-fmodule-map-file=/Users/helge/tmp/swift-package-manager/.build/x86_64-unknown-linux/debug/llbuildBuildSystem.build/module.modulemap \
-I /Users/helge/tmp/swift-package-manager/.build/checkouts/swift-llbuild/lib/Core/include \
-fmodule-map-file=/Users/helge/tmp/swift-package-manager/.build/x86_64-unknown-linux/debug/llbuildCore.build/module.modulemap \
-I /Users/helge/tmp/swift-package-manager/.build/checkouts/swift-llbuild/lib/Basic/include \
-fmodule-map-file=/Users/helge/tmp/swift-package-manager/.build/x86_64-unknown-linux/debug/llbuildBasic.build/module.modulemap \
-I /Users/helge/tmp/swift-package-manager/.build/checkouts/swift-llbuild/lib/llvm/Support/include \
-fmodule-map-file=/Users/helge/tmp/swift-package-manager/.build/x86_64-unknown-linux/debug/llvmSupport.build/module.modulemap \
-I /Users/helge/tmp/swift-package-manager/.build/checkouts/swift-llbuild/lib/llvm/Demangle/include \
-fmodule-map-file=/Users/helge/tmp/swift-package-manager/.build/x86_64-unknown-linux/debug/llvmDemangle.build/module.modulemap \
-fmodules-cache-path=/Users/helge/tmp/swift-package-manager/.build/x86_64-unknown-linux/debug/ModuleCache \
-MD -MT dependencies \
-MF /Users/helge/tmp/swift-package-manager/.build/x86_64-unknown-linux/debug/libllbuild.build/BuildKey-C-API.cpp.d \
-std=c++14 \
-c /Users/helge/tmp/swift-package-manager/.build/checkouts/swift-llbuild/products/libllbuild/BuildKey-C-API.cpp \
-o /Users/helge/tmp/swift-package-manager/.build/x86_64-unknown-linux/debug/libllbuild.build/BuildKey-C-API.cpp.o
The compilation can be fixed by adding a -I
to the clang invocation. However, it doesn't work that way w/ the destination.json:
"extra-cpp-flags": [
"-I", "/Users/helge/dev/Swift/SPMDestinations/buildscripts/ubuntu16.04/.build/swift-5.3-ubuntu16.04.xtoolchain/swift.xctoolchain/usr/include/c++/v1",
"-lstdc++"
]
The problem is that extra-cpp-flags
are LINKER flags, not C PreProcessor flags nor C++ specific flags.
I don't know where clang
is looking here by default, it's all linked up in both locations. Damn you SIP ...
Gives