Skip to contentSkip to conversation

kbuild: dummy-tools, fix inverted tests for gcc

PATCH In review Jiri Slaby 2 participants 2 messages Mar 3, 2021 – Mar 6, 2021 Kbuild

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 kbuild: dummy-tools, fix inverted tests for gcc

There is a test in Kconfig which takes inverted value of a compiler check:
* config CC_HAS_INT128

        def_bool !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0)

This results in CC_HAS_INT128 not being in super-config generated by dummy-tools. So take this into account in the gcc script.

Cc Masahiro Yamada <[email protected]>
---
 scripts/dummy-tools/gcc | 5 +++++
 1 file changed, 5 insertions(+)
scripts/dummy-tools/gcc +5 -0
index 5c113cad5601..0d0589cf8184 100755
@@ -85,3 +85,8 @@ if arg_contain -print-file-name=plugin "$@"; then
 	echo $plugin_dir
 	exit 0
 fi
+
+# inverted return value
+if arg_contain -D__SIZEOF_INT128__=0 "$@"; then
+	exit 1
+fi
Signature · 1 line
2.30.1
#1 lore raw
Quoted 4 lines · Jiri Slaby

There is a test in Kconfig which takes inverted value of a compiler check:
* config CC_HAS_INT128

Quoted 8 lines
        def_bool !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0)

This results in CC_HAS_INT128 not being in super-config generated by dummy-tools. So take this into account in the gcc script.

Cc Masahiro Yamada <[email protected]>

---

Applied to linux-kbuild/fixes.
Thanks.

We could fix init/Kconfig to use the positive logic as follows, but I guess (hope) this conditional will go away
when we raise the GCC min version next time.
So, I am fine with fixing this in dummy-tools.

init/Kconfig +1 -2
index 22946fe5ded9..502594a78282 100644
@@ -849,7 +849,7 @@ config ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
        bool
 
 config CC_HAS_INT128
-       def_bool !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) && 64BIT
+       def_bool $(success,echo '__int128 x;' | $(CC) $(CLANG_FLAGS)
-x c - -c -o /dev/null) && 64BIT
 
 #

# For architectures that know their GCC __int128 support is sound

Signature · 2 lines
Best Regards
Masahiro Yamada