forked from OSchip/llvm-project
[Driver] -noprofilelib flag
This flag is analoguous to other flags like -nostdlib or -nolibc and could be used to disable linking of profile runtime library. This is useful in certain environments like kernel, where profile instrumentation is still desirable, but we cannot use the standard runtime library. llvm-svn: 365808
This commit is contained in:
parent
5011b83237
commit
08cb342afa
|
@ -346,6 +346,8 @@ Disable builtin #include directories
|
|||
|
||||
.. option:: -noprebind
|
||||
|
||||
.. option:: -noprofilelib
|
||||
|
||||
.. option:: -noseglinkedit
|
||||
|
||||
.. option:: -nostartfiles
|
||||
|
|
|
@ -2512,6 +2512,7 @@ def nomultidefs : Flag<["-"], "nomultidefs">;
|
|||
def nopie : Flag<["-"], "nopie">;
|
||||
def no_pie : Flag<["-"], "no-pie">, Alias<nopie>;
|
||||
def noprebind : Flag<["-"], "noprebind">;
|
||||
def noprofilelib : Flag<["-"], "noprofilelib">;
|
||||
def noseglinkedit : Flag<["-"], "noseglinkedit">;
|
||||
def nostartfiles : Flag<["-"], "nostartfiles">;
|
||||
def nostdinc : Flag<["-"], "nostdinc">, Flags<[CoreOption]>;
|
||||
|
|
|
@ -450,6 +450,9 @@ std::string ToolChain::getArchSpecificLibPath() const {
|
|||
}
|
||||
|
||||
bool ToolChain::needsProfileRT(const ArgList &Args) {
|
||||
if (Args.hasArg(options::OPT_noprofilelib))
|
||||
return false;
|
||||
|
||||
if (needsGCovInstrumentation(Args) ||
|
||||
Args.hasArg(options::OPT_fprofile_generate) ||
|
||||
Args.hasArg(options::OPT_fprofile_generate_EQ) ||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
// RUN: %clang -target i686-pc-linux-gnu -### %s 2>&1 \
|
||||
// RUN: -fprofile-generate -noprofilelib | FileCheck %s
|
||||
// RUN: %clang -target i686-pc-linux-gnu -### %s 2>&1 \
|
||||
// RUN: -fprofile-instr-generate -noprofilelib | FileCheck %s
|
||||
// CHECK-NOT: clang_rt.profile
|
Loading…
Reference in New Issue