1. 06 Jun, 2020 28 commits
  2. 03 Jun, 2020 6 commits
    • Masahiro Yamada's avatar
      modpost: load KBUILD_EXTRA_SYMBOLS files in order · 2beee868
      Masahiro Yamada authored
      Currently, modpost reads extra symbol dump files in the reverse order.
      If '-e foo -e bar' is given, modpost reads bar, foo, in this order.
      
      This is probably not a big deal, but there is no good reason to reverse
      the order. Read files in the given order.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      2beee868
    • Masahiro Yamada's avatar
      modpost: pass -N option only for modules modpost · 4e5ab74c
      Masahiro Yamada authored
      The built-in only code is not required to have MODULE_IMPORT_NS() to
      use symbols. So, the namespace is not checked for vmlinux(.o).
      
      Do not pass the meaningless -N option to the first pass of modpost.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      4e5ab74c
    • Masahiro Yamada's avatar
      modpost: move -T option close to the modpost command · 89d61176
      Masahiro Yamada authored
      The '-T -' option reads the file list from stdin.
      
      It is clearer to put it close to the piped command.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      89d61176
    • Masahiro Yamada's avatar
      modpost: fix -i (--ignore-errors) MAKEFLAGS detection · 91e6ee58
      Masahiro Yamada authored
      $(filter -i,$(MAKEFLAGS)) works only in limited use-cases.
      
      The representation of $(MAKEFLAGS) depends on various factors:
        - GNU Make version (version 3.8x or version 4.x)
        - The presence of other flags like -j
      
      In my experiments, $(MAKEFLAGS) is expanded as follows:
      
        * GNU Make 3.8x:
      
          * without -j option:
            --no-print-directory -Rri
      
          * with -j option:
            --no-print-directory -Rr --jobserver-fds=3,4 -j -i
      
        * GNU Make 4.x:
      
          * without -j option:
            irR --no-print-directory
      
          * with -j option:
            irR -j --jobserver-fds=3,4 --no-print-directory
      
      For GNU Make 4.x, the flags are grouped as 'irR', which does not work.
      
      For the single thread build with GNU Make 3.8x, the flags are grouped
      as '-Rri', which does not work either.
      
      To make it work for all cases, do likewise as commit 6f0fa58e
      ("kbuild: simplify silent build (-s) detection").
      
      BTW, since commit ff9b45c5 ("kbuild: modpost: read modules.order
      instead of $(MODVERDIR)/*.mod"), you also need to pass -k option to
      build final *.ko files. 'make -i -k' ignores compile errors in modules,
      and build as many remaining *.ko as possible.
      
      Please note this feature is kind of dangerous if other modules depend
      on the broken module because the generated modules will lack the correct
      module dependency or CRC. Honestly, I am not a big fan of it, but I am
      keeping this feature.
      
      Fixes: eed380f3 ("modpost: Optionally ignore secondary errors seen if a single module build fails")
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      91e6ee58
    • Masahiro Yamada's avatar
      kbuild: update modules.order only when contained modules are updated · b2c88554
      Masahiro Yamada authored
      Make modules.order depend on $(obj-m), and use if_changed to build it.
      This will avoid unneeded update of modules.order, which will be useful
      to optimize the modpost stage.
      
      Currently, the second pass of modpost is always invoked. By checking the
      timestamp of modules.order, we can avoid the unneeded modpost.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      b2c88554
    • Masahiro Yamada's avatar
      kbuild: refactor KBUILD_VMLINUX_{OBJS,LIBS} calculation · f0d50ca0
      Masahiro Yamada authored
      Do not overwrite core-y or drivers-y. Remove libs-y1 and libs-y2.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      f0d50ca0
  3. 01 Jun, 2020 6 commits