summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools')
-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 acea6d8436..b8c705a590 100644
--- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc
+++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -14,6 +14,8 @@
14# gcc/config/mips/linux64.h 14# gcc/config/mips/linux64.h
15# gcc/config/rs6000/linux64.h 15# gcc/config/rs6000/linux64.h
16 16
17MULTILIB_OPTION_WHITELIST ??= "-m32 -m64 -mx32 -mabi=n32 -mabi=32 -mabi=64"
18
17python gcc_multilib_setup() { 19python gcc_multilib_setup() {
18 import re 20 import re
19 import shutil 21 import shutil
@@ -187,30 +189,19 @@ python gcc_multilib_setup() {
187 bb.error('Unknown libdir (%s) of the tune : %s' % (tune_baselib, tune)) 189 bb.error('Unknown libdir (%s) of the tune : %s' % (tune_baselib, tune))
188 190
189 # take out '-' mcpu='s and march='s from parameters 191 # take out '-' mcpu='s and march='s from parameters
190 options.append(re.sub(r'mcpu=[^ ]+ *', '', 192 opts = []
191 re.sub(r'march=[^ ]+ *', '', 193 whitelist = (d.getVar("MULTILIB_OPTION_WHITELIST", True) or "").split()
192 re.sub(r' +\-+', ' ', 194 for i in tune_parameters['ccargs'].split():
193 re.sub(r'^ *\-+', '', tune_parameters['ccargs']))))) 195 if i in whitelist:
196 opts.append(i)
197 options.append(" ".join(opts))
198
194 if tune_baselib == 'lib': 199 if tune_baselib == 'lib':
195 dirnames.append('32') # /lib => 32bit lib 200 dirnames.append('32') # /lib => 32bit lib
196 else: 201 else:
197 dirnames.append(tune_baselib.replace('lib', '')) 202 dirnames.append(tune_baselib.replace('lib', ''))
198 osdirnames.append('../' + tune_baselib) 203 osdirnames.append('../' + tune_baselib)
199 204
200 if len(options) > 1:
201 for optstr in options:
202 optsets.append(optstr.split())
203
204 #get common options present in all the tune parameters
205 common_opt_set = set.intersection(*map(set, optsets))
206
207 #common options will be added at the end of the options string only once
208 if (len(common_opt_set) > 0):
209 rex = re.compile(''.join(['\\b(', '|'.join(common_opt_set), ')\\W']), re.I)
210 options = [rex.sub("", optstr) for optstr in options]
211 options = [optstr.strip() for optstr in options]
212 options[len(options)-1] = ' '.join((options[len(options)-1], ' '.join(common_opt_set)))
213
214 write_config(builddir, target_config_files, options, dirnames, osdirnames) 205 write_config(builddir, target_config_files, options, dirnames, osdirnames)
215 write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32) 206 write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
216} 207}