diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-06-19 01:26:10 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-06-19 01:26:10 +0000 |
commit | 66aa045fd93d962b246f0890832d4aac6f7e4a98 (patch) | |
tree | f288f26a0d3696e4f168a3ff94800ea35ac45e2c /clang/lib/CodeGen/BackendUtil.cpp | |
parent | 9a63cfaf8db27b354e2db15e48f0a63b6b20e352 (diff) | |
download | bcm5719-llvm-66aa045fd93d962b246f0890832d4aac6f7e4a98.tar.gz bcm5719-llvm-66aa045fd93d962b246f0890832d4aac6f7e4a98.zip |
Add a -fuse-init-array option to cc1 and map to the UseInitArray target
option. On the driver, check if we are using libraries from gcc 4.7 or newer
and if so pass -fuse-init-array to the frontend.
The crtbegin*.o files in gcc 4.7 no longer call the constructors listed in
.ctors, so we have to use .init_array.
llvm-svn: 158694
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r-- | clang/lib/CodeGen/BackendUtil.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index f889606475f..5a97875ef4b 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -338,6 +338,9 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action, Options.NoFramePointerElimNonLeaf = true; } + if (CodeGenOpts.UseInitArray) + Options.UseInitArray = true; + // Set float ABI type. if (CodeGenOpts.FloatABI == "soft" || CodeGenOpts.FloatABI == "softfp") Options.FloatABIType = llvm::FloatABI::Soft; |