Commit Graph

205 Commits

Author SHA1 Message Date
Greg Bedwell
cb2dfa6478 In MSVC builds embed a VERSIONINFO resource in our exe and DLL files.
This reinstates my commits r238740/r238741 which I reverted due to a failure
in the clang-cl selfhost tests on Windows.  I've now fixed the issue in
clang-cl that caused the failure so hopefully all should be well now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239612 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-12 15:58:29 +00:00
Greg Bedwell
fe195d78dd [CMake] Revert commits r238740/r238741 for embedding Windows version info.
The clang Windows bots are showing mysterious failures.
Reverting until I can figure out what's going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238744 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 13:40:14 +00:00
Greg Bedwell
84ffd21170 remove the use of the LOCATION CMake variable from r238740.
It caused the following failure:
"Policy CMP0026 is not set: Disallow use of the LOCATION target property."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238741 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 13:06:10 +00:00
Greg Bedwell
c2165f1e9f In MSVC builds embed a VERSIONINFO resource in our exe and DLL files.
This embeds Windows version information into our executables and DLLs.
The most visible place to view this data is in the details tab of the file
properties window in Windows explorer.

Differential Revision: http://reviews.llvm.org/D7828

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238740 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 12:41:55 +00:00
Yaron Keren
7141b3d6f3 Use cat and not type Under MSYS, same as Cygwin.
type means something else under the MSYS shell.

Patch by Tzafrir Poupko!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237692 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 12:59:23 +00:00
Reid Kleckner
1606ccad09 [cmake] Quote the path to the target exports file, fixes PR23313
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235519 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 16:23:00 +00:00
Chris Bieneman
e59dcc804f Cleanup based on rnk's feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235125 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16 18:08:33 +00:00
Chris Bieneman
3cdbd163d0 Fixing windows bots.
Third time's the try.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235123 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16 17:40:51 +00:00
Chris Bieneman
578a18c4fc Better fix to the windows conditional.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235121 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16 17:26:50 +00:00
Chris Bieneman
9e93b6429d Fix Windows bots.
Turns out Windows is special. All library installs are RUNTIME.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235120 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16 17:25:17 +00:00
Chris Bieneman
1a0e0ea4fb Fixing a mis-use of the CMake install command.
The CMake install command is defined as:

install(TARGETS targets... [EXPORT <export-name>]
        [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|
          PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]
         [DESTINATION <dir>]
         [INCLUDES DESTINATION [<dir> ...]]
         [PERMISSIONS permissions...]
         [CONFIGURATIONS [Debug|Release|...]]
         [COMPONENT <component>]
         [OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]
        ] [...])

This means it can only take one parameter from the set of RUNTIME, LIBRARY, or ARCHIVE. If you set more than one of these it seems to gobble up the extra arguments and ignore the COMPONENT argument.

This adds a check to only set LIBRARY or ARCHIVE based on whether or not the library being built is shared.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235113 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16 16:56:18 +00:00
Rafael Espindola
6dc9f59df9 Disable all link optimizations in a debug build.
This taking linking clang on my machine with gold from 16.980257914 to
15.933037649 seconds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234161 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-06 15:04:31 +00:00
Rafael Espindola
e104aca94c Don't pass -O3 to the linker in debug builds.
This takes linking clang in a debug build with gold form 19.518925697 to
16.406388685 seconds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234160 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-06 14:51:01 +00:00
Chris Bieneman
527745e789 [CMake] Removing duplicates from the list of test suites to generate targets for.
Not doing this causes some headaches for users migrating from autoconf to CMake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233428 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-27 21:45:49 +00:00
Derek Schuff
c18ea8d96e CMake: enable installing utils
Added a new boolean CMake flag, LLVM_INSTALL_UTILS. When set,
the 'install' target will include in the bin directory the
utils binaries - e.g. FileCheck. This mirrors the autoconfig
behavior.

Test Plan:
Locally verified that utils binaries are copied when flag is set,
and not copied when flag is not set.

