Commit Graph

3266 Commits

Author SHA1 Message Date
Roman Zulak
eb624b555e CPT: Fix DLLVM_HOST_TRIPLE for Travis on OS X.
CMake thinks that the default output on OS X should be 32 bit.
Not sure if this is related to ccache or the env/virtualization they run.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-19 13:44:09 +02:00
Roman Zulak
471fdf60b8 Add comment, fix indent, and remove superfluous include.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-19 10:44:21 +02:00
Vassil Vassilev
f844f6d08a Add mail. 2016-08-18 15:44:19 +02:00
Vassil Vassilev
2285d5734d Add contributor's real name. 2016-08-18 15:44:19 +02:00
Vassil Vassilev
c8726ceffb Typo. 2016-08-18 15:44:18 +02:00
Frederich Munch
bbfd61d897 Share -v flag with clang, and use it during startup to log info about header search paths.
Also fix trying to report why compiler invocation failed when it was never attempted.
Add message about build being probably being configured incorrectly.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
e1c400d627 Cleanup ReadCompilerIncludePaths by using a StringRef.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
60ecba7d61 Make CIFactory a namespace, not a class.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
5ee1cfb7c3 Refactor all argument parsing into InvocationOptions.cpp.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
2142853de6 Don't call clang::ApplyHeaderSearchOptions from Interpreter::AddIncludePaths.
Instead call it at the end of cling::createCI (that should probably change too).

clang::ApplyHeaderSearchOptions is a very heavy-weight function that does a lot
of work to determine and add system headers. More importantly it can also wind
up invalidating clangs internal cache making inclusion of files later impossible.

By using the lighter HeaderSearchOptions::AddSearchPath we not only avoid redoing
a lot of work that has been done, but can adjust the method in clang to avoid
cache invalidation so that calling Interpreter::AddIncludePath will actually
make the files in that path accessible to clang.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
998ca7af13 Move core of Interpreter::GetIncludePaths into Utils library.
Add optional stream for Interpreter::DumpIncludePath.
This allows for easier debugging of include path during different stages of startup.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
ea25014f1f Add -DCLING_INCLUDE_PATHS to CMake.
This allows a user to prepend to CLING_INCLUDE_PATHS any additional include paths
they want to add on startup.

Refactor common path splitting code into Utils/Paths

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
b8b4becaf6 Try to make C++ header path determination a bit more robust.
Generate C++ include paths at compile time, fallback to absolute path of compiler cling was built with, and finally relative/PATH invocation.

Previously if cling was built with wrapper to a compiler like ccache, then there was a
good chance the wrapper would be invoked to find C++ headers, meaning it would fail unless the user also had said wrapper.

This commit also:
  Changes LLVM_CXX macro to CLING_CXX_PATH.
  Fixes cling-compiledata.h not being updated after changes to
    cling-compiledata.h.in have occurred.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:17 +02:00
Frederich Munch
6ae88ce8e9 Fix GetSystemLibraryPaths on Fedora.
The string searching was broken on Fedora 23.
Stop searching for system paths the moment when failure is known.
Read pipe with a larger buffer.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:17 +02:00
Frederich Munch
c4ff8c92eb Add -stdlib= argument when invoking compiler to get C++ headers.
If the compiler is clang this flag is very important in determinig where it will look.
Don't set the argument if the user has provided it though.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:17 +02:00
Frederich Munch
c29c79b9de Move CompilerOpts to use a bitfield for easier additions.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:17 +02:00
Frederich Munch
f80ca90232 Set -isysroot to an available SDK on OS X.
Previously cling was basically unusable on OS X unless the CommandLineTools were
installed. Now if XCode is installed the system headers from an SDK can be used.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:17 +02:00
Frederich Munch
d90972a879 Rename AddHostIncludes to AddHostArguments.
Move the addition of -resource-dir argument into the function.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:17 +02:00
Frederich Munch
38a74b7a23 Don't allocate a string for every argument in AddHostIncludes.
Use const char* for option and std::string for value.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:17 +02:00
Frederich Munch
4cdbc0461e Honor clangs -nostdinc++ and -nobuiltininc flags.
Rename AddHostCXXIncludes  to AddHostIncludes and delineate between -nostdinc++
and -nobuiltininc. When cling is invoked with -nobuiltininc, do not #include any runtime
files on startup.  Make ABI incompatability error consistent across platforms and add a test to verify behavior when this occurs.

