# git rev-parse -q --verify 1619b69edce14c4a4665fa8ff4c587dcc77202a9^{commit} 1619b69edce14c4a4665fa8ff4c587dcc77202a9 already have revision, skipping fetch # git checkout -q -f -B kisskb 1619b69edce14c4a4665fa8ff4c587dcc77202a9 # git clean -qxdf # < git log -1 # commit 1619b69edce14c4a4665fa8ff4c587dcc77202a9 # Author: Michael Ellerman # Date: Tue Sep 14 22:17:23 2021 +1000 # # powerpc/boot: Fix build failure since GCC 4.9 removal # # Stephen reported that the build was broken since commit # 6d2ef226f2f1 ("compiler_attributes.h: drop __has_attribute() support for # gcc4"), with errors such as: # # include/linux/compiler_attributes.h:296:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] # 296 | #if __has_attribute(__warning__) # | ^~~~~~~~~~~~~~~ # make[2]: *** [arch/powerpc/boot/Makefile:225: arch/powerpc/boot/crt0.o] Error 1 # # But we expect __has_attribute() to always be defined now that we've # stopped using GCC 4. # # Linus debugged it to the point of reading the GCC sources, and noticing # that the problem is that __has_attribute() is not defined when # preprocessing assembly files, which is what we're doing here. # # Our assembly files don't include, or need, compiler_attributes.h, but # they are getting it unconditionally from the -include in BOOT_CFLAGS, # which is then added in its entirety to BOOT_AFLAGS. # # That -include was added in commit 77433830ed16 ("powerpc: boot: include # compiler_attributes.h") so that we'd have "fallthrough" and other # attributes defined for the C files in arch/powerpc/boot. But it's not # needed for assembly files. # # The minimal fix is to move the addition to BOOT_CFLAGS of -include # compiler_attributes.h until after we've copied BOOT_CFLAGS into # BOOT_AFLAGS. That avoids including compiler_attributes.h for asm files, # but makes no other change to BOOT_CFLAGS or BOOT_AFLAGS. # # Reported-by: Stephen Rothwell # Debugged-by: Linus Torvalds # Signed-off-by: Michael Ellerman # Tested-by: Guenter Roeck # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-11.1.0-nolibc/x86_64-linux/bin/x86_64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-11.1.0-nolibc/x86_64-linux/bin/x86_64-linux-ld --version # < git log --format=%s --max-count=1 1619b69edce14c4a4665fa8ff4c587dcc77202a9 # < make -s -j 32 ARCH=x86_64 O=/kisskb/build/linus-rand_x86_64-randconfig_x86_64-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/x86_64-linux/bin/x86_64-linux- randconfig # Added to kconfig CONFIG_STANDALONE=y # Added to kconfig CONFIG_PREVENT_FIRMWARE_BUILD=y # Added to kconfig CONFIG_CC_STACKPROTECTOR_STRONG=n # Added to kconfig CONFIG_GCC_PLUGINS=n # Added to kconfig CONFIG_GCC_PLUGIN_CYC_COMPLEXITY=n # Added to kconfig CONFIG_GCC_PLUGIN_SANCOV=n # Added to kconfig CONFIG_GCC_PLUGIN_LATENT_ENTROPY=n # Added to kconfig CONFIG_BPF_PRELOAD=n # Added to kconfig # < make -s -j 32 ARCH=x86_64 O=/kisskb/build/linus-rand_x86_64-randconfig_x86_64-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/x86_64-linux/bin/x86_64-linux- help # make -s -j 32 ARCH=x86_64 O=/kisskb/build/linus-rand_x86_64-randconfig_x86_64-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/x86_64-linux/bin/x86_64-linux- olddefconfig .config:7265:warning: override: reassigning to symbol PREVENT_FIRMWARE_BUILD .config:7267:warning: override: reassigning to symbol GCC_PLUGINS # make -s -j 32 ARCH=x86_64 O=/kisskb/build/linus-rand_x86_64-randconfig_x86_64-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/x86_64-linux/bin/x86_64-linux- arch/x86/crypto/sm4-aesni-avx-asm_64.o: warning: objtool: sm4_aesni_avx_crypt8()+0x8: sibling call from callable instruction with modified stack frame /kisskb/src/drivers/gpu/drm/radeon/radeon_object.c: In function 'radeon_bo_create': /kisskb/src/drivers/gpu/drm/radeon/radeon_object.c:207:2: warning: #warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance thanks to write-combining [-Wcpp] 207 | #warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance \ | ^~~~~~~ /kisskb/src/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c: In function 'amdgpu_bo_support_uswc': /kisskb/src/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:493:2: warning: #warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance thanks to write-combining [-Wcpp] 493 | #warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance \ | ^~~~~~~ In file included from /kisskb/src/include/linux/string.h:262, from /kisskb/src/include/linux/bitmap.h:10, from /kisskb/src/include/linux/cpumask.h:12, from /kisskb/src/include/linux/smp.h:13, from /kisskb/src/include/linux/lockdep.h:14, from /kisskb/src/include/linux/mutex.h:17, from /kisskb/src/include/linux/kernfs.h:12, from /kisskb/src/include/linux/sysfs.h:16, from /kisskb/src/include/linux/kobject.h:20, from /kisskb/src/include/linux/of.h:17, from /kisskb/src/include/linux/irqdomain.h:35, from /kisskb/src/include/linux/acpi.h:13, from /kisskb/src/drivers/platform/x86/lg-laptop.c:10: In function 'strlen', inlined from 'acpi_add' at /kisskb/src/drivers/platform/x86/lg-laptop.c:658:6: /kisskb/src/include/linux/fortify-string.h:25:33: warning: argument 1 null where non-null expected [-Wnonnull] 25 | #define __underlying_strlen __builtin_strlen | ^ /kisskb/src/include/linux/fortify-string.h:60:24: note: in expansion of macro '__underlying_strlen' 60 | return __underlying_strlen(p); | ^~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/platform/x86/lg-laptop.c: In function 'acpi_add': /kisskb/src/include/linux/fortify-string.h:25:33: note: in a call to built-in function '__builtin_strlen' 25 | #define __underlying_strlen __builtin_strlen | ^ /kisskb/src/include/linux/fortify-string.h:60:24: note: in expansion of macro '__underlying_strlen' 60 | return __underlying_strlen(p); | ^~~~~~~~~~~~~~~~~~~ In function 'strlen', inlined from 'acpi_add' at /kisskb/src/drivers/platform/x86/lg-laptop.c:674:8: /kisskb/src/include/linux/fortify-string.h:25:33: warning: argument 1 null where non-null expected [-Wnonnull] 25 | #define __underlying_strlen __builtin_strlen | ^ /kisskb/src/include/linux/fortify-string.h:60:24: note: in expansion of macro '__underlying_strlen' 60 | return __underlying_strlen(p); | ^~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/platform/x86/lg-laptop.c: In function 'acpi_add': /kisskb/src/include/linux/fortify-string.h:25:33: note: in a call to built-in function '__builtin_strlen' 25 | #define __underlying_strlen __builtin_strlen | ^ /kisskb/src/include/linux/fortify-string.h:60:24: note: in expansion of macro '__underlying_strlen' 60 | return __underlying_strlen(p); | ^~~~~~~~~~~~~~~~~~~ Completed OK # rm -rf /kisskb/build/linus-rand_x86_64-randconfig_x86_64-gcc11 # Build took: 0:10:36.190964