Reviewers: jfb, dschuff, beanz

Reviewed By: beanz

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8587

Patch by Mircea Trofin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233385 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-27 16:53:06 +00:00
Chris Bieneman
07118a3546 Re-land: Generate targets for each lit suite.
Summary:
This change makes CMake scan for lit suites and generate a target for each lit test suite. The targets follow the format check-<project>-<suite path>.

For example:
check-llvm-unit - Runs the LLVM unit tests
check-llvm-codegen-arm - Runs the ARM codeine tests

Note: These targets are not generated during multi-configuration generators (i.e. Xcode and Visual Studio) because target clutter impacts UI usability.

* Also fixed a minor issue that Duncan pointed out to me I was passing the suite to lit twice

Reviewers: chandlerc

Subscribers: aemerson, llvm-commits

Differential Revision: http://reviews.llvm.org/D8380

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233009 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-23 20:04:00 +00:00
Chris Bieneman
60858a7410 Revert "Generate targets for each lit suite."
This change broke Polly. I'll track down the failure when I have a chance and re-apply the change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232676 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-18 21:53:29 +00:00
Chris Bieneman
3bf045a9c6 Generate targets for each lit suite.
Summary:
This change makes CMake scan for lit suites and generate a target for each lit test suite. The targets follow the format check-<project>-<suite path>.

For example:
check-llvm-unit - Runs the LLVM unit tests
check-llvm-codegen-arm - Runs the ARM codeine tests

Note: These targets are not generated during multi-configuration generators (i.e. Xcode and Visual Studio) because target clutter impacts UI usability.

Reviewers: chandlerc

Subscribers: aemerson, llvm-commits

Differential Revision: http://reviews.llvm.org/D8380

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232671 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-18 21:19:06 +00:00
Reid Kleckner
85ab1e7fe7 CMake: Disable ENABLE_EXPORTS for executables with MSVC
The MSVC linker won't produce a .lib file for an executable that doesn't
export anything, and LLVM doesn't maintain dllexport annotations or .def
files listing all C++ symbols. It also doesn't support exporting all
symbols, like binutils ld.

CMake 3.2 changed the Ninja generator to list both the .exe and .lib
files as outputs of executable build targets. Ninja would always re-link
executables with ENABLE_EXPORTS because the .lib output file was not
present, and therefore the target was out of date.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232662 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-18 20:09:13 +00:00
Chris Bieneman
b07ab5d546 Making the SO version major.minor instead of just major because ABI and API change between minor versions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230981 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-02 17:50:13 +00:00
Reid Kleckner
13c5474d35 Minor follow-ups to r229720 suggested on llvmdev
"svn" patch by Sedat Dilek plus trimming whitespace added in r229720.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230773 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 18:22:46 +00:00
Zachary Turner
814efef67f [CMake] Fix the clang-cl self host build.
This allows clang-cl to self-host cleanly with no magic setup
steps required.

After this patch, all you have to do is set CC=CXX=clang-cl and
run cmake -G Ninja.

These changes only exist to support C++ features which are
unsupported in clang-cl, so regardless of whether the user
specifies they want to use them, we still have to disable them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230539 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-25 20:42:19 +00:00
Peter Collingbourne
4c85f68fe4 CMake: Fix add_lit_target for the case where a test suite has zero target dependencies.
This can happen with a standalone project containing a test suite with no
internal dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229753 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 22:25:35 +00:00
Chris Bieneman
bc20f6088d Adding install targets for individual LLVM tools and libraries.
Summary:
* add_llvm_tool and add_llvm_library now add install-${name} targets to install specific components
* added installhdrs target to install just the LLVM headers
* The above changes only apply for single-configuration generators (Ninja, Makefiles...), not for multi-configuration generators (Visual Studio, Xcode...)

Reviewers: pete

Reviewed By: pete

Subscribers: pete, llvm-commits

Differential Revision: http://reviews.llvm.org/D7619

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229727 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 19:25:47 +00:00
Chris Bieneman
56168c6553 Enable standard so versioning for libLLVM.
Summary: This resolves Bugzilla bug 15493.

