[Patch, libstdc++.exp]Update the usage of cached result, rebuild nlocale wrapper for each variant.

Renlin Li renlin.li@foss.arm.com
Fri Nov 16 10:42:00 GMT 2018


Hi all,

Tejas noticed that libstdc++.exp currently builds nlocale driver (libstc++.exp:check_v3_target_namedlocale())
once for a test run. This is done irrespective of the number of variants in the site.exp file.
For eg. if we have more than one variant for different target profiles i.e.

     <board>/-mthumb/-march=armv8-a/-mfpu=crypto-neon-fp-armv8/-mfloat-abi=hard
     <board>/-mthumb/-mcpu=cortex-m0

nlocale<id>.cpp is built once and is reused for all the variants.
This is incorrect as the same binary may not work on all target profiles - eg. nlocale<id>.x built for arm A-profile
may not work on M-profile targets. nlocale<id> needs to be rebuilt for each variant in site.exp. This patch fixes that.

Meanwhile, it updates all the usage of cached value with the new method.
This is similar to the recent change in gcc/testsuite/lib/target-support.exp
A global dictionary is used to store a property for a particular target, instead of the target check and update approach.
This factors the common code out of each procedure, reduce the length of libstdc++.exp file.


Tested on arm-none-eabi with the following variants in site.exp:

     <board>/-marm/-march=armv7-a/-mfpu=vfpv3-d16/-mfloat-abi=softfp
     <board>/-mthumb/-march=armv8-a/-mfpu=crypto-neon-fp-armv8/-mfloat-abi=hard
     <board>/-mthumb/-mcpu=cortex-m0
     <board>/-mthumb/-mcpu=cortex-m3
     <board>/-mthumb/-mcpu=cortex-m4
     <board>/-mthumb/-mcpu=cortex-m7
     <board>/-mthumb/-mcpu=cortex-m23
     <board>/-mthumb/-march=armv8-m.main


Tested on native x86_64,

    make check-target-libstdc++-v3

with default unix variant. There is no change on the result.


Okay to commit?

Regards,
Renlin


gcc/libstdc++-v3/:
2018-11-16  Renlin Li  <renlin.li@arm.com>
	    Tejas Belagod  <tejas.belagod@arm.com>

         testsuite/lib/libstdc++.exp (check_v3_target_prop_cached): New proc.
         (check_v3_target): Use the check_v3_target_prop_cached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libstdc++.patch
Type: text/x-patch
Size: 37445 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20181116/3369daa2/attachment.bin>


More information about the Gcc-patches mailing list