On 16/11/18 10:42 +0000, Renlin Li wrote:
Hi all,

Please remember that all patches for libstdc++ must be sent to the
libstdc++ list, as documented at https://gcc.gnu.org/lists.html
Just CCing me is not enough.

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.

This is great, thanks!

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?

OK, thanks.

Reply via email to