From f08b60bc98fd330fea2366625c1706a615767eae Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Thu, 11 Sep 2014 17:15:59 -0700 Subject: [PATCH] Disable RTTI for Loader, Logic, and JIT bins --- core/logic/AMBuilder | 6 ++++++ loader/AMBuilder | 4 ++++ sourcepawn/jit/AMBuilder | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/core/logic/AMBuilder b/core/logic/AMBuilder index 09096255..33e2aa4d 100644 --- a/core/logic/AMBuilder +++ b/core/logic/AMBuilder @@ -19,6 +19,12 @@ if builder.target_platform == 'linux': elif builder.target_platform == 'mac': binary.compiler.cflags += ['-Wno-deprecated-declarations'] binary.compiler.postlink += ['-framework', 'CoreServices'] + +if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang': + binary.compiler.cxxflags += ['-fno-rtti'] +elif binary.compiler.vendor == 'msvc': + binary.compiler.cxxflags += ['/GR-'] + binary.sources += [ 'common_logic.cpp', 'smn_adt_array.cpp', diff --git a/loader/AMBuilder b/loader/AMBuilder index c9089275..12e981a9 100644 --- a/loader/AMBuilder +++ b/loader/AMBuilder @@ -13,6 +13,10 @@ binary.compiler.cxxincludes += [ os.path.join(SM.mms_root, 'core'), os.path.join(SM.mms_root, 'sourcehook') ] +if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang': + binary.compiler.cxxflags += ['-fno-rtti'] +elif binary.compiler.vendor == 'msvc': + binary.compiler.cxxflags += ['/GR-'] binary.compiler.linkflags += extra_ldflags binary.sources = [ 'loader.cpp' diff --git a/sourcepawn/jit/AMBuilder b/sourcepawn/jit/AMBuilder index 7b3fb6cc..3355cb24 100644 --- a/sourcepawn/jit/AMBuilder +++ b/sourcepawn/jit/AMBuilder @@ -14,6 +14,11 @@ binary.compiler.includes += [ os.path.join(builder.sourcePath, 'knight', 'shared'), ] +if binary.compiler.vendor == 'gcc' or binary.compiler.vendor == 'clang': + binary.compiler.cxxflags += ['-fno-rtti'] +elif binary.compiler.vendor == 'msvc': + binary.compiler.cxxflags += ['/GR-'] + if builder.target_platform == 'linux': binary.compiler.postlink += ['-lpthread', '-lrt']