• Masahiro Yamada's avatar
    kbuild: create *.mod with full directory path and remove MODVERDIR · b7dca6dd
    Masahiro Yamada authored
    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 551559e1 ("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
    
    I...
    b7dca6dd
.gitignore 1.63 KB