[Driver] Add -static-openmp driver option
authorPirama Arumuga Nainar <pirama@google.com>
Mon, 9 Sep 2019 18:31:41 +0000 (18:31 +0000)
committerPirama Arumuga Nainar <pirama@google.com>
Mon, 9 Sep 2019 18:31:41 +0000 (18:31 +0000)
commitd60ff75b562b56177dfe9337f123637bf904f884
treee31cd1a5fbbac18f7ff892ea770e0381530674c3
parent77e3e9cafd9642375132e7bb0b13be415872b531
[Driver] Add -static-openmp driver option

Summary:
For Gnu, FreeBSD and NetBSD, this option forces linking with the static
OpenMP host runtime (similar to -static-libgcc and -static-libstdcxx).

Android's NDK will start the shared OpenMP runtime in addition to the static
libomp.  In this scenario, the linker will prefer to use the shared library by
default.  Add this option to enable linking with the static libomp.

Reviewers: Hahnfeld, danalbert, srhines, joerg, jdoerfert

Subscribers: guansong, cfe-commits

Tags: #clang

Fixes https://github.com/android-ndk/ndk/issues/1028

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

llvm-svn: 371437
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/lib/Driver/ToolChains/CommonArgs.h
clang/lib/Driver/ToolChains/FreeBSD.cpp
clang/lib/Driver/ToolChains/Gnu.cpp
clang/lib/Driver/ToolChains/NetBSD.cpp
clang/test/Driver/fopenmp.c