aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-11-22 17:30:34 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-11-22 17:30:34 -0700
commitc7170e4a5480581db5f30913eebd9ad4f7cd121e (patch)
treefba79b8f4241c94f886e7708d18081e8fc0e31fe /src/zig_llvm.cpp
parent98d5bfbd4d21e99363a0a68ef5a0d0104c302ecb (diff)
parentabc717f203060f7ab16d36f2afe681d838b46801 (diff)
downloadzig-c7170e4a5480581db5f30913eebd9ad4f7cd121e.tar.gz
zig-c7170e4a5480581db5f30913eebd9ad4f7cd121e.zip
Support PIE (Position Independent Executables)
Closes #4503 Revives #3960 Merges branch 'pie' into master
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index cc02c4c028..d8eeaf7fae 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -855,6 +855,14 @@ void ZigLLVMAddModuleCodeViewFlag(LLVMModuleRef module) {
unwrap(module)->addModuleFlag(Module::Warning, "CodeView", 1);
}
+void ZigLLVMSetModulePICLevel(LLVMModuleRef module) {
+ unwrap(module)->setPICLevel(PICLevel::Level::BigPIC);
+}
+
+void ZigLLVMSetModulePIELevel(LLVMModuleRef module) {
+ unwrap(module)->setPIELevel(PIELevel::Level::Large);
+}
+
static AtomicOrdering mapFromLLVMOrdering(LLVMAtomicOrdering Ordering) {
switch (Ordering) {
case LLVMAtomicOrderingNotAtomic: return AtomicOrdering::NotAtomic;