# 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/m68k-linux/bin/m68k-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-11.1.0-nolibc/m68k-linux/bin/m68k-linux-ld --version # < git log --format=%s --max-count=1 1619b69edce14c4a4665fa8ff4c587dcc77202a9 # < make -s -j 48 ARCH=m68k O=/kisskb/build/linus_m5272c3_defconfig_m68k-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/m68k-linux/bin/m68k-linux- m5272c3_defconfig # < make -s -j 48 ARCH=m68k O=/kisskb/build/linus_m5272c3_defconfig_m68k-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/m68k-linux/bin/m68k-linux- help # make -s -j 48 ARCH=m68k O=/kisskb/build/linus_m5272c3_defconfig_m68k-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/m68k-linux/bin/m68k-linux- olddefconfig # make -s -j 48 ARCH=m68k O=/kisskb/build/linus_m5272c3_defconfig_m68k-gcc11 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-11.1.0-nolibc/m68k-linux/bin/m68k-linux- In file included from /kisskb/src/include/linux/string.h:20, from /kisskb/src/include/linux/bitmap.h:10, from /kisskb/src/include/linux/cpumask.h:12, from /kisskb/src/include/linux/mm_types_task.h:14, from /kisskb/src/include/linux/mm_types.h:5, from /kisskb/src/include/linux/buildid.h:5, from /kisskb/src/include/linux/module.h:14, from /kisskb/src/drivers/net/ethernet/freescale/fec_main.c:25: In function 'fec_get_mac', inlined from 'fec_enet_init' at /kisskb/src/drivers/net/ethernet/freescale/fec_main.c:3510:8, inlined from 'fec_probe' at /kisskb/src/drivers/net/ethernet/freescale/fec_main.c:3932:8: /kisskb/src/arch/m68k/include/asm/string.h:72:25: warning: '__builtin_memcpy' reading 6 bytes from a region of size 0 [-Wstringop-overread] 72 | #define memcpy(d, s, n) __builtin_memcpy(d, s, n) | ^~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/net/ethernet/freescale/fec_main.c:1771:9: note: in expansion of macro 'memcpy' 1771 | memcpy(ndev->dev_addr, iap, ETH_ALEN); | ^~~~~~ Completed OK # rm -rf /kisskb/build/linus_m5272c3_defconfig_m68k-gcc11 # Build took: 0:00:33.657287