linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arch@vger.kernel.org
Subject: Re: [PATCH v2 7/8] kbuild: use obj-y instead extra-y for objects placed at the head
Date: Mon, 19 Sep 2022 15:50:53 -0700	[thread overview]
Message-ID: <20220919225053.GA769506@roeck-us.net> (raw)
In-Reply-To: <20220906061313.1445810-8-masahiroy@kernel.org>

Hi,

On Tue, Sep 06, 2022 at 03:13:12PM +0900, Masahiro Yamada wrote:
> The objects placed at the head of vmlinux need special treatments:
> 
>  - arch/$(SRCARCH)/Makefile adds them to head-y in order to place
>    them before other archives in the linker command line.
> 
>  - arch/$(SRCARCH)/kernel/Makefile adds them to extra-y instead of
>    obj-y to avoid them going into built-in.a.
> 
> This commit gets rid of the latter.
> 
> Create vmlinux.a to collect all the objects that are unconditionally
> linked to vmlinux. The objects listed in head-y are moved to the head
> of vmlinux.a by using 'ar m'.
> 
> With this, arch/$(SRCARCH)/kernel/Makefile can consistently use obj-y
> for builtin objects.
> 
> There is no *.o that is directly linked to vmlinux. Drop unneeded code
> in scripts/clang-tools/gen_compile_commands.py.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

The following build failure is seen when building m68k:defconfig in
next-20220919.

m68k-linux-ld: arch/m68k/kernel/setup.o: in function `setup_arch':
setup.c:(.init.text+0x2dc): undefined reference to `availmem'
m68k-linux-ld: arch/m68k/kernel/early_printk.o: in function `debug_cons_write':
early_printk.c:(.ref.text+0x28): undefined reference to `debug_cons_nputs'
m68k-linux-ld: arch/m68k/mm/init.o: in function `mem_init':
init.c:(.init.text+0x6e): undefined reference to `kernel_pg_dir'
m68k-linux-ld: init.c:(.init.text+0x10): undefined reference to `kernel_pg_dir'
m68k-linux-ld: init.c:(.init.text+0x1e): undefined reference to `kernel_pg_dir'
m68k-linux-ld: arch/m68k/mm/motorola.o: in function `cache_page':
motorola.c:(.text+0xfc): undefined reference to `m68k_supervisor_cachemode'
m68k-linux-ld: arch/m68k/mm/motorola.o: in function `mmu_page_ctor':
motorola.c:(.text+0x162): undefined reference to `m68k_pgtable_cachemode'
m68k-linux-ld: arch/m68k/mm/motorola.o: in function `paging_init':
motorola.c:(.init.text+0x3d2): undefined reference to `kernel_pg_dir'
m68k-linux-ld: motorola.c:(.init.text+0x1d8): undefined reference to `availmem'
m68k-linux-ld: motorola.c:(.init.text+0x32e): undefined reference to `m68k_supervisor_cachemode'
m68k-linux-ld: motorola.c:(.init.text+0x3a8): undefined reference to `kernel_pg_dir'
m68k-linux-ld: arch/m68k/q40/config.o: in function `q40_mem_console_write':
config.c:(.text+0x25c): undefined reference to `q40_mem_cptr'
m68k-linux-ld: config.c:(.text+0x254): undefined reference to `q40_mem_cptr'
m68k-linux-ld: arch/m68k/q40/config.o: in function `q40_debug_setup':
config.c:(.init.text+0x28): undefined reference to `q40_mem_cptr'
m68k-linux-ld: arch/m68k/mvme16x/config.o: in function `mvme16x_abort_int':
config.c:(.text+0x4): undefined reference to `mvme_bdid'
m68k-linux-ld: arch/m68k/mvme16x/config.o: in function `mvme16x_get_model':
config.c:(.text+0xc8): undefined reference to `mvme_bdid'
m68k-linux-ld: config.c:(.text+0xce): undefined reference to `mvme_bdid'
m68k-linux-ld: config.c:(.text+0xea): undefined reference to `mvme_bdid'
m68k-linux-ld: arch/m68k/mvme16x/config.o: in function `mvme16x_get_hardware_list':
config.c:(.text+0x148): undefined reference to `mvme_bdid'
m68k-linux-ld: arch/m68k/mvme16x/config.o:config.c:(.text+0x1d0): more undefined references to `mvme_bdid' follow
m68k-linux-ld: kernel/extable.o: in function `core_kernel_text':
extable.c:(.text+0x52): undefined reference to `_stext'
m68k-linux-ld: kernel/kallsyms.o: in function `is_ksym_addr':
kallsyms.c:(.text+0x31c): undefined reference to `_stext'
m68k-linux-ld: kernel/crash_core.o: in function `crash_save_vmcoreinfo_init':
crash_core.c:(.init.text+0x4d4): undefined reference to `_stext'
m68k-linux-ld: crash_core.c:(.init.text+0x4bc): undefined reference to `kernel_pg_dir'
m68k-linux-ld: mm/page_alloc.o: in function `mem_init_print_info':
page_alloc.c:(.init.text+0xff8): undefined reference to `_stext'
m68k-linux-ld: page_alloc.c:(.init.text+0x1050): undefined reference to `_stext'
m68k-linux-ld: mm/init-mm.o:(.data+0x18): undefined reference to `kernel_pg_dir'
m68k-linux-ld: mm/usercopy.o: in function `__check_object_size':
usercopy.c:(.text+0x15a): undefined reference to `_stext'

Bisect points to this patch (or its equivalent in next-20220919).

Guenter

