1573 Commits

Author SHA1 Message Date
Greg Kroah-Hartman
352b498db8 Linux 4.9.199 2019-11-06 12:18:29 +01:00
Greg Kroah-Hartman
9e48f0c28d Linux 4.9.198 2019-10-29 09:15:27 +01:00
Greg Kroah-Hartman
364ef83db0 Linux 4.9.197 2019-10-17 13:42:47 -07:00
Greg Kroah-Hartman
140fcbee3e Linux 4.9.196 2019-10-07 18:53:25 +02:00
Greg Kroah-Hartman
6eea609ac3 Linux 4.9.195 2019-10-05 12:30:37 +02:00
Greg Kroah-Hartman
1b2be6d75a Linux 4.9.194 2019-09-21 07:14:23 +02:00
Greg Kroah-Hartman
779cde69dc Linux 4.9.193 2019-09-16 08:19:34 +02:00
Greg Kroah-Hartman
5ce2e06002 Linux 4.9.192 2019-09-10 10:31:05 +01:00
Greg Kroah-Hartman
bf489db05e Linux 4.9.191 2019-09-06 10:19:54 +02:00
Greg Kroah-Hartman
228e87c35b Linux 4.9.190 2019-08-25 10:51:53 +02:00
Greg Kroah-Hartman
4bd718dba6 Linux 4.9.189 2019-08-11 12:22:20 +02:00
Greg Kroah-Hartman
fa897d1731 Linux 4.9.188 2019-08-06 18:29:42 +02:00
Masahiro Yamada
757ee02703 kbuild: initialize CLANG_FLAGS correctly in the top Makefile
commit 5241ab4cf42d3a93b933b55d3d53f43049081fa1 upstream.

CLANG_FLAGS is initialized by the following line:

  CLANG_FLAGS     := --target=$(notdir $(CROSS_COMPILE:%-=%))

..., which is run only when CROSS_COMPILE is set.

Some build targets (bindeb-pkg etc.) recurse to the top Makefile.

When you build the kernel with Clang but without CROSS_COMPILE,
the same compiler flags such as -no-integrated-as are accumulated
into CLANG_FLAGS.

If you run 'make CC=clang' and then 'make CC=clang bindeb-pkg',
Kbuild will recompile everything needlessly due to the build command
change.

Fix this by correctly initializing CLANG_FLAGS.

Fixes: 238bcbc4e07f ("kbuild: consolidate Clang compiler flags")
Cc: <stable@vger.kernel.org> # v5.0+
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-06 18:29:40 +02:00
Greg Kroah-Hartman
97d7530b83 Linux 4.9.187 2019-08-04 09:33:45 +02:00
Nathan Chancellor
7caebf6db7 kbuild: Add -Werror=unknown-warning-option to CLANG_FLAGS
[ Upstream commit 589834b3a0097a4908f4112eac0ca2feb486fa32 ]

In commit ebcc5928c5d9 ("arm64: Silence gcc warnings about arch ABI
drift"), the arm64 Makefile added -Wno-psabi to KBUILD_CFLAGS, which is
a GCC only option so clang rightfully complains:

warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]

https://clang.llvm.org/docs/DiagnosticsReference.html#wunknown-warning-option

However, by default, this is merely a warning so the build happily goes
on with a slew of these warnings in the process.

