# git rev-parse -q --verify d0ee23f9d78be5531c4b055ea424ed0b489dfe9b^{commit} d0ee23f9d78be5531c4b055ea424ed0b489dfe9b already have revision, skipping fetch # git checkout -q -f -B kisskb d0ee23f9d78be5531c4b055ea424ed0b489dfe9b # git clean -qxdf # < git log -1 # commit d0ee23f9d78be5531c4b055ea424ed0b489dfe9b # Author: Nathan Chancellor # Date: Mon Sep 13 15:09:00 2021 -0700 # # tools: compiler-gcc.h: Guard error attribute use with __has_attribute # # When building objtool with HOSTCC=clang, there are several errors along # the lines of # # orc_dump.c:201:28: error: unknown attribute 'error' ignored [-Werror,-Wunknown-attributes] # # This occurs after commit 4e59869aa655 ("compiler-gcc.h: drop checks for # older GCC versions"), which removed the GCC_VERSION gating. The removed # version check just so happened to prevent __compiletime_error() from # being defined with clang because it pretends to be GCC 4.2.1 for # compatibility but the error attribute was not added to clang until # 14.0.0. # # Commit 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h # mutually exclusive") and commit a3f8a30f3f00 ("Compiler Attributes: use # feature checks instead of version checks") refactored the handling of # attributes in the main kernel to avoid situations like this but that # refactoring has never been done for the tools directory. # # Refactoring is a rather large undertaking and this has never been an # issue before so instead, just guard the definition of # __compiletime_error() with __has_attribute() so that there are no more # errors. # # Fixes: 4e59869aa655 ("compiler-gcc.h: drop checks for older GCC versions") # Signed-off-by: Nathan Chancellor # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 d0ee23f9d78be5531c4b055ea424ed0b489dfe9b # < make -s -j 8 ARCH=powerpc O=/kisskb/build/linus_pseries_le_defconfig+NO_SPLPAR_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- pseries_le_defconfig # Added to kconfig CONFIG_PPC_SPLPAR=n # < make -s -j 8 ARCH=powerpc O=/kisskb/build/linus_pseries_le_defconfig+NO_SPLPAR_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 8 ARCH=powerpc O=/kisskb/build/linus_pseries_le_defconfig+NO_SPLPAR_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig # make -s -j 8 ARCH=powerpc O=/kisskb/build/linus_pseries_le_defconfig+NO_SPLPAR_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- In file included from :0:0: /kisskb/src/include/linux/compiler_attributes.h:62:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__assume_aligned__) ^ /kisskb/src/include/linux/compiler_attributes.h:62:20: error: missing binary operator before token "(" #if __has_attribute(__assume_aligned__) ^ /kisskb/src/include/linux/compiler_attributes.h:88:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__copy__) ^ /kisskb/src/include/linux/compiler_attributes.h:88:20: error: missing binary operator before token "(" #if __has_attribute(__copy__) ^ /kisskb/src/include/linux/compiler_attributes.h:113:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__designated_init__) ^ /kisskb/src/include/linux/compiler_attributes.h:113:20: error: missing binary operator before token "(" #if __has_attribute(__designated_init__) ^ /kisskb/src/include/linux/compiler_attributes.h:124:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__error__) ^ /kisskb/src/include/linux/compiler_attributes.h:124:20: error: missing binary operator before token "(" #if __has_attribute(__error__) ^ /kisskb/src/include/linux/compiler_attributes.h:135:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__externally_visible__) ^ /kisskb/src/include/linux/compiler_attributes.h:135:20: error: missing binary operator before token "(" #if __has_attribute(__externally_visible__) ^ In file included from :0:0: /kisskb/src/include/linux/compiler_attributes.h:171:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__no_caller_saved_registers__) ^ /kisskb/src/include/linux/compiler_attributes.h:171:20: error: missing binary operator before token "(" #if __has_attribute(__no_caller_saved_registers__) ^ /kisskb/src/include/linux/compiler_attributes.h:182:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__noclone__) ^ /kisskb/src/include/linux/compiler_attributes.h:182:20: error: missing binary operator before token "(" #if __has_attribute(__noclone__) ^ /kisskb/src/include/linux/compiler_attributes.h:199:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__fallthrough__) ^ /kisskb/src/include/linux/compiler_attributes.h:199:20: error: missing binary operator before token "(" #if __has_attribute(__fallthrough__) ^ /kisskb/src/include/linux/compiler_attributes.h:226:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__nonstring__) ^ /kisskb/src/include/linux/compiler_attributes.h:226:20: error: missing binary operator before token "(" #if __has_attribute(__nonstring__) ^ /kisskb/src/include/linux/compiler_attributes.h:238:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__no_profile_instrument_function__) ^ /kisskb/src/include/linux/compiler_attributes.h:238:20: error: missing binary operator before token "(" #if __has_attribute(__no_profile_instrument_function__) ^ /kisskb/src/include/linux/compiler_attributes.h:296:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__warning__) ^ /kisskb/src/include/linux/compiler_attributes.h:296:20: error: missing binary operator before token "(" #if __has_attribute(__warning__) ^ make[2]: *** [/kisskb/src/arch/powerpc/boot/Makefile:225: arch/powerpc/boot/crt0.o] Error 1 make[2]: *** Waiting for unfinished jobs.... In file included from :0:0: /kisskb/src/include/linux/compiler_attributes.h:62:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__assume_aligned__) ^ /kisskb/src/include/linux/compiler_attributes.h:62:20: error: missing binary operator before token "(" #if __has_attribute(__assume_aligned__) ^ /kisskb/src/include/linux/compiler_attributes.h:88:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__copy__) ^ /kisskb/src/include/linux/compiler_attributes.h:88:20: error: missing binary operator before token "(" #if __has_attribute(__copy__) ^ /kisskb/src/include/linux/compiler_attributes.h:113:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__designated_init__) ^ /kisskb/src/include/linux/compiler_attributes.h:113:20: error: missing binary operator before token "(" #if __has_attribute(__designated_init__) ^ /kisskb/src/include/linux/compiler_attributes.h:124:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__error__) ^ /kisskb/src/include/linux/compiler_attributes.h:124:20: error: missing binary operator before token "(" #if __has_attribute(__error__) ^ /kisskb/src/include/linux/compiler_attributes.h:135:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__externally_visible__) ^ /kisskb/src/include/linux/compiler_attributes.h:135:20: error: missing binary operator before token "(" #if __has_attribute(__externally_visible__) ^ In file included from :0:0: /kisskb/src/include/linux/compiler_attributes.h:171:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__no_caller_saved_registers__) ^ /kisskb/src/include/linux/compiler_attributes.h:171:20: error: missing binary operator before token "(" #if __has_attribute(__no_caller_saved_registers__) ^ /kisskb/src/include/linux/compiler_attributes.h:182:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__noclone__) ^ /kisskb/src/include/linux/compiler_attributes.h:182:20: error: missing binary operator before token "(" #if __has_attribute(__noclone__) ^ /kisskb/src/include/linux/compiler_attributes.h:199:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__fallthrough__) ^ /kisskb/src/include/linux/compiler_attributes.h:199:20: error: missing binary operator before token "(" #if __has_attribute(__fallthrough__) ^ /kisskb/src/include/linux/compiler_attributes.h:226:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__nonstring__) ^ /kisskb/src/include/linux/compiler_attributes.h:226:20: error: missing binary operator before token "(" #if __has_attribute(__nonstring__) ^ /kisskb/src/include/linux/compiler_attributes.h:238:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__no_profile_instrument_function__) ^ /kisskb/src/include/linux/compiler_attributes.h:238:20: error: missing binary operator before token "(" #if __has_attribute(__no_profile_instrument_function__) ^ /kisskb/src/include/linux/compiler_attributes.h:296:5: warning: "__has_attribute" is not defined [-Wundef] #if __has_attribute(__warning__) ^ /kisskb/src/include/linux/compiler_attributes.h:296:20: error: missing binary operator before token "(" #if __has_attribute(__warning__) ^ make[2]: *** [/kisskb/src/arch/powerpc/boot/Makefile:225: arch/powerpc/boot/div64.o] Error 1 make[1]: *** [/kisskb/src/arch/powerpc/Makefile:283: zImage] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:219: __sub-make] Error 2 Command 'make -s -j 8 ARCH=powerpc O=/kisskb/build/linus_pseries_le_defconfig+NO_SPLPAR_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/linus_pseries_le_defconfig+NO_SPLPAR_powerpc-gcc5 # Build took: 0:05:06.856187