Reviewers: chapuni, pete

Reviewed By: pete

Subscribers: pete, llvm-commits

Differential Revision: http://reviews.llvm.org/D6157

Conflicts:
	cmake/modules/AddLLVM.cmake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229720 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 18:52:06 +00:00
NAKAMURA Takumi
068db0bdb8 Reapply r229185(cbieneman) -- Raising minimum required Visual Studio version to 2013.
This is based on the discussions on: [LLVMdev] [RFC] Raising LLVM minimum required MSVC version to 2013 for trunk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229320 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 17:53:10 +00:00
NAKAMURA Takumi
6b098c4a26 Revert r229185, "Raising minimum required Visual Studio version to 2013."
All builders are not ready yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229199 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-14 00:45:32 +00:00
Chris Bieneman
c4300b9c01 Raising minimum required Visual Studio version to 2013.
This is based on the discussions on: [LLVMdev] [RFC] Raising LLVM minimum required MSVC version to 2013 for trunk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 23:24:14 +00:00
Hans Wennborg
e0621f8f69 [CMake] add_llvm_library: don't use .imp suffix for import libraries on Windows (PR22334)
This was added in r188351 to fix a naming conflict between the
profile_rt-static and profile_rt-shared who both ended up in
lib/profile_rt.lib.

The change also affected other libraries (like libclang), and
users are reporting that they find it surprising that there's
no longer a libclang.lib. Since the profile_rt naming conflict
doesn't seem to exist any more, I think we can remove this.

Differential Revision: http://reviews.llvm.org/D7391

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228049 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 22:08:20 +00:00
Kuba Brecka
7796c35818 Reverting r226937: lit: Make MCJIT's supported arch check case insensitive
The r226937 commit causes ASan lit tests to be all skipped on OS X.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226979 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-24 01:42:44 +00:00
Reid Kleckner
d4c7c06a39 lit: Make MCJIT's supported arch check case insensitive
Should make the tests run when using CMake on systems where 'uname -p'
reports "amd64", such as FreeBSD.

Should fix PR21559.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226937 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-23 21:11:40 +00:00
Aaron Ballman
92512386a2 Reverting r225319; since there is a folder named Examples, attempting to add a target of the same name causes problems for IDEs like Visual Studio.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225355 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-07 14:47:12 +00:00
Duncan P. N. Exon Smith
a511d71d15 cmake: Fix 'examples' target after r225319
Add the missing `DEPENDS` keyword.  r225319 did almost the right thing
(I didn't notice the problem with it because `Kaleidoscope-Ch8` wasn't
building at all).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225321 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06 23:52:35 +00:00
Duncan P. N. Exon Smith
7c659cc405 cmake: Add 'examples' target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225319 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06 23:42:49 +00:00
NAKAMURA Takumi
23dc3f4eef [CMake] Silence stderr on "COMMAND ${CMAKE_C_COMPILER} -Wl,--version". It was noisy during configuraion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225260 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06 09:44:44 +00:00
NAKAMURA Takumi
a108580b07 Reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225259 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06 09:44:29 +00:00
Chandler Carruth
f34da85923 [go] Teach the go cmake build functions to funnel the include directories down into the cgo-setup variables of llvm-go.
Summary:
This in turn allows us to use #includes with cgo that rely on CMake
provided include directories which is particularly useful for handling
generated headers that aren't reasonable to put in an "installable"
location.

