Skip to content

Commit cfa0ab3

Browse files
npigginkardebayan
authored andcommitted
kbuild: rename built-in.o to built-in.a
Incremental linking is gone, so rename built-in.o to built-in.a, which is the usual extension for archive files. This patch does two things, first is a simple search/replace: git grep -l 'built-in\.o' | xargs sed -i 's/built-in\.o/built-in\.a/g' The second is to invert nesting of nested text manipulations to avoid filtering built-in.a out from libs-y2: -libs-y2 := $(filter-out %.a, $(patsubst %/, %/built-in.a, $(libs-y))) +libs-y2 := $(patsubst %/, %/built-in.a, $(filter-out %.a, $(libs-y))) Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent ca92f89 commit cfa0ab3

26 files changed

Lines changed: 56 additions & 56 deletions

File tree

Documentation/kbuild/makefiles.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ more details, with real examples.
153153
configuration.
154154

155155
Kbuild compiles all the $(obj-y) files. It then calls
156-
"$(LD) -r" to merge these files into one built-in.o file.
157-
built-in.o is later linked into vmlinux by the parent Makefile.
156+
"$(LD) -r" to merge these files into one built-in.a file.
157+
built-in.a is later linked into vmlinux by the parent Makefile.
158158

159159
The order of files in $(obj-y) is significant. Duplicates in
160160
the lists are allowed: the first instance will be linked into
161-
built-in.o and succeeding instances will be ignored.
161+
built-in.a and succeeding instances will be ignored.
162162

163163
Link order is significant, because certain functions
164164
(module_init() / __initcall) will be called during boot in the
@@ -222,7 +222,7 @@ more details, with real examples.
222222
Note: Of course, when you are building objects into the kernel,
223223
the syntax above will also work. So, if you have CONFIG_EXT2_FS=y,
224224
kbuild will build an ext2.o file for you out of the individual
225-
parts and then link this into built-in.o, as you would expect.
225+
parts and then link this into built-in.a, as you would expect.
226226

227227
--- 3.4 Objects which export symbols
228228

@@ -232,7 +232,7 @@ more details, with real examples.
232232
--- 3.5 Library file goals - lib-y
233233

234234
Objects listed with obj-* are used for modules, or
235-
combined in a built-in.o for that specific directory.
235+
combined in a built-in.a for that specific directory.
236236
There is also the possibility to list objects that will
237237
be included in a library, lib.a.
238238
All objects listed with lib-y are combined in a single
@@ -244,7 +244,7 @@ more details, with real examples.
244244

245245
Note that the same kbuild makefile may list files to be built-in
246246
and to be part of a library. Therefore the same directory
247-
may contain both a built-in.o and a lib.a file.
247+
may contain both a built-in.a and a lib.a file.
248248

249249
Example:
250250
#arch/x86/lib/Makefile
@@ -986,7 +986,7 @@ When kbuild executes, the following steps are followed (roughly):
986986

987987
$(head-y) lists objects to be linked first in vmlinux.
988988
$(libs-y) lists directories where a lib.a archive can be located.
989-
The rest list directories where a built-in.o object file can be
989+
The rest list directories where a built-in.a object file can be
990990
located.
991991

992992
$(init-y) objects will be located after $(head-y).
@@ -1071,7 +1071,7 @@ When kbuild executes, the following steps are followed (roughly):
10711071
extra-y := head.o init_task.o
10721072

10731073
In this example, extra-y is used to list object files that
1074-
shall be built, but shall not be linked as part of built-in.o.
1074+
shall be built, but shall not be linked as part of built-in.a.
10751075

10761076

10771077
--- 6.7 Commands useful for building a boot image

Documentation/process/changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Binutils
7676
--------
7777

7878
The build system has, as of 4.13, switched to using thin archives (`ar T`)
79-
rather than incremental linking (`ld -r`) for built-in.o intermediate steps.
79+
rather than incremental linking (`ld -r`) for built-in.a intermediate steps.
8080
This requires binutils 2.20 or newer.
8181

