aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/gcc/gcc-multilib-config.inc27
1 files changed, 9 insertions, 18 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
index acea6d8436c..b8c705a590b 100644
--- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc
+++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -14,6 +14,8 @@
# gcc/config/mips/linux64.h
# gcc/config/rs6000/linux64.h
+MULTILIB_OPTION_WHITELIST ??= "-m32 -m64 -mx32 -mabi=n32 -mabi=32 -mabi=64"
+
python gcc_multilib_setup() {
import re
import shutil
@@ -187,30 +189,19 @@ python gcc_multilib_setup() {
bb.error('Unknown libdir (%s) of the tune : %s' % (tune_baselib, tune))
# take out '-' mcpu='s and march='s from parameters
- options.append(re.sub(r'mcpu=[^ ]+ *', '',
- re.sub(r'march=[^ ]+ *', '',
- re.sub(r' +\-+', ' ',
- re.sub(r'^ *\-+', '', tune_parameters['ccargs'])))))
+ opts = []
+ whitelist = (d.getVar("MULTILIB_OPTION_WHITELIST", True) or "").split()
+ for i in tune_parameters['ccargs'].split():
+ if i in whitelist:
+ opts.append(i)
+ options.append(" ".join(opts))
+
if tune_baselib == 'lib':
dirnames.append('32') # /lib => 32bit lib
else:
dirnames.append(tune_baselib.replace('lib', ''))
osdirnames.append('../' + tune_baselib)
- if len(options) > 1:
- for optstr in options:
- optsets.append(optstr.split())
-
- #get common options present in all the tune parameters
- common_opt_set = set.intersection(*map(set, optsets))
-
- #common options will be added at the end of the options string only once
- if (len(common_opt_set) > 0):
- rex = re.compile(''.join(['\\b(', '|'.join(common_opt_set), ')\\W']), re.I)
- options = [rex.sub("", optstr) for optstr in options]
- options = [optstr.strip() for optstr in options]
- options[len(options)-1] = ' '.join((options[len(options)-1], ' '.join(common_opt_set)))
-
write_config(builddir, target_config_files, options, dirnames, osdirnames)
write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
}