From 33e27bf1b7be98210e6c5d3b1828b140c8f8616c Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Thu, 22 Mar 2012 22:46:50 +0100 Subject: [PATCH] [repo] update sys-devel/base-gcc gcc-profile trigger to work with hardened GCC profiles --- .../armv7l/entropy/triggers/sys-devel/base-gcc/trigger | 10 ++++++++-- conf/intel/entropy/triggers/sys-devel/base-gcc/trigger | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/conf/armv7l/entropy/triggers/sys-devel/base-gcc/trigger b/conf/armv7l/entropy/triggers/sys-devel/base-gcc/trigger index 09f95b5..56f498d 100644 --- a/conf/armv7l/entropy/triggers/sys-devel/base-gcc/trigger +++ b/conf/armv7l/entropy/triggers/sys-devel/base-gcc/trigger @@ -12,13 +12,19 @@ def configure_correct_gcc(): for curdir, subs, files in os.walk(gcc_dir): for fname in files: if fname.startswith(gcc_profile_file_pfx): - gcc_profile_file = fname + gcc_profile_file = os.path.join(curdir, fname) break break if gcc_profile_file is not None: break if gcc_profile_file is not None: - subprocess.call(("gcc-config", gcc_profile_file)) + # if we're hardened, we want the vanilla one by default + # to avoid stressing the user too much + vanilla_profile_file = gcc_profile_file + "-vanilla" + if os.path.isfile(vanilla_profile_file): + gcc_profile_file = vanilla_profile_file + profile_name = os.path.basename(gcc_profile_file) + subprocess.call(("gcc-config", profile_name)) if stage == "postinstall": configure_correct_gcc() diff --git a/conf/intel/entropy/triggers/sys-devel/base-gcc/trigger b/conf/intel/entropy/triggers/sys-devel/base-gcc/trigger index 09f95b5..56f498d 100644 --- a/conf/intel/entropy/triggers/sys-devel/base-gcc/trigger +++ b/conf/intel/entropy/triggers/sys-devel/base-gcc/trigger @@ -12,13 +12,19 @@ def configure_correct_gcc(): for curdir, subs, files in os.walk(gcc_dir): for fname in files: if fname.startswith(gcc_profile_file_pfx): - gcc_profile_file = fname + gcc_profile_file = os.path.join(curdir, fname) break break if gcc_profile_file is not None: break if gcc_profile_file is not None: - subprocess.call(("gcc-config", gcc_profile_file)) + # if we're hardened, we want the vanilla one by default + # to avoid stressing the user too much + vanilla_profile_file = gcc_profile_file + "-vanilla" + if os.path.isfile(vanilla_profile_file): + gcc_profile_file = vanilla_profile_file + profile_name = os.path.basename(gcc_profile_file) + subprocess.call(("gcc-config", profile_name)) if stage == "postinstall": configure_correct_gcc()