Commit Graph

6 Commits

Author SHA1 Message Date
Jonas Hahnfeld 8ea76fa9b4 [Driver] Unify linking of OpenMP runtime. NFCI.
While at it, extend test for FreeBSD and check for -lrt iff on Linux.

Differential Revision: https://reviews.llvm.org/D30087

llvm-svn: 300689
2017-04-19 13:55:39 +00:00
Dimitry Andric 0cc6f47348 Support linking against OpenMP runtime on FreeBSD.
Summary:
Similar to rL248426 (which was a followup to rL248379 and rL248424), add the
required libraries for OpenMP on the linker command line, and update the test
case.

Reviewers: emaste, theraven, joerg

Subscribers: cfe-commits

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

llvm-svn: 250657
2015-10-18 13:32:20 +00:00
Joerg Sonnenberger 27a69a2ba0 Support linking against OpenMP runtime on NetBSD.
llvm-svn: 248426
2015-09-23 20:11:00 +00:00
Joerg Sonnenberger 5c3f9d516d Push OpenMP linker flags after linker input on Darwin. Don't add any
libraries if -nostdlib is specified. Test.

llvm-svn: 248424
2015-09-23 20:07:56 +00:00
Chandler Carruth 25c6a22e43 [omp] Loosen the driver test enough so that overriding the defaults
works well for folks.

This isn't terribly clean (sadly) but after chatting with both Eric and
Richard, nothing cleaner really emerged. The clean way of doing this is
a *lot* of work for extremely little benefit here.

llvm-svn: 238500
2015-05-28 21:20:14 +00:00
Chandler Carruth 9c6b4f8528 [omp] Re-work Clang's handling of -fopenmp and undo r237769.
This isn't an actual revert of r237769, it just restores the behavior of
the Clang driver prior to it while completely re-implementing how that
behavior works.

This also re-does the work of making the default OpenMP runtime
selectable at CMake (or configure) time to work in the way all of our
other such hooks do (config.h, configure and cmake hooks, etc.).

I've re-implemented how we manage the '-fopenmp' flagset in an important
way. Now, the "default" hook just makes '-fopenmp' equivalent to
'-fopenmp=<default>' rather than a separate special beast. Also, there
is an '-fno-openmp' flag which does the obvious thing. Also, the code is
shared between all the places to select a known OpenMP runtime and act
on it.

Finally, and most significantly, I've taught the driver to inspect the
selected runtime when choosing whether to propagate the '-fopenmp' flag
to the frontend in the CC1 commandline. Without this, it isn't possible
to use Clang with libgomp, even if you were happy with the serial,
boring way in which it worked previously (ignoring all #pragmas but
linking in the library to satisfy direct calls into the runtime).

While I'm here, I've gone ahead and sketched out a path for the future
name of LLVM's OpenMP runtime (libomp) and the legacy support for its
current name (libiomp5) in what seems a more reasonable way.

To re-enable LLVM's OpenMP runtime (which I think should wait until the
normal getting started instructions are a reasonable way for falks to
check out, build, and install Clang with the runtime) all that needs to
change is the default string in the CMakeLists.txt and configure.ac
file. No code changes necessary.

I also added a test for the driver's behavior around OpenMP since it was
*completely missing* previously. Makes it unsurprising that we got it
wrong.

llvm-svn: 238389
2015-05-28 01:52:38 +00:00