More importantly this allow for easier debugging of Decl unloading as the amount of
declarations on startup is greatly reduced.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:17 +02:00
Frederich Munch
915935eb79 Fix possible crash and buffer overrun scanning arguments.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:16 +02:00
Frederich Munch
bbcf7651c3 Allow cling to find C++ headers for libc++ built with cling.
When built with libc++ try to use a version of clang that sits next to cling to determine
C++ header paths. Fallback to LLVM_CXX if no paths were added.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:16 +02:00
Frederich Munch
378b926d72 Match exception specification for InterpreterException.
Some compilers are complaining about the mismatching exception specifications
between destructors of InterpreterException and its subclasses.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-17 10:14:33 +02:00
Frederich Munch
afe23db9d4 Fix cling when built for 32 bit architectures.
Use uintptr_t as void* and uint64_t are not guaranteed to be the same size.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-15 15:29:11 +02:00
Vassil Vassilev
ec6d72cddf Shorten logs. 2016-08-15 15:29:10 +02:00
Vassil Vassilev
d3e43c7567 Add full paths to the shadow default compiler invocation. 2016-08-15 14:45:16 +02:00
Frederich Munch
3e65a6fee0 CPT: Fix git log hanging.
git log can hang waiting for stdin unless --no-pager argument is given.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-15 11:54:05 +02:00
Frederich Munch
0f487d12af Check HostCXXI is empty rather than size() < 3.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-15 11:54:05 +02:00
Vassil Vassilev
9bbd82c365 Allow x86 to fail in release, for now. 2016-08-15 11:54:05 +02:00
Frederich Munch
6e13c66259 When building on Travis, use clone that Travis has already done. Saves some time, and necessary for pull-requests.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-13 19:44:21 +02:00
Frederich Munch
eeb1e10e8b Don't add -nostdinc flag just because popen succeeded, make sure we got what we were looking for first.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-13 19:44:21 +02:00
Vassil Vassilev
6e23bb5f1e Optionally, don't cleanup after build, helps debugging.
Debug file dumps should be done outside cpt.
2016-08-12 15:14:10 +02:00
Frederich Munch
109812d223 Fix crash from possible null return from getcwd. 2016-08-12 14:29:07 +02:00
Frederich Munch
bcb75e1476 Don't create a virtual file with a valid file name.
This fix allows running a file in the current working directory.
2016-08-12 14:29:07 +02:00
Frederich Munch
a7f5c1719e Set CLING_NOHISTORY when running tests. 2016-08-12 14:14:06 +02:00
Frederich Munch
e3265d1d8c Add %built_cling substitution for lit so tests can be run from either the build or installations directories. 2016-08-12 14:14:06 +02:00
Frederich Munch
d7bc590e03 Don't invoke echo for stdin, read from /dev/null. OS X was intermittently hanging prior. 2016-08-12 13:44:05 +02:00
Frederich Munch
8fc1289cd4 Make sure to get PATH_MAX on OS X with gcc. 2016-08-12 13:44:05 +02:00
Frederich Munch
33c05d3105 Relocate PPOpts variable initialization and remove comment. 2016-08-12 13:44:05 +02:00
Vassil Vassilev
2aba8b8cc8 Build only the master on Windows, too. 2016-08-12 11:55:31 +02:00
Vassil Vassilev
9314f1c35e We know cling's test suite doesn't work on Win yet. 2016-08-12 11:48:53 +02:00
Vassil Vassilev
4c37f02f8d Don't build all branches but only the master and pull requests. 2016-08-12 11:33:33 +02:00
Vassil Vassilev
ec1a6fec18 Typo. 2016-08-12 09:44:16 +02:00
Vassil Vassilev
c5b99ae797 Make the json findable when we only download and call cpt.py. 2016-08-11 12:30:28 +02:00
Frederich Munch
a875004a73 Fix check-cling target, broken in commit b461173.
Signed-off-by: Bertrand Bellenot <bertrand.bellenot@cern.ch>
2016-08-11 10:59:21 +02:00
Vassil Vassilev
8a95b318dd Add ccache in a different way, fixing our binary releases. 2016-08-10 19:06:40 +02:00
Vassil Vassilev
d2ef758e92 More debug output on failure. 2016-08-10 19:06:40 +02:00
Vassil Vassilev
c2feafce5c Try using ccache and clang-3.7.
CMake thinks ccache as the compiler and clang-3.7 as a flag when
generating information of cling-compiledata.h
2016-08-10 19:06:40 +02:00
Vassil Vassilev
521a4f04da Mark platform as expected to fail. 2016-08-10 19:06:40 +02:00
Vassil Vassilev
511bc75644 More debug info. 2016-08-10 19:06:40 +02:00