Commit Graph

1385 Commits

Author SHA1 Message Date
Greg Kroah-Hartman 60771fc402 Linux 4.9.166 2019-03-27 14:13:05 +09:00
Greg Kroah-Hartman 1c453afcda Linux 4.9.165 2019-03-23 13:19:54 +01:00
Greg Kroah-Hartman f5fd34f057 Linux 4.9.164 2019-03-19 13:14:12 +01:00
Greg Kroah-Hartman b834331609 Linux 4.9.163 2019-03-13 14:05:02 -07:00
Greg Kroah-Hartman f422a02f86 Linux 4.9.162 2019-03-05 17:57:07 +01:00
Greg Kroah-Hartman 5507839a72 Linux 4.9.161 2019-02-27 10:07:03 +01:00
Masahiro Yamada 8ff3c2ecc1 kbuild: consolidate Clang compiler flags
commit 238bcbc4e0 upstream.

Collect basic Clang options such as --target, --prefix, --gcc-toolchain,
-no-integrated-as into a single variable CLANG_FLAGS so that it can be
easily reused in other parts of Makefile.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Acked-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-27 10:07:03 +01:00
Masahiro Yamada c95a870d1c kbuild: add -no-integrated-as Clang option unconditionally
commit dbe27a002e upstream.

We are still a way off the Clang's integrated assembler support for
the kernel. Hence, -no-integrated-as is mandatory to build the kernel
with Clang. If you had an ancient version of Clang that does not
recognize this option, you would not be able to compile the kernel
anyway.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-27 10:07:02 +01:00
Stefan Agner e1e7f343ea kbuild: set no-integrated-as before incl. arch Makefile
commit 0f0e8de334 upstream.

In order to make sure compiler flag detection for ARM works
correctly the no-integrated-as flags need to be set before
including the arch specific Makefile.

Fixes: cfe17c9bbe ("kbuild: move cc-option and cc-disable-warning after incl. arch Makefile")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[nc: Backport to 4.9; adjust context due to a previous backport]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-27 10:07:02 +01:00
Sodagudi Prasad 9362c0885a kbuild: clang: disable unused variable warnings only when constant
commit 0a5f417674 upstream.

Currently, GCC disables -Wunused-const-variable, but not
-Wunused-variable, so warns unused variables if they are
non-constant.

While, Clang does not warn unused variables at all regardless of
the const qualifier because -Wno-unused-const-variable is implied
by the stronger option -Wno-unused-variable.

Disable -Wunused-const-variable instead of -Wunused-variable so that
GCC and Clang work in the same way.

Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-27 10:07:02 +01:00
Nick Desaulniers b018806f8a kbuild: clang: remove crufty HOSTCFLAGS
commit df16aaac26 upstream.