Differential Revision: http://reviews.llvm.org/D6798

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224962 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-29 22:50:30 +00:00
Rafael Espindola
97996ea790 Disable --icf=safe to avoid a bug.
Thanks to Sameer Sahasrabuddhe for the report!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224123 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 14:28:19 +00:00
Rafael Espindola
838e18116d Also use --icf=safe if we are being linked by gold.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223394 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-04 22:16:08 +00:00
Rafael Espindola
89f1920565 Detect if the linker is gold and if so always use --gc-sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223372 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-04 17:54:35 +00:00
Peter Collingbourne
a9ce03858d Teach LLVM about llgo subproject.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222860 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-27 00:15:21 +00:00
Peter Collingbourne
5b9a46b789 CMake: Use the new USES_TERMINAL option for test suite targets when available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222181 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-17 22:16:15 +00:00
Rafael Espindola
b3963d680c Pass PRIVATE to target_link_libraries if using shared libraries.
A shared library (unlike a .a), has its dependencies recorded in the library and
we can pass PRIVATE to target_link_libraries.

This patch then removes some bogus dependencies when using
BUILD_SHARED_LIBS=ON. For example, we go from

build lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o:
CXX_COMPILER /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
|| include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so
lib/libLLVMCore.so lib/libLLVMBitReader.so
lib/libLLVMTransformUtils.so lib/libLLVMInstCombine.so
lib/libLLVMScalarOpts.so lib/libLLVMipa.so lib/libLLVMAnalysis.so
lib/libLLVMMCParser.so lib/libLLVMMC.so lib/libLLVMObject.so
lib/libLLVMTarget.so lib/libLLVMProfileData.so

to

build lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o:
CXX_COMPILER /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
|| include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so
lib/libLLVMCore.so lib/libLLVMTransformUtils.so
lib/libLLVMScalarOpts.so lib/libLLVMAnalysis.so lib/libLLVMMC.so
lib/libLLVMTarget.so

In fact, build.ninja goes from 5231028 bytes to 4896759 bytes.

With this, old verisons of bfd ld (2.24 is OK, 2.23 warns) will print a bogus
warning when building with BUILD_SHARED_LIBS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221530 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-07 15:33:56 +00:00
Rafael Espindola
a0ef0e7d0c [cmake] Pass -O3 when linking.
Gold and bfd ld enable misc optimizations. lld ignores the option for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221097 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 12:14:22 +00:00
Chris Bieneman
4b57390110 EXPORTED_SYMBOL_FILE using mingw and cmake
Summary: This is a fix for the command line syntax error while building LTO when using MinGW.

Patch By: jsroemer

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, beanz, llvm-commits

Differential Revision: http://reviews.llvm.org/D5476

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220935 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30 22:37:58 +00:00
Chandler Carruth
14e55b16df Teach lit to filter the host LDFLAGS down from the build system and into
the CGO build environment. This lets things like -rpath propagate down
to the C++ code that is built along side the Go bindings when testing
them.

Patch by Peter Collingbourne, and verified that it works by me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220252 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-21 00:36:28 +00:00
Rafael Espindola
b9c7f60191 Explain why we don't always use --gc-sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220237 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-20 21:37:38 +00:00
NAKAMURA Takumi
7c771b0293 Revert r220174, "Always use -Wl,-gc-sections on our build."
It dropped required functions for plugins with gnu ld 2.20 and 2.21.

  Failing Tests (1):
      LLVM :: Feature/load_module.ll

  Hello: bin/opt: symbol lookup error: lib/LLVMHello.so: undefined symbol: _ZN4llvm11raw_ostream13write_escapedENS_9StringRefEb

  Failing Tests (1):
      Clang :: Frontend/plugins.c

  error: unable to load plugin 'lib/PrintFunctionNames.so': 'lib/PrintFunctionNames.so: undefined symbol: _ZN5clang15PluginASTAction6anchorEv'

I think we should inspect linker's version or behavior to introduce --gc-sections for --export-dynamic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220198 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-20 12:12:21 +00:00
Rafael Espindola
0ea9c06fe0 Always use -Wl,-gc-sections on our build.
Both bfd ld and gold correctly handle --export-dynamic, so gc-sections is safe even for binaries
that support plugins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220174 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-19 23:24:46 +00:00
Peter Collingbourne
560e2700e2 Disable ccache for go tests.
Should fix llvm-clang-lld-x86_64-debian-fast bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220071 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-17 18:32:36 +00:00