---
# bad: [4c9ca5b1597e3222177ba2a94658f78fa5ef4f58] Add linux-next specific files for 20220919
# good: [521a547ced6477c54b4b0cc206000406c221b4d6] Linux 6.0-rc6
git bisect start 'HEAD' 'v6.0-rc6'
# bad: [8b4141305a585c4cb1147dcc164059dc3b5489e2] Merge branch 'drm-next' of git://git.freedesktop.org/git/drm/drm.git
git bisect bad 8b4141305a585c4cb1147dcc164059dc3b5489e2
# bad: [03e33baab7f2c3459bd268639af383cafe0c0a4b] Merge branch 'docs-next' of git://git.lwn.net/linux.git
git bisect bad 03e33baab7f2c3459bd268639af383cafe0c0a4b
# bad: [c1a464c761e4098899873c472b3756f557a3b73c] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
git bisect bad c1a464c761e4098899873c472b3756f557a3b73c
# bad: [59d922adf1c023a84bd4dd4fad0442221fd6347f] Merge branch 'for-next/core' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
git bisect bad 59d922adf1c023a84bd4dd4fad0442221fd6347f
# good: [166f57a723e13d816b09b2f27433f2c8ba2f06fe] Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git
git bisect good 166f57a723e13d816b09b2f27433f2c8ba2f06fe
# bad: [aaa38e8ca1345b2369051a6213f706d5107a20ba] Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git
git bisect bad aaa38e8ca1345b2369051a6213f706d5107a20ba
# good: [1081fb0f6d6e68186e1088db33396b11770a0710] perf vendor events arm64: Move REMOTE_ACCESS to "memory" category
git bisect good 1081fb0f6d6e68186e1088db33396b11770a0710
# bad: [4aaa1766cf8d19becdade98bff3960c6583b8d09] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git
git bisect bad 4aaa1766cf8d19becdade98bff3960c6583b8d09
# good: [a521c97e2a63490c238865763fc86942dce8d6bb] kbuild: rewrite check-local-export in sh/awk
git bisect good a521c97e2a63490c238865763fc86942dce8d6bb
# bad: [6676e2cdd7c339dc40331faccbaac1112d2c1d78] kbuild: use obj-y instead extra-y for objects placed at the head
git bisect bad 6676e2cdd7c339dc40331faccbaac1112d2c1d78
# good: [10d1d4b75525f3172c6930fb20445f669762ea95] kbuild: move core-y and drivers-y to ./Kbuild
git bisect good 10d1d4b75525f3172c6930fb20445f669762ea95
# good: [b8d366ae69fe633e697776b839ac52d3eecf07d3] kbuild: move vmlinux.o rule to the top Makefile
git bisect good b8d366ae69fe633e697776b839ac52d3eecf07d3
# good: [165b718fdd8c5a9165b4485019729c0cd8728120] kbuild: unify two modpost invocations
git bisect good 165b718fdd8c5a9165b4485019729c0cd8728120
# first bad commit: [6676e2cdd7c339dc40331faccbaac1112d2c1d78] kbuild: use obj-y instead extra-y for objects placed at the head

  parent reply	other threads:[~2022-09-19 22:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06  6:13 [PATCH v2 0/8] kbuild: various cleanups Masahiro Yamada
2022-09-06  6:13 ` [PATCH v2 1/8] kbuild: fix and refactor single target build Masahiro Yamada
2022-09-06  6:13 ` [PATCH v2 2/8] kbuild: rename modules.order in sub-directories to .modules.order Masahiro Yamada
2022-09-06  6:13 ` [PATCH v2 3/8] kbuild: move core-y and drivers-y to ./Kbuild Masahiro Yamada
2022-09-21  4:39   ` Guenter Roeck
     [not found]     ` <CGME20220922121655eucas1p11822db5dbd1455bcbdba901f543b8e6b@eucas1p1.samsung.com>
2022-09-22 12:16       ` Marek Szyprowski
     [not found]         ` <CGME20220923113907eucas1p2b33fa5cf73646401089f96a69cf9b745@eucas1p2.samsung.com>
2022-09-23 11:39           ` Marek Szyprowski
2022-09-23 11:41             ` Masahiro Yamada
2022-09-23 12:09             ` Masahiro Yamada
2022-09-06  6:13 ` [PATCH v2 4/8] kbuild: move .vmlinux.objs rule to Makefile.modpost Masahiro Yamada
2022-09-06  6:13 ` [PATCH v2 5/8] kbuild: move vmlinux.o rule to the top Makefile Masahiro Yamada
2022-09-06  6:13 ` [PATCH v2 6/8] kbuild: unify two modpost invocations Masahiro Yamada
2022-09-06  6:13 ` [PATCH v2 7/8] kbuild: use obj-y instead extra-y for objects placed at the head Masahiro Yamada
2022-09-08  7:15   ` Masahiro Yamada
2022-09-19  8:10   ` Geert Uytterhoeven
2022-09-19 12:17     ` Masahiro Yamada
2022-09-19 12:28       ` Geert Uytterhoeven
2022-09-19 22:50   ` Guenter Roeck [this message]
2022-09-20  6:56     ` Geert Uytterhoeven
2022-09-20 13:33       ` Guenter Roeck
2022-09-06  6:13 ` [PATCH v2 8/8] kbuild: remove head-y syntax Masahiro Yamada
2022-09-06  7:59   ` Arnd Bergmann
2022-09-06  8:16     ` Ard Biesheuvel
2022-09-06  9:08     ` Masahiro Yamada
2022-09-07 20:15 ` [PATCH v2 0/8] kbuild: various cleanups Nicolas Schier
2022-09-07 20:18   ` Nicolas Schier
2022-09-08  2:00     ` Masahiro Yamada
2022-09-24 18:05 ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220919225053.GA769506@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).