summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/gcc/gcc-multilib-config.inc24
1 files changed, 20 insertions, 4 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
index 005aa6b814..30745a65e0 100644
--- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc
+++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -148,6 +148,7 @@ python gcc_multilib_setup() {
148 options = [] 148 options = []
149 dirnames = [] 149 dirnames = []
150 osdirnames = [] 150 osdirnames = []
151 optsets = []
151 152
152 for ml in ml_list: 153 for ml in ml_list:
153 tune = d.getVar(ml, True) 154 tune = d.getVar(ml, True)
@@ -172,16 +173,31 @@ python gcc_multilib_setup() {
172 else: 173 else:
173 bb.error('Unknown libdir (%s) of the tune : %s' % (tune_baselib, tune)) 174 bb.error('Unknown libdir (%s) of the tune : %s' % (tune_baselib, tune))
174 175
175 # take out '-' and march='s from parameters 176 # take out '-' mcpu='s and march='s from parameters
176 options.append(re.sub(r'march=[^ ]+ *', '', 177 options.append(re.sub(r'mcpu=[^ ]+ *', '',
177 re.sub(r' +\-+', ' ', 178 re.sub(r'march=[^ ]+ *', '',
178 re.sub(r'^ *\-+', '', tune_parameters['ccargs'])))) 179 re.sub(r' +\-+', ' ',
180 re.sub(r'^ *\-+', '', tune_parameters['ccargs'])))))
179 if tune_baselib == 'lib': 181 if tune_baselib == 'lib':
180 dirnames.append('32') # /lib => 32bit lib 182 dirnames.append('32') # /lib => 32bit lib
181 else: 183 else:
182 dirnames.append(tune_baselib.replace('lib', '')) 184 dirnames.append(tune_baselib.replace('lib', ''))
183 osdirnames.append('../' + tune_baselib) 185 osdirnames.append('../' + tune_baselib)
184 186
187 if len(options) > 1:
188 for optstr in options:
189 optsets.append(optstr.split())
190
191 #get common options present in all the tune parameters
192 common_opt_set = set.intersection(*map(set, optsets))
193
194 #common options will be added at the end of the options string only once
195 if (len(common_opt_set) > 0):
196 rex = re.compile(''.join(['\\b(', '|'.join(common_opt_set), ')\\W']), re.I)
197 options = [rex.sub("", optstr) for optstr in options]
198 options = [optstr.strip() for optstr in options]
199 options[len(options)-1] = ' '.join((options[len(options)-1], ' '.join(common_opt_set)))
200
185 write_config(builddir, target_config_files, options, dirnames, osdirnames) 201 write_config(builddir, target_config_files, options, dirnames, osdirnames)
186 write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32) 202 write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
187} 203}