diff options
author | Alexandru-Cezar Sardan <alexandru.sardan@freescale.com> | 2014-03-31 16:16:13 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-31 22:59:03 +0100 |
commit | 90dc31c24adfa8e916a9c475ae1afc58ad179dfb (patch) | |
tree | 68586f8148bc3debce5a03ff7270a10ada169e64 /meta/recipes-devtools | |
parent | ade26bc63fdf89f297bec5f67bfff108e90438fc (diff) | |
download | openembedded-core-90dc31c24adfa8e916a9c475ae1afc58ad179dfb.tar.gz openembedded-core-90dc31c24adfa8e916a9c475ae1afc58ad179dfb.tar.bz2 openembedded-core-90dc31c24adfa8e916a9c475ae1afc58ad179dfb.zip |
gcc: changed multilib options handling
Duplicate parameters in the tune args are repeated in the
MULTILIB_OPTIONS variable. This leads to incorrect configurations
if the order of the parameters is bad.
(Eg. "mhard-float m32/mhard-float m64" leads to an incorrect config)
This patch finds the common parameters and removes the duplicates.
Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-multilib-config.inc | 24 |
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() { options = [] dirnames = [] osdirnames = [] + optsets = [] for ml in ml_list: tune = d.getVar(ml, True) @@ -172,16 +173,31 @@ python gcc_multilib_setup() { else: bb.error('Unknown libdir (%s) of the tune : %s' % (tune_baselib, tune)) - # take out '-' and march='s from parameters - options.append(re.sub(r'march=[^ ]+ *', '', - re.sub(r' +\-+', ' ', - re.sub(r'^ *\-+', '', tune_parameters['ccargs'])))) + # 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']))))) 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) } |