Masahiro Yamada
b7dca6dd1e
kbuild: create *.mod with full directory path and remove MODVERDIR
...
While descending directories, Kbuild produces objects for modules,
but do not link final *.ko files; it is done in the modpost.
To keep track of modules, Kbuild creates a *.mod file in $(MODVERDIR)
for every module it is building. Some post-processing steps read the
necessary information from *.mod files. This avoids descending into
directories again. This mechanism was introduced in 2003 or so.
Later, commit 551559e13a ("kbuild: implement modules.order") added
modules.order. So, we can simply read it out to know all the modules
with directory paths. This is easier than parsing the first line of
*.mod files.
$(MODVERDIR) has a flat directory structure, that is, *.mod files
are named only with base names. This is based on the assumption that
the module name is unique across the tree. This assumption is really
fragile.
Stephen Rothwell reported a race condition caused by a module name
conflict:
https://lkml.org/lkml/2019/5/13/991
In parallel building, two different threads could write to the same
$(MODVERDIR)/*.mod simultaneously.
Non-unique module names are the source of all kind of troubles, hence
commit 3a48a91901 ("kbuild: check uniqueness of module names")
introduced a new checker script.
However, it is still fragile in the build system point of view because
this race happens before scripts/modules-check.sh is invoked. If it
happens again, the modpost will emit unclear error messages.
To fix this issue completely, create *.mod with full directory path
so that two threads never attempt to write to the same file.
$(MODVERDIR) is no longer needed.
Since modules with directory paths are listed in modules.order, Kbuild
is still able to find *.mod files without additional descending.
I also killed cmd_secanalysis; scripts/mod/sumversion.c computes MD4 hash
for modules with MODULE_VERSION(). When CONFIG_DEBUG_SECTION_MISMATCH=y,
it occurs not only in the modpost stage, but also during directory
descending, where sumversion.c may parse stale *.mod files. It would emit
'No such file or directory' warning when an object consisting a module is
renamed, or when a single-obj module is turned into a multi-obj module or
vice versa.
Signed-off-by: Masahiro Yamada <[email protected] >
Acked-by: Nicolas Pitre <[email protected] >
2019-07-18 02:19:31 +09:00
..
ABI
Merge branch 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
2019-07-15 21:10:39 -07:00
accelerators
docs: mark orphan documents as such
2019-06-08 13:42:11 -06:00
accounting
psi: introduce psi monitor
2019-05-14 19:52:48 -07:00
acpi /dsd
docs: fix broken documentation links
2019-06-08 13:42:13 -06:00
admin-guide
for-linus-20190715
2019-07-15 21:20:52 -07:00
aoe
docs: aoe: convert docs to ReST and rename to *.rst
2019-06-14 14:20:22 -06:00
arm
docs: mark orphan documents as such
2019-06-08 13:42:11 -06:00
arm64
ARM:
2019-07-12 15:35:14 -07:00
auxdisplay
backlight
block
block: Remove unused definitions
2019-07-10 14:18:01 -06:00
blockdev
bpf
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
2019-07-11 10:55:49 -07:00
bus-devices
cdrom
docs: ide: convert docs to ReST and rename to *.rst
2019-06-14 14:21:18 -06:00
cgroup-v1
for-5.3/block-20190708
2019-07-09 10:45:06 -07:00
cma
connector
console
core-api
asm-generic, x86: add bitops instrumentation for KASAN
2019-07-12 11:05:42 -07:00
cpu-freq
docs: power: convert docs to ReST and rename to *.rst
2019-06-14 16:08:36 -05:00
crypto
crypto: doc - Fix formatting of new crypto engine content
2019-07-03 22:13:12 +08:00
dev-tools
docs: kmemleak: add more documentation details
2019-07-12 11:05:42 -07:00
device-mapper
- Add encrypted byte-offset initialization vector (eboiv) to DM crypt.
2019-07-13 15:24:31 -07:00
devicetree
Merge branch 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
2019-07-15 21:10:39 -07:00
doc-guide
Doc : doc-guide : Fix a typo
2019-06-28 09:04:14 -06:00
driver-api
pci-v5.3-changes
2019-07-15 20:44:49 -07:00
driver-model
docs: driver-model: convert docs to ReST and rename to *.rst
2019-06-21 15:47:26 +02:00
early-userspace
EDID
docs: EDID/HOWTO.txt: convert it and rename to howto.rst
2019-06-14 14:32:29 -06:00
fault-injection
It's been a relatively busy cycle for docs:
2019-07-09 12:34:26 -07:00
fb
drm main pull request for v5.3-rc1 (sans mm changes)
2019-07-15 19:04:27 -07:00
features
Documentation/stackprotector: powerpc supports stack protector
2019-06-14 14:44:43 -06:00
filesystems
f2fs-for-5.3-rc1
2019-07-12 17:28:24 -07:00
firmware-guide
It's been a relatively busy cycle for docs:
2019-07-09 12:34:26 -07:00
firmware_class
fpga
docs: fpga: convert docs to ReST and rename to *.rst
2019-06-14 14:21:15 -06:00
gpio
gpu
drm main pull request for v5.3-rc1 (sans mm changes)
2019-07-15 19:04:27 -07:00
hid
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
2019-07-11 15:32:11 -07:00
hwmon
Driver Core and debugfs changes for 5.3-rc1
2019-07-12 12:24:03 -07:00
i2c
Merge branch 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
2019-07-15 21:10:39 -07:00
ia64
ide
docs: ide: convert docs to ReST and rename to *.rst
2019-06-14 14:21:18 -06:00
iio
docs: iio: convert to ReST
2019-06-22 10:41:57 +01:00
infiniband
docs: infiniband: add it to the driver-api bookset
2019-07-08 14:22:56 -03:00
input
docs: hid: convert to ReST
2019-07-02 10:19:34 +02:00
interconnect
docs: mark orphan documents as such
2019-06-08 13:42:11 -06:00
ioctl
platform/x86: ISST: Update ioctl-number.txt for Intel Speed Select interface
2019-07-02 18:41:16 +03:00
isdn
isdn: remove isdn4linux
2019-05-31 11:13:10 +02:00
kbuild
kbuild: get rid of misleading $(AS) from documents
2019-07-17 22:37:51 +09:00
kdump
docs: kdump: convert docs to ReST and rename to *.rst
2019-06-14 14:21:24 -06:00
kernel-hacking
docs: stop suggesting strlcpy
2019-06-20 14:08:49 -06:00
laptops
It's been a relatively busy cycle for docs:
2019-07-09 12:34:26 -07:00
leds
docs: leds: convert to ReST
2019-06-28 20:57:31 +02:00
lightnvm
livepatch
docs/livepatch: Unify style of livepatch documentation in the ReST format
2019-05-07 16:06:28 -06:00
locking
locking/lockdep: Add explanation to lock usage rules in lockdep design doc
2019-06-03 11:55:48 +02:00
m68k
maintainer
docs: Add a document on repository management
2019-06-18 09:33:16 -06:00
md
media
media: doc-rst: Fix typos
2019-06-27 07:35:47 -04:00
memory-devices
mic
docs: mic: convert docs to ReST and rename to *.rst
2019-06-14 14:23:26 -06:00
mips
misc-devices
docs: misc-devices: convert files without extension to ReST
2019-07-03 21:09:41 +02:00
mmc
mtd
namespaces
netlabel
docs: netlabel: convert docs to ReST and rename to *.rst
2019-06-14 14:23:30 -06:00
networking
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
2019-07-11 10:55:49 -07:00
nfc
nios2
nvdimm
Documentation: nvdimm: Fix typo
2019-06-07 11:39:04 -06:00
nvmem
openrisc
parisc
PCI
Documentation: PCI: convert endpoint/pci-test-howto.txt to reST
2019-05-30 17:54:34 -05:00
pcmcia
docs: pcmcia: convert docs to ReST and rename to *.rst
2019-06-14 14:23:35 -06:00
perf
phy
power
power supply and reset changes for the v5.3 series
2019-07-15 21:06:15 -07:00
powerpc
powerpc updates for 5.3
2019-07-13 16:08:36 -07:00
process
pci-v5.3-changes
2019-07-15 20:44:49 -07:00
pti
rapidio
RCU
It's been a relatively busy cycle for docs:
2019-07-09 12:34:26 -07:00
riscv
docs: riscv: convert docs to ReST and rename to *.rst
2019-06-14 14:31:32 -06:00
s390
docs: s390: s390dbf: typos and formatting, update crash command
2019-07-05 13:42:24 +02:00
scheduler
pci-v5.3-changes
2019-07-15 20:44:49 -07:00
scsi
scsi: ufs: Documentation: Announce ufs-tool v1.0
2019-06-26 22:47:51 -04:00
security
Revert "Merge tag 'keys-acl-20190703' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs"
2019-07-10 18:43:43 -07:00
serial
sh
sound
sparc
docs: sparc: convert to ReST
2019-05-08 17:13:35 -07:00
sphinx
docs: automarkup.py: ignore exceptions when seeking for xrefs
2019-07-08 14:35:47 -06:00
sphinx-static
spi
sysctl
It's been a relatively busy cycle for docs:
2019-07-09 12:34:26 -07:00
target
docs: target: convert docs to ReST and rename to *.rst
2019-06-14 14:31:36 -06:00
thermal
timers
docs: timers: convert docs to ReST and rename to *.rst
2019-06-14 14:31:48 -06:00
trace
pci-v5.3-changes
2019-07-15 20:44:49 -07:00
translations
pci-v5.3-changes
2019-07-15 20:44:49 -07:00
usb
docs: usb: rename files to .rst and add them to drivers-api
2019-06-20 14:28:36 +02:00
userspace-api
Documentation: Add section about CPU vulnerabilities for Spectre
2019-06-26 11:42:41 -06:00
virtual
ARM:
2019-07-12 15:35:14 -07:00
vm
HMM patches for 5.3
2019-07-14 19:42:11 -07:00
w1
watchdog
docs: watchdog: convert docs to ReST and rename to *.rst
2019-06-14 14:32:05 -06:00
wimax
x86
It's been a relatively busy cycle for docs:
2019-07-09 12:34:26 -07:00
xilinx
docs: xilinx: convert eemi.txt to eemi.rst
2019-06-14 14:32:10 -06:00
xtensa
.gitignore
atomic_bitops.txt
atomic_t.txt
Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2019-07-08 16:12:03 -07:00
bt8xxgpio.txt
btmrvl.txt
bus-virt-phys-mapping.txt
Changes
clearing-warn-once.txt
A reasonably busy cycle for docs, including:
2019-05-08 12:42:50 -07:00
CodingStyle
conf.py
Disable Sphinx SmartyPants in HTML output
2019-06-30 15:30:34 -06:00
cpu-load.txt
cputopology.txt
topology: Create core_cpus and die_cpus sysfs attributes
2019-05-23 10:08:34 +02:00
crc32.txt
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt
digsig.txt
DMA-API-HOWTO.txt
DMA mapping updates for 5.2
2019-05-09 08:40:55 -07:00
DMA-API.txt
Documentation: DMA-API: fix a function name of max_mapping_size
2019-06-07 11:10:33 -06:00
DMA-attributes.txt
DMA-ISA-LPC.txt
docutils.conf
doc-rst: Add missing newline at end of file
2019-06-20 14:16:56 -06:00
dontdiff
kbuild: create *.mod with full directory path and remove MODVERDIR
2019-07-18 02:19:31 +09:00
efi-stub.txt
eisa.txt
docs: driver-model: convert docs to ReST and rename to *.rst
2019-06-21 15:47:26 +02:00
futex-requeue-pi.txt
gcc-plugins.txt
highuid.txt
hw_random.txt
hwspinlock.txt
index.rst
pci-v5.3-changes
2019-07-15 20:44:49 -07:00
Intel-IOMMU.txt
intel_txt.txt
io-mapping.txt
io_ordering.txt
iostats.txt
block: document iostat changes for disk busy time accounting
2019-06-14 14:46:43 -06:00
IPMI.txt
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
irqflags-tracing.txt
isa.txt
isapnp.txt
Kconfig
docs: Kbuild/Makefile: allow check for missing docs at build time
2019-06-07 11:33:16 -06:00
kernel-per-CPU-kthreads.txt
docs: watchdog: convert docs to ReST and rename to *.rst
2019-06-14 14:32:05 -06:00
kobject.txt
kprobes.txt
Merge branch 'parisc-5.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
2019-05-07 19:34:17 -07:00
kref.txt
ldm.txt
lockup-watchdogs.txt
logo.gif
logo.txt
lsm.txt
lzo.txt
mailbox.txt
Makefile
docs: Kbuild/Makefile: allow check for missing docs at build time
2019-06-07 11:33:16 -06:00
memory-barriers.txt
It's been a relatively busy cycle for docs:
2019-07-09 12:34:26 -07:00
men-chameleon-bus.txt
nommu-mmap.txt
ntb.txt
numastat.txt
packing.txt
padata.txt
parport-lowlevel.txt
percpu-rw-semaphore.txt
phy.txt
pi-futex.txt
pnp.txt
preempt-locking.txt
pwm.txt
pwm: Add power management descriptions
2019-06-26 11:39:11 +02:00
rbtree.txt
remoteproc.txt
rfkill.txt
robust-futex-ABI.txt
robust-futexes.txt
rpmsg.txt
rtc.txt
SAK.txt
sgi-ioc4.txt
siphash.txt
SM501.txt
smsc_ece1099.txt
speculation.txt
static-keys.txt
SubmittingPatches
svga.txt
switchtec.txt
sync_file.txt
tee.txt
Documentation: tee: Grammar s/the its/its/
2019-06-07 11:23:38 -06:00
this_cpu_ops.txt
unaligned-memory-access.txt
vfio-mediated-device.txt
vfio.txt
video-output.txt
xillybus.txt
xz.txt
zorro.txt