]> git.baikalelectronics.ru Git - kernel.git/commit
int128: fix __uint128_t compiler test in Kconfig
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 10 Mar 2020 10:12:50 +0000 (19:12 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 11 Mar 2020 22:43:03 +0000 (07:43 +0900)
commitb37a66b8e91667ab1677f3ca766a3067d998b219
tree9998af16dd2464632fbc5a37339a11e971bc36de
parent9d3770567913d858c5853adb6fc8d58b9159c32d
int128: fix __uint128_t compiler test in Kconfig

The support for __uint128_t is dependent on the target bit size.

GCC that defaults to the 32-bit can still build the 64-bit kernel
with -m64 flag passed.

However, $(cc-option,-D__SIZEOF_INT128__=0) is evaluated against the
default machine bit, which may not match to the kernel it is building.

Theoretically, this could be evaluated separately for 64BIT/32BIT.

  config CC_HAS_INT128
          bool
          default !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) if 64BIT
          default !$(cc-option,$(m32-flag) -D__SIZEOF_INT128__=0)

I simplified it more because the 32-bit compiler is unlikely to support
__uint128_t.

Fixes: f5c3a09cb966 ("int128: move __uint128_t compiler test to Kconfig")
Reported-by: George Spelvin <lkml@sdf.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: George Spelvin <lkml@sdf.org>
init/Kconfig