# git rev-parse -q --verify 58bb4f7d4970e92c2400208a1b48aae3b2853e5c^{commit} 58bb4f7d4970e92c2400208a1b48aae3b2853e5c already have revision, skipping fetch # git checkout -q -f -B kisskb 58bb4f7d4970e92c2400208a1b48aae3b2853e5c # git clean -qxdf # < git log -1 # commit 58bb4f7d4970e92c2400208a1b48aae3b2853e5c # Author: Masahiro Yamada # Date: Thu Mar 12 07:37:25 2020 +0900 # # kbuild: link lib-y objects to vmlinux forcibly when CONFIG_MODULES=y # # Kbuild supports not only obj-y but also lib-y to list objects linked to # vmlinux. # # The difference between them is that all the objects from obj-y are # forcibly linked to vmlinux, whereas the objects from lib-y are linked # as needed; if there is no user of a lib-y object, it is not linked. # # lib-y is intended to list utility functions that may be called from all # over the place (and may be unused at all), but it is a problem for # EXPORT_SYMBOL(). Even if there is no call-site in the vmlinux, we need # to keep exported symbols for the use from loadable modules. # # Commit 7f2084fa55e6 ("[kbuild] handle exports in lib-y objects reliably") # worked around it by linking a dummy object, lib-ksyms.o, which contains # references to all the symbols exported from lib.a in that directory. # It uses the linker script command, EXTERN. Unfortunately, the meaning of # EXTERN of ld.lld is different from that of ld.bfd. Therefore, this does # not work with LD=ld.lld (CBL issue #515). # # Anyway, the build rule of lib-ksyms.o is somewhat tricky. So, I want to # get rid of it. # # At first, I was thinking of accumulating lib-y objects into obj-y # (or even replacing lib-y with obj-y entirely), but the lib-y syntax # is used beyond the ordinary use in lib/ and arch/*/lib/. # # Examples: # # - drivers/firmware/efi/libstub/Makefile builds lib.a, which is linked # into vmlinux in the own way (arm64), or linked to the decompressor # (arm, x86). # # - arch/alpha/lib/Makefile builds lib.a which is linked not only to # vmlinux, but also to bootloaders in arch/alpha/boot/Makefile. # # - arch/xtensa/boot/lib/Makefile builds lib.a for use from # arch/xtensa/boot/boot-redboot/Makefile. # # One more thing, adding everything to obj-y would increase the vmlinux # size of allnoconfig (or tinyconfig). # # For less impact, I tweaked the destination of lib.a at the top Makefile; # when CONFIG_MODULES=y, lib.a goes to KBUILD_VMLINUX_OBJS, which is # forcibly linked to vmlinux, otherwise lib.a goes to KBUILD_VMLINUX_LIBS # as before. # # The size impact for normal usecases is quite small since at lease one # symbol in every lib-y object is eventually called by someone. In case # you are intrested, here are the figures. # # x86_64_defconfig: # # text data bss dec hex filename # 19566602 5422072 1589328 26578002 1958c52 vmlinux.before # 19566932 5422104 1589328 26578364 1958dbc vmlinux.after # # The case with the biggest impact is allnoconfig + CONFIG_MODULES=y. # # ARCH=x86 allnoconfig + CONFIG_MODULES=y: # # text data bss dec hex filename # 1175162 254740 1220608 2650510 28718e vmlinux.before # 1177974 254836 1220608 2653418 287cea vmlinux.after # # Hopefully this is still not a big deal. The per-file trimming with the # static library is not so effective after all. # # If fine-grained optimization is desired, some architectures support # CONFIG_LD_DEAD_CODE_DATA_ELIMINATION, which trims dead code per-symbol # basis. When LTO is supported in mainline, even better optimization will # be possible. # # Link: https://github.com/ClangBuiltLinux/linux/issues/515 # Signed-off-by: Masahiro Yamada # Reported-by: kbuild test robot # Reviewed-by: Nick Desaulniers # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-ld --version # < git log --format=%s --max-count=1 58bb4f7d4970e92c2400208a1b48aae3b2853e5c # < make -s -j 48 ARCH=powerpc O=/kisskb/build/kbuild_mpc85xx_smp_defconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- mpc85xx_smp_defconfig # < make -s -j 48 ARCH=powerpc O=/kisskb/build/kbuild_mpc85xx_smp_defconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- help # make -s -j 48 ARCH=powerpc O=/kisskb/build/kbuild_mpc85xx_smp_defconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- olddefconfig # make -s -j 48 ARCH=powerpc O=/kisskb/build/kbuild_mpc85xx_smp_defconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:204:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c: In function 'proc_reg_open': /kisskb/src/include/linux/list.h:72:12: warning: 'pdeo' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c:401:21: note: 'pdeo' was declared here /kisskb/src/fs/ext4/extents.c: In function 'ext4_convert_unwritten_io_end_vec': /kisskb/src/fs/ext4/extents.c:5009:23: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c: In function 'univ8250_release_irq': /kisskb/src/drivers/tty/serial/8250/8250_core.c:247:18: warning: 'i' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c:227:19: note: 'i' was declared here /kisskb/src/kernel/trace/trace_events.c: In function 'event_create_dir': /kisskb/src/kernel/trace/trace_events.c:2040:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function 'regmap_raw_read': /kisskb/src/drivers/base/regmap/regmap.c:2598:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function '_regmap_raw_write': /kisskb/src/drivers/base/regmap/regmap.c:1859:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/mm/hugetlb.c: In function 'alloc_pool_huge_page': /kisskb/src/mm/hugetlb.c:1741:5: warning: 'page' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/sound/soc/codecs/wm8960.c: In function 'wm8960_configure_clocking': /kisskb/src/sound/soc/codecs/wm8960.c:800:70: warning: 'j' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/sound/soc/codecs/wm8960.c:797:68: warning: 'i' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c: In function 'allocate_bd': /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:139:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] /kisskb/src/drivers/usb/core/devio.c: In function 'async_completed': /kisskb/src/drivers/usb/core/devio.c:625:23: warning: 'errno' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/udf/unicode.c: In function 'udf_name_conv_char': /kisskb/src/fs/udf/unicode.c:132:8: warning: 'c' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/namei.c: In function 'handle_dots': /kisskb/src/fs/namei.c:1805:10: warning: 'inode' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/namei.c:1805:10: warning: 'seq' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/io_uring.c: In function '__io_sqe_files_update': /kisskb/src/fs/io_uring.c:6617:13: warning: 'err' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8541cds.dts:330.3-21: Warning (pci_device_bus_num): /pci@e0008000/i8259@19000:bus-range: PCI bus number 1 out of range, expected (0 - 0) /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8555cds.dts:330.3-21: Warning (pci_device_bus_num): /pci@e0008000/i8259@19000:bus-range: PCI bus number 1 out of range, expected (0 - 0) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd407b8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) INFO: Uncompressed kernel (size 0xd2ffe8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xe00000) Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:23 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6373501 Bytes = 6224.12 KiB = 6.08 MiB Load Address: 00000000 Entry Point: 00000000 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:25 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6404004 Bytes = 6253.91 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002a8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:25 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6405849 Bytes = 6255.71 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002a8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:26 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6405108 Bytes = 6254.99 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002a8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:26 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6404831 Bytes = 6254.72 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002a8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:26 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6405462 Bytes = 6255.33 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002a8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:26 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6404074 Bytes = 6253.98 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002a8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:26 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6404862 Bytes = 6254.75 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002e8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:27 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6404016 Bytes = 6253.92 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002e8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:27 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6404017 Bytes = 6253.92 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002e8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:26 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6405099 Bytes = 6254.98 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002a8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:27 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6405287 Bytes = 6255.16 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002a8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:27 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6404821 Bytes = 6254.71 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002e8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:27 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6404830 Bytes = 6254.72 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002a8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:27 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6404083 Bytes = 6253.99 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002e8 Image Name: Linux-5.6.0-g58bb4f7d4970 Created: Wed Apr 8 01:35:27 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6405948 Bytes = 6255.81 KiB = 6.11 MiB Load Address: 00e00000 Entry Point: 00e002a8 Completed OK # rm -rf /kisskb/build/kbuild_mpc85xx_smp_defconfig_powerpc-gcc4.6 # Build took: 0:02:06.408750