diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-11-17 18:55:48 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-11-17 18:55:48 +0000 |
| commit | 3570cf456b31ac08cb91106f0d8b41f1619f41c5 (patch) | |
| tree | 7c2bc57e53cef4c9d8969156fc171d94e3329a94 /llvm/lib/Target/PowerPC/PPCSubtarget.cpp | |
| parent | 8f8ed28a64583fcf3a0ab81c1f175cb349666852 (diff) | |
| download | llvm-3570cf456b31ac08cb91106f0d8b41f1619f41c5.zip llvm-3570cf456b31ac08cb91106f0d8b41f1619f41c5.tar.gz llvm-3570cf456b31ac08cb91106f0d8b41f1619f41c5.tar.bz2 | |
add an option to generate completely non-pic code, corresponding to what
gcc -static produces on PPC. This is used for building kexts and other things.
With this, materializing the address of a global looks like:
lis r2, ha16(L_H$non_lazy_ptr)
la r3, lo16(L_H$non_lazy_ptr)(r2)
we're still emitting stubs for functions, which is wrong. That is next.
llvm-svn: 24399
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCSubtarget.cpp')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCSubtarget.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp index 442017d..f43c18d 100644 --- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp +++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp @@ -19,6 +19,7 @@ using namespace llvm; PPCTargetEnum llvm::PPCTarget = TargetDefault; +bool llvm::PPCGenerateStaticCode = false; namespace llvm { cl::opt<PPCTargetEnum, true> @@ -29,6 +30,11 @@ namespace llvm { " Enable Darwin codegen"), clEnumValEnd), cl::location(PPCTarget), cl::init(TargetDefault)); + + cl::opt<bool, true> + PPCStaticCode("ppc-static", + cl::desc("PowerPC: generate completely non-pic code"), + cl::location(PPCGenerateStaticCode)); } #if defined(__APPLE__) |
