forked from OSchip/llvm-project
Always use --eh-frame-hdr on FreeBSD, even for -static
FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and is expected to use it more widely in the future), and it requires the EH frame segment in static binaries. This is the same as r203742 for NetBSD. Differential Revision: http://reviews.llvm.org/D19029 llvm-svn: 266123
This commit is contained in:
parent
d5c75eed44
commit
1bc232d342
|
@ -8197,12 +8197,12 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
if (IsPIE)
|
||||
CmdArgs.push_back("-pie");
|
||||
|
||||
CmdArgs.push_back("--eh-frame-hdr");
|
||||
if (Args.hasArg(options::OPT_static)) {
|
||||
CmdArgs.push_back("-Bstatic");
|
||||
} else {
|
||||
if (Args.hasArg(options::OPT_rdynamic))
|
||||
CmdArgs.push_back("-export-dynamic");
|
||||
CmdArgs.push_back("--eh-frame-hdr");
|
||||
if (Args.hasArg(options::OPT_shared)) {
|
||||
CmdArgs.push_back("-Bshareable");
|
||||
} else {
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -static %s \
|
||||
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-STATIC %s
|
||||
// CHECK-STATIC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
|
||||
// CHECK-STATIC: crt1.o
|
||||
// CHECK-STATIC: crtbeginT.o
|
||||
|
||||
|
|
Loading…
Reference in New Issue