Commit c3f0d0bc5b01 ("kbuild, LLVMLinux: Add -Werror to cc-option to
support clang") worked around this behavior in cc-option by adding
-Werror so that unknown flags cause an error. However, this all happens
silently and when an unknown flag is added to the build unconditionally
like -Wno-psabi, cc-option will always fail because there is always an
unknown flag in the list of flags. This manifested as link time failures
in the arm64 libstub because -fno-stack-protector didn't get added to
KBUILD_CFLAGS.

To avoid these weird cryptic failures in the future, make clang behave
like gcc and immediately error when it encounters an unknown flag by
adding -Werror=unknown-warning-option to CLANG_FLAGS. This can be added
unconditionally for clang because it is supported by at least 3.0.0,
according to godbolt [1] and 4.0.0, according to its documentation [2],
which is far earlier than we typically support.

[1]: https://godbolt.org/z/7F7rm3
[2]: https://releases.llvm.org/4.0.0/tools/clang/docs/DiagnosticsReference.html#wunknown-warning-option

Link: https://github.com/ClangBuiltLinux/linux/issues/511
Link: https://github.com/ClangBuiltLinux/linux/issues/517
Suggested-by: Peter Smith <peter.smith@linaro.org>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-08-04 09:33:38 +02:00
Greg Kroah-Hartman
35c308d782 Linux 4.9.186 2019-07-21 09:06:09 +02:00
Greg Kroah-Hartman
9c51e1102c Linux 4.9.185 2019-07-10 09:55:47 +02:00
Linus Torvalds
7601d81506 gcc-9: silence 'address-of-packed-member' warning
commit 6f303d60534c46aa1a239f29c321f95c83dda748 upstream.

We already did this for clang, but now gcc has that warning too.  Yes,
yes, the address may be unaligned.  And that's kind of the point.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-10 09:55:28 +02:00
Greg Kroah-Hartman
09a7068360 Linux 4.9.184 2019-06-27 08:14:21 +08:00
Greg Kroah-Hartman
72f67fd749 Linux 4.9.183 2019-06-22 08:17:25 +02:00
Greg Kroah-Hartman
f4e2dd989e Linux 4.9.182 2019-06-17 19:53:33 +02:00
Greg Kroah-Hartman
3ffb2407c5 Linux 4.9.181 2019-06-11 12:22:50 +02:00
Greg Kroah-Hartman
b16a5334ed Linux 4.9.180 2019-05-31 06:48:32 -07:00
Greg Kroah-Hartman
2584e66ffb Linux 4.9.179 2019-05-25 18:26:58 +02:00
Greg Kroah-Hartman
a5f56b52c8 Linux 4.9.178 2019-05-21 18:49:01 +02:00
Greg Kroah-Hartman
8baec4ebdf Linux 4.9.177 2019-05-16 19:43:47 +02:00
Greg Kroah-Hartman
ffe8cffc8b Linux 4.9.176 2019-05-14 19:19:42 +02:00
Greg Kroah-Hartman
bb4f008d1e Linux 4.9.175 2019-05-10 17:52:11 +02:00
Greg Kroah-Hartman
d79b8577df Linux 4.9.174 2019-05-08 07:19:12 +02:00
Greg Kroah-Hartman
4b333b9c99 Linux 4.9.173 2019-05-04 08:49:10 +02:00
Greg Kroah-Hartman
5383785aaa Linux 4.9.172 2019-05-02 09:32:07 +02:00
Greg Kroah-Hartman
6bff0bba46 Linux 4.9.171 2019-04-27 09:34:48 +02:00
Matthias Kaehlcke
6950577c4f Revert "kbuild: use -Oz instead of -Os when using clang"
commit a75bb4eb9e565b9f5115e2e8c07377ce32cbe69a upstream.

The clang option -Oz enables *aggressive* optimization for size,
which doesn't necessarily result in smaller images, but can have
negative impact on performance. Switch back to the less aggressive
-Os.

This reverts commit 6748cb3c299de1ffbe56733647b01dbcc398c419.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-27 09:34:46 +02:00
Greg Kroah-Hartman
ad387ec4bc Linux 4.9.170 2019-04-20 09:07:54 +02:00
Greg Kroah-Hartman
df62169c33 Linux 4.9.169 2019-04-17 08:36:48 +02:00
Nick Desaulniers
1347aa2a4d kbuild: clang: choose GCC_TOOLCHAIN_DIR not on LD
commit ad15006cc78459d059af56729c4d9bed7c7fd860 upstream.

This causes an issue when trying to build with `make LD=ld.lld` if
ld.lld and the rest of your cross tools aren't in the same directory
(ex. /usr/local/bin) (as is the case for Android's build system), as the
GCC_TOOLCHAIN_DIR then gets set based on `which $(LD)` which will point
where LLVM tools are, not GCC/binutils tools are located.

Instead, select the GCC_TOOLCHAIN_DIR based on another tool provided by
binutils for which LLVM does not provide a substitute for, such as
elfedit.

Fixes: 785f11aa595b ("kbuild: Add better clang cross build support")
Link: https://github.com/ClangBuiltLinux/linux/issues/341
Suggested-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-17 08:36:38 +02:00
Greg Kroah-Hartman
e93d474911 Linux 4.9.168 2019-04-05 22:29:15 +02:00
Greg Kroah-Hartman
21834d3e53 Linux 4.9.167 2019-04-03 06:24:20 +02:00
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 238bcbc4e07fad2fff99c5b157d0c37ccd4d093c 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 dbe27a002ef8573168cb64e181458ea23a74e2b6 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 0f0e8de334c54c38818a4a5390a39aa09deff5bf 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: cfe17c9bbe6a ("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 0a5f41767444cc3b4fc5573921ab914b4f78baaa 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 df16aaac26e92e97ab7234d3f93c953466adc4b5 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 61163efae020 ("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 bb3f38c3c5b759163e09b9152629cc789731de47 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