# 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-11.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-11.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 d0ee23f9d78be5531c4b055ea424ed0b489dfe9b # < make -s -j 80 ARCH=powerpc O=/kisskb/build/linus_pseries_le_defconfig_powerpc-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux- pseries_le_defconfig # < make -s -j 80 ARCH=powerpc O=/kisskb/build/linus_pseries_le_defconfig_powerpc-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 80 ARCH=powerpc O=/kisskb/build/linus_pseries_le_defconfig_powerpc-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig # make -s -j 80 ARCH=powerpc O=/kisskb/build/linus_pseries_le_defconfig_powerpc-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux- In file included from : /kisskb/src/include/linux/compiler_attributes.h:62:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] 62 | #if __has_attribute(__assume_aligned__) | ^~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_attributes.h:62:20: error: missing binary operator before token "(" 62 | #if __has_attribute(__assume_aligned__) | ^ /kisskb/src/include/linux/compiler_attributes.h:88:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] 88 | #if __has_attribute(__copy__) | ^~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_attributes.h:88:20: error: missing binary operator before token "(" 88 | #if __has_attribute(__copy__) | ^ /kisskb/src/include/linux/compiler_attributes.h:113:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] 113 | #if __has_attribute(__designated_init__) | ^~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_attributes.h:113:20: error: missing binary operator before token "(" 113 | #if __has_attribute(__designated_init__) | ^ /kisskb/src/include/linux/compiler_attributes.h:124:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] 124 | #if __has_attribute(__error__) | ^~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_attributes.h:124:20: error: missing binary operator before token "(" 124 | #if __has_attribute(__error__) | ^ /kisskb/src/include/linux/compiler_attributes.h:135:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] 135 | #if __has_attribute(__externally_visible__) | ^~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_attributes.h:135:20: error: missing binary operator before token "(" 135 | #if __has_attribute(__externally_visible__) | ^ In file included from : /kisskb/src/include/linux/compiler_attributes.h:171:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] 171 | #if __has_attribute(__no_caller_saved_registers__) | ^~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_attributes.h:171:20: error: missing binary operator before token "(" 171 | #if __has_attribute(__no_caller_saved_registers__) | ^ /kisskb/src/include/linux/compiler_attributes.h:182:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] 182 | #if __has_attribute(__noclone__) | ^~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_attributes.h:182:20: error: missing binary operator before token "(" 182 | #if __has_attribute(__noclone__) | ^ /kisskb/src/include/linux/compiler_attributes.h:199:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] 199 | #if __has_attribute(__fallthrough__) | ^~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_attributes.h:199:20: error: missing binary operator before token "(" 199 | #if __has_attribute(__fallthrough__) | ^ /kisskb/src/include/linux/compiler_attributes.h:226:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] 226 | #if __has_attribute(__nonstring__) | ^~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_attributes.h:226:20: error: missing binary operator before token "(" 226 | #if __has_attribute(__nonstring__) | ^ /kisskb/src/include/linux/compiler_attributes.h:238:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] 238 | #if __has_attribute(__no_profile_instrument_function__) | ^~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_attributes.h:238:20: error: missing binary operator before token "(" 238 | #if __has_attribute(__no_profile_instrument_function__) | ^ /kisskb/src/include/linux/compiler_attributes.h:296:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] 296 | #if __has_attribute(__warning__) | ^~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_attributes.h:296:20: error: missing binary operator before token "(" 296 | #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.... 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 80 ARCH=powerpc O=/kisskb/build/linus_pseries_le_defconfig_powerpc-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/linus_pseries_le_defconfig_powerpc-gcc11 # Build took: 0:04:04.325004