diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2024-12-02 15:06:58 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2024-12-06 09:57:49 +0100 |
commit | 490443357668a87e3c322f218873a7649a2552df (patch) | |
tree | 7719dbfc4b705333767e41eda62453f3913b3780 /gcc | |
parent | 4ab02a7b26b1845de1e61d8145678da7215442fa (diff) | |
download | gcc-490443357668a87e3c322f218873a7649a2552df.zip gcc-490443357668a87e3c322f218873a7649a2552df.tar.gz gcc-490443357668a87e3c322f218873a7649a2552df.tar.bz2 |
'gcc/config/nvptx/t-nvptx': Don't use the 'shell' function of 'make'
The exit status of the command invoked in a 'Makefile' via '$(shell [...])'
effectively gets discarded (unless explicitly checking the GNU Make 4.2+
'.SHELLSTATUS' variable or jumping through other hoops). In order to be able
to catch errors in what the 'shell' function invokes, let's make things
explicit: similar to how 'gcc/config/avr/t-avr' is doing with 't-multilib-avr',
for example.
gcc/
* config/nvptx/t-nvptx (multilib_matches): Don't use the 'shell'
function of 'make'.
* config/nvptx/gen-multilib-matches.sh: Adjust.
Diffstat (limited to 'gcc')
-rwxr-xr-x | gcc/config/nvptx/gen-multilib-matches.sh | 9 | ||||
-rw-r--r-- | gcc/config/nvptx/t-nvptx | 14 |
2 files changed, 20 insertions, 3 deletions
diff --git a/gcc/config/nvptx/gen-multilib-matches.sh b/gcc/config/nvptx/gen-multilib-matches.sh index 44c758c..a39baee 100755 --- a/gcc/config/nvptx/gen-multilib-matches.sh +++ b/gcc/config/nvptx/gen-multilib-matches.sh @@ -33,6 +33,8 @@ sms=$(grep ^NVPTX_SM $nvptx_sm_def | sed 's/.*(//;s/,.*//') # ('misa=sm_SM'; thus not remapped), or has to be remapped to the "next lower" # variant that does get built. +multilib_matches= + # The "lowest" variant has to be built. sm_next_lower=INVALID @@ -50,11 +52,14 @@ for sm in $sms; do else # Output format as required for 'MULTILIB_MATCHES'. if [ x"$sm_map" = x. ]; then - echo ".=misa?sm_$sm" + multilib_matches_sm=".=misa?sm_$sm" else - echo "misa?sm_$sm_map=misa?sm_$sm" + multilib_matches_sm="misa?sm_$sm_map=misa?sm_$sm" fi + multilib_matches="$multilib_matches $multilib_matches_sm" sm_next_lower=$sm_map fi done + +echo "multilib_matches := $multilib_matches" diff --git a/gcc/config/nvptx/t-nvptx b/gcc/config/nvptx/t-nvptx index 9c5cbda..6c6a632 100644 --- a/gcc/config/nvptx/t-nvptx +++ b/gcc/config/nvptx/t-nvptx @@ -43,12 +43,24 @@ MULTILIB_OPTIONS += mgomp multilib_options_isa_list := $(TM_MULTILIB_CONFIG) multilib_options_isa_default := $(word 1,$(multilib_options_isa_list)) multilib_options_misa_list := $(addprefix misa=,$(multilib_options_isa_list)) + +t-nvptx-gen-multilib-matches: $(srcdir)/config/nvptx/gen-multilib-matches.sh \ + $(srcdir)/config/nvptx/t-nvptx \ + Makefile \ + $(srcdir)/config/nvptx/nvptx-sm.def + $(SHELL) $< \ + $(dir $<) \ + $(multilib_options_isa_default) \ + '$(multilib_options_isa_list)' \ + > $@ + +include t-nvptx-gen-multilib-matches + # Add the requested '-misa' variants as a multilib option ('misa=VAR1/misa=VAR2/misa=VAR3' etc.): empty := space := $(empty) $(empty) MULTILIB_OPTIONS += $(subst $(space),/,$(multilib_options_misa_list)) # ..., and remap '-misa' variants as appropriate: -multilib_matches := $(shell $(srcdir)/config/nvptx/gen-multilib-matches.sh $(srcdir)/config/nvptx $(multilib_options_isa_default) "$(multilib_options_isa_list)") MULTILIB_MATCHES += $(multilib_matches) # ..., and don't actually build what's the default '-misa': MULTILIB_EXCEPTIONS += *misa=$(multilib_options_isa_default)* |