Skip to content

Commit

Permalink
int128: fix __uint128_t compiler test in Kconfig
Browse files Browse the repository at this point in the history
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: c12d336 ("int128: move __uint128_t compiler test to Kconfig")
Reported-by: George Spelvin <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
Tested-by: George Spelvin <[email protected]>
  • Loading branch information
masahir0y committed Mar 11, 2020
1 parent 8cc4fd7 commit 3a7c733
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,7 @@ config ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
bool

config CC_HAS_INT128
def_bool y
depends on !$(cc-option,-D__SIZEOF_INT128__=0)
def_bool !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) && 64BIT

#
# For architectures that know their GCC __int128 support is sound
Expand Down

0 comments on commit 3a7c733

Please sign in to comment.