1. 21 12月, 2020 1 次提交
    • M
      modpost: rename merror() to error() · bc72d723
      Masahiro Yamada 提交于
      The log function names, warn(), merror(), fatal() are inconsistent.
      
      Commit 2a116659 ("kbuild: distinguish between errors and warnings
      in modpost") intentionally chose merror() to avoid the conflict with
      the library function error(). See man page of error(3).
      
      But, we are already causing the conflict with warn() because it is also
      a library function. See man page of warn(3). err() would be a problem
      for the same reason.
      
      The common technique to work around name conflicts is to use macros.
      For example:
      
          /* in a header */
          #define error(fmt, ...)  __error(fmt, ##__VA_ARGS__)
          #define warn(fmt, ...)   __warn(fmt, ##__VA_ARGS__)
      
          /* function definition */
          void __error(const char *fmt, ...)
          {
                  <our implementation>
          }
      
          void __warn(const char *fmt, ...)
          {
                  <our implementation>
          }
      
      In this way, we can implement our own warn() and error(), still we can
      include <error.h> and <err.h> with no problem.
      
      And, commit 93c95e52 ("modpost: rework and consolidate logging
      interface") already did that.
      
      Since the log functions are all macros, we can use error() without
      causing "conflicting types" errors.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      bc72d723
  2. 08 12月, 2020 2 次提交
  3. 06 12月, 2020 1 次提交
    • M
      kbuild: avoid split lines in .mod files · 7d32358b
      Masahiro Yamada 提交于
      "xargs echo" is not a safe way to remove line breaks because the input
      may exceed the command line limit and xargs may break it up into
      multiple invocations of echo. This should never happen because
      scripts/gen_autoksyms.sh expects all undefined symbols are placed in
      the second line of .mod files.
      
      One possible way is to replace "xargs echo" with
      "sed ':x;N;$!bx;s/\n/ /g'" or something, but I rewrote the code by
      using awk because it is more readable.
      
      This issue was reported by Sami Tolvanen; in his Clang LTO patch set,
      $(multi-used-m) is no longer an ELF object, but a thin archive that
      contains LLVM bitcode files. llvm-nm prints out symbols for each
      archive member separately, which results a lot of dupications, in some
      places, beyond the system-defined limit.
      
      This problem must be fixed irrespective of LTO, and we must ensure
      zero possibility of having this issue.
      
      Link: https://lkml.org/lkml/2020/12/1/1658Reported-by: NSami Tolvanen <samitolvanen@google.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: NSami Tolvanen <samitolvanen@google.com>
      7d32358b
  4. 01 12月, 2020 1 次提交
  5. 25 11月, 2020 1 次提交
    • A
      Makefile.extrawarn: move -Wcast-align to W=3 · 095fbca0
      Arnd Bergmann 提交于
      This warning behaves differently depending on the architecture
      and compiler. Using x86 gcc, we get no output at all because
      gcc knows the architecture can handle unaligned accesses.
      
      Using x86 clang, or gcc on an architecture that needs to
      manually deal with unaligned accesses, the build log is
      completely flooded with these warnings, as they are commonly
      invoked by inline functions of networking headers, e.g.
      
      include/linux/skbuff.h:1426:26: warning: cast increases required alignment of target type [-Wcast-align]
      
      The compiler is correct to point this out, as we are dealing
      with undefined behavior that does cause problems in practice,
      but there is also no good way to rewrite the code in commonly
      included headers to a safer method.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      095fbca0
  6. 02 11月, 2020 3 次提交
  7. 30 10月, 2020 13 次提交
  8. 29 10月, 2020 4 次提交
  9. 26 10月, 2020 2 次提交
  10. 22 10月, 2020 1 次提交
  11. 20 10月, 2020 3 次提交
  12. 18 10月, 2020 1 次提交
  13. 17 10月, 2020 7 次提交