8282
Perl

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ unexport GREP_OPTIONS
3535
# Most importantly: sub-Makefiles should only ever modify files in
3636
# their own directory. If in some directory we have a dependency on
3737
# a file in another dir (which doesn't happen often, but it's often
38-
# unavoidable when linking the built-in.o targets which finally
38+
# unavoidable when linking the built-in.a targets which finally
3939
# turn into vmlinux), we will call a sub make in that other dir, and
4040
# after that we are sure that everything which is in that other dir
4141
# is now up to date.
@@ -1228,13 +1228,13 @@ vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
12281228
vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \
12291229
$(init-) $(core-) $(drivers-) $(net-) $(libs-) $(virt-))))
12301230

1231-
init-y := $(patsubst %/, %/built-in.o, $(init-y))
1232-
core-y := $(patsubst %/, %/built-in.o, $(core-y))
1233-
drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y))
1234-
net-y := $(patsubst %/, %/built-in.o, $(net-y))
1231+
init-y := $(patsubst %/, %/built-in.a, $(init-y))
1232+
core-y := $(patsubst %/, %/built-in.a, $(core-y))
1233+
drivers-y := $(patsubst %/, %/built-in.a, $(drivers-y))
1234+
net-y := $(patsubst %/, %/built-in.a, $(net-y))
12351235
libs-y1 := $(patsubst %/, %/lib.a, $(libs-y))
1236-
libs-y2 := $(filter-out %.a, $(patsubst %/, %/built-in.o, $(libs-y)))
1237-
virt-y := $(patsubst %/, %/built-in.o, $(virt-y))
1236+
libs-y2 := $(patsubst %/, %/built-in.a, $(filter-out %.a, $(libs-y)))
1237+
virt-y := $(patsubst %/, %/built-in.a, $(virt-y))
12381238

12391239
# Externally visible symbols (used by link-vmlinux.sh)
12401240
export KBUILD_VMLINUX_INIT := $(head-y) $(init-y)

arch/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ config THIN_ARCHIVES
611611
def_bool y
612612
help
613613
Select this if the architecture wants to use thin archives
614-
instead of ld -r to create the built-in.o files.
614+
instead of ld -r to create the built-in.a files.
615615

616616
config LTO
617617
def_bool n

arch/blackfin/kernel/bfin_ksyms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ EXPORT_SYMBOL(memchr);
3636
/*
3737
* Because string functions are both inline and exported functions and
3838
* folder arch/blackfin/lib is configured as a library path in Makefile,
39-
* symbols exported in folder lib is not linked into built-in.o but
39+
* symbols exported in folder lib is not linked into built-in.a but
4040
* inlined only. In order to export string symbols to kernel module
4141
* properly, they should be exported here.
4242
*/

arch/mips/boot/dts/brcm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dtb-$(CONFIG_DT_NONE) += \
3636

3737
obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
3838

39-
# Force kbuild to make empty built-in.o if necessary
39+
# Force kbuild to make empty built-in.a if necessary
4040
obj- += dummy.o
4141

4242
always := $(dtb-y)

arch/mips/boot/dts/cavium-octeon/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ dtb-$(CONFIG_CAVIUM_OCTEON_SOC) += octeon_3xxx.dtb octeon_68xx.dtb
33

44
obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
55

6-
# Force kbuild to make empty built-in.o if necessary
6+
# Force kbuild to make empty built-in.a if necessary
77
obj- += dummy.o
88

99
always := $(dtb-y)

arch/mips/boot/dts/img/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dtb-$(CONFIG_FIT_IMAGE_FDT_BOSTON) += boston.dtb
44
dtb-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb
55
obj-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb.o
66

7-
# Force kbuild to make empty built-in.o if necessary
7+
# Force kbuild to make empty built-in.a if necessary
88
obj- += dummy.o
99

1010
always := $(dtb-y)

arch/mips/boot/dts/ingenic/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dtb-$(CONFIG_JZ4780_CI20) += ci20.dtb
44

55
obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
66

7-
# Force kbuild to make empty built-in.o if necessary
7+
# Force kbuild to make empty built-in.a if necessary
88
obj- += dummy.o
99

1010
always := $(dtb-y)

arch/mips/boot/dts/lantiq/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ dtb-$(CONFIG_DT_EASY50712) += easy50712.dtb
33

44
obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
55

6-
# Force kbuild to make empty built-in.o if necessary
6+
# Force kbuild to make empty built-in.a if necessary
77
obj- += dummy.o
88

99
always := $(dtb-y)

0 commit comments

Comments
 (0)