When compiling with `make CC=clang HOSTCC=clang`, I was seeing warnings
that clang did not recognize -fno-delete-null-pointer-checks for HOSTCC
targets.  These were added in commit 61163efae0 ("kbuild: LLVMLinux:
Add Kbuild support for building kernel with Clang").

Clang does not support -fno-delete-null-pointer-checks, so adding it to
HOSTCFLAGS if HOSTCC is clang does not make sense.

It's not clear why the other warnings were disabled, and just for
HOSTCFLAGS, but I can remove them, add -Werror to HOSTCFLAGS and compile
with clang just fine.

Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[nc: Backport to 4.9; adjust context]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-27 10:07:02 +01:00
David Lin 3f46fe4a39 kbuild: clang: fix build failures with sparse check
commit bb3f38c3c5 upstream.

We should avoid using the space character when passing arguments to
clang, because static code analysis check tool such as sparse may
misinterpret the arguments followed by spaces as build targets hence
cause the build to fail.

Signed-off-by: David Lin <dtwlin@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[nc: Backport to 4.9; adjust context]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-27 10:07:02 +01:00
Masahiro Yamada b098b02285 kbuild: move cc-option and cc-disable-warning after incl. arch Makefile
commit cfe17c9bbe upstream.

Geert reported commit ae6b289a37 ("kbuild: Set KBUILD_CFLAGS before
incl. arch Makefile") broke cross-compilation using a cross-compiler
that supports less compiler options than the host compiler.

For example,

  cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"

This problem happens on architectures that setup CROSS_COMPILE in their
arch/*/Makefile.

Move the cc-option and cc-disable-warning back to the original position,
but keep the Clang target options untouched.

Fixes: ae6b289a37 ("kbuild: Set KBUILD_CFLAGS before incl. arch Makefile")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
[nc: Backport to 4.9; adjust context due to a previous backport]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-27 10:07:02 +01:00
Greg Kroah-Hartman badcc565e1 Linux 4.9.160 2019-02-23 09:05:59 +01:00
Greg Kroah-Hartman b9d7a53e4e Linux 4.9.159 2019-02-20 10:18:35 +01:00
Greg Kroah-Hartman 6ece8e403d Linux 4.9.158 2019-02-15 09:07:33 +01:00
Greg Kroah-Hartman b7ec3f9121 Linux 4.9.157 2019-02-15 08:07:39 +01:00
Greg Kroah-Hartman 8278355efb Linux 4.9.156 2019-02-12 19:45:02 +01:00
Greg Kroah-Hartman 6ebe34c1da Linux 4.9.155 2019-02-06 17:33:30 +01:00
Greg Kroah-Hartman a4d0a0910e Linux 4.9.154 2019-01-31 08:12:37 +01:00
Greg Kroah-Hartman 189b75ad3f Linux 4.9.153 2019-01-26 09:38:36 +01:00
Greg Kroah-Hartman ef50e3059a Linux 4.9.152 2019-01-23 08:10:57 +01:00
Greg Kroah-Hartman 008bfb9312 Linux 4.9.151 2019-01-16 22:12:33 +01:00
Greg Kroah-Hartman df6062688e Linux 4.9.150 2019-01-13 10:03:55 +01:00
Greg Kroah-Hartman 8a12358ba0 Linux 4.9.149 2019-01-09 16:16:45 +01:00
Greg Kroah-Hartman d99748864f Linux 4.9.148 2018-12-29 13:40:16 +01:00
Greg Kroah-Hartman bbfc30f29c Linux 4.9.147 2018-12-21 14:11:40 +01:00
Greg Kroah-Hartman 0cff89461d Linux 4.9.146 2018-12-17 09:38:35 +01:00
Greg Kroah-Hartman 9c2f007c3c Linux 4.9.145 2018-12-13 09:20:30 +01:00
Stefan Agner 4c219af48b kbuild: allow to use GCC toolchain not in Clang search path
(commit ef8c4ed9db upstream)

When using a GCC cross toolchain which is not in a compiled in
Clang search path, Clang reverts to the system assembler and
linker. This leads to assembler or linker errors, depending on
which tool is first used for a given architecture.

It seems that Clang is not searching $PATH for a matching
assembler or linker.

Make sure that Clang picks up the correct assembler or linker by
passing the cross compilers bin directory as search path.

This allows to use Clang provided by distributions with GCC
toolchains not in /usr/bin.

Link: https://github.com/ClangBuiltLinux/linux/issues/78
Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-and-tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[ND: adjusted to context, due to adjusting the context of my previous
backport of upstream's ae6b289a37]
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:20:30 +01:00
Greg Kroah-Hartman 1aa861ff23 Linux 4.9.144 2018-12-08 13:05:15 +01:00
Stephen Rothwell 5e2669c978 disable stringop truncation warnings for now
commit 217c3e0196 upstream.

They are too noisy

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-08 13:05:04 +01:00
Greg Kroah-Hartman b136f0e9e9 Linux 4.9.143 2018-12-05 19:42:42 +01:00
Chris Fries 740f140b5d kbuild: Set KBUILD_CFLAGS before incl. arch Makefile
(commit ae6b289a37 upstream)

Set the clang KBUILD_CFLAGS up before including arch/ Makefiles,
so that ld-options (etc.) can work correctly.

This fixes errors with clang such as ld-options trying to CC
against your host architecture, but LD trying to link against
your target architecture.

Signed-off-by: Chris Fries <cfries@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[ND: adjusted context due to upstream having removed code above where I
placed this block in this backport]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 19:42:42 +01:00
Greg Kroah-Hartman 68ae960f6d Linux 4.9.142 2018-12-01 09:44:27 +01:00
Greg Kroah-Hartman bb2d990b6f Linux 4.9.141 2018-11-27 16:09:42 +01:00
Greg Kroah-Hartman e186413178 Linux 4.9.140 2018-11-23 12:57:41 +01:00
Greg Kroah-Hartman 44caf8b346 Linux 4.9.139 2018-11-23 08:20:39 +01:00
Arnd Bergmann 86e514306b Kbuild: use -fshort-wchar globally
commit 8c97023cf0 upstream.

Commit 971a69db7d ("Xen: don't warn about 2-byte wchar_t in efi")
added the --no-wchar-size-warning to the Makefile to avoid this
harmless warning:

arm-linux-gnueabi-ld: warning: drivers/xen/efi.o uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail

Changing kbuild to use thin archives instead of recursive linking
unfortunately brings the same warning back during the final link.

The kernel does not use wchar_t string literals at this point, and
xen does not use wchar_t at all (only efi_char16_t), so the flag
has no effect, but as pointed out by Jan Beulich, adding a wchar_t
string literal would be bad here.

Since wchar_t is always defined as u16, independent of the toolchain
default, always passing -fshort-wchar is correct and lets us
remove the Xen specific hack along with fixing the warning.

Link: https://patchwork.kernel.org/patch/9275217/
Fixes: 971a69db7d ("Xen: don't warn about 2-byte wchar_t in efi")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23 08:20:37 +01:00
Matthias Kaehlcke ebcc69a97a kbuild: clang: Disable 'address-of-packed-member' warning
commit bfb38988c5 upstream.

clang generates plenty of these warnings in different parts of the code,
to an extent that the warnings are little more than noise. Disable the
'address-of-packed-member' warning.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23 08:20:36 +01:00
Matthias Kaehlcke 0605d5ebde kbuild: Add __cc-option macro
commit 9f3f1fd299 upstream.

cc-option uses KBUILD_CFLAGS and KBUILD_CPPFLAGS when it determines
whether an option is supported or not. This is fine for options used to
build the kernel itself, however some components like the x86 boot code
use a different set of flags.

Add the new macro __cc-option which is a more generic version of
cc-option with additional parameters. One parameter is the compiler
with which the check should be performed, the other the compiler options
to be used instead KBUILD_C*FLAGS.

Refactor cc-option and hostcc-option to use __cc-option and move
hostcc-option to scripts/Kbuild.include.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23 08:20:35 +01:00
Vinícius Tinti 85ab13ffcc kbuild: Add support to generate LLVM assembly files
commit 433db3e260 upstream.

Add rules to kbuild in order to generate LLVM assembly files with the .ll
extension when using clang.

  # from c code
  make CC=clang kernel/pid.ll

Signed-off-by: Vinícius Tinti <viniciustinti@gmail.com>
Signed-off-by: Behan Webster <behanw@converseincode.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23 08:20:35 +01:00
Behan Webster d438cec073 kbuild: use -Oz instead of -Os when using clang
commit 6748cb3c29 upstream.

This generates smaller resulting object code when compiled with clang.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23 08:20:35 +01:00
Masahiro Yamada c466d17e3a kbuild: drop -Wno-unknown-warning-option from clang options
commit a0ae981eba upstream.

Since commit c3f0d0bc5b ("kbuild, LLVMLinux: Add -Werror to
cc-option to support clang"), cc-option and friends work nicely
for clang.

However, -Wno-unknown-warning-option makes clang happy with any
unknown warning options even if -Werror is specified.

Once -Wno-unknown-warning-option is added, any succeeding call of
cc-disable-warning is evaluated positive, then unknown warning
options are accepted.  This should be dropped.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23 08:20:35 +01:00
Michael Davidson cd9a7644a3 kbuild: clang: add -no-integrated-as to KBUILD_[AC]FLAGS
commit a37c45cd82 upstream.

The Linux Kernel relies on GCC's acceptance of inline assembly as an
opaque object which will not have any validation performed on the content.
The current behaviour in LLVM is to perform validation of the contents by
means of parsing the input if the MC layer can handle it.

Disable clangs integrated assembler and use the GNU assembler instead.

Wording-mostly-from: Saleem Abdulrasool <compnerd@compnerd.org>
Signed-off-by: Michael Davidson <md@google.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23 08:20:34 +01:00
Behan Webster 7135c75e00 kbuild: Add better clang cross build support
commit 785f11aa59 upstream.

Add cross target to CC if using clang. Also add custom gcc toolchain
path for fallback gcc tools.

Clang will fallback to using things like ld, as, and libgcc if
(respectively) one of the llvm linkers isn't available, the integrated
assembler is turned off, or an appropriately cross-compiled version of
compiler-rt isn't available. To this end, you can specify the path to
this fallback gcc toolchain with GCC_TOOLCHAIN.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23 08:20:34 +01:00
Greg Kroah-Hartman 7a4dc3f839 Linux 4.9.138 2018-11-21 09:26:04 +01:00
Greg Kroah-Hartman 5552683784 Linux 4.9.137 2018-11-13 11:17:06 -08:00
Greg Kroah-Hartman 0bb1a5e5aa Linux 4.9.136 2018-11-10 07:43:01 -08:00
Greg Kroah-Hartman b24c9962b1 Linux 4.9.135 2018-10-20 09:51:33 +02:00