From 22302f5f451dbea950b5a128895b103f40bf7536 Mon Sep 17 00:00:00 2001 From: alexrp Date: Sat, 9 Jun 2012 20:55:03 +0200 Subject: [PATCH] Correctly define D_PIC version identifier when relocation model is PIC. --- driver/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/driver/main.cpp b/driver/main.cpp index e41fab2b..ae893bc9 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -593,6 +593,10 @@ LDC_TARGETS VersionCondition::addPredefinedGlobalIdent("D_LP64"); } + if (mRelocModel == llvm::Reloc::PIC_) { + VersionCondition::addPredefinedGlobalIdent("D_PIC"); + } + // parse the OS out of the target triple // see http://gcc.gnu.org/install/specific.html for details // also llvm's different SubTargets have useful information