Commit graph android_kernel_sony_sdm845/Makefile
Message SHA1
Linux 4.9.228
Greg Kroah-Hartman   commited 2020-06-20 10:24:22 +02:00
45b83c1819
kbuild: force to build vmlinux if CONFIG_MODVERSION=y
commit 4b50c8c4eaf06a825d1c005c0b1b4a8307087b83 upstream.

This code does not work as stated in the comment.

$(CONFIG_MODVERSIONS) is always empty because it is expanded before
include/config/auto.conf is included. Hence, 'make modules' with
CONFIG_MODVERSION=y cannot record the version CRCs.

This has been broken since 2003, commit ("kbuild: Enable modules to be
build using the "make dir/" syntax"). [1]

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=15c6240cdc44bbeef3c4797ec860f9765ef4f1a7
Cc: linux-stable <stable@vger.kernel.org> # v2.5.71+
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Masahiro Yamada   authored and   Greg Kroah-Hartman   commited 2020-06-20 10:24:21 +02:00
5295e74327
Linux 4.9.227
Greg Kroah-Hartman   commited 2020-06-11 09:22:24 +02:00
e0799bae56
Linux 4.9.226
Greg Kroah-Hartman   commited 2020-06-03 08:16:48 +02:00
af5595c4ae
Linux 4.9.225
Greg Kroah-Hartman   commited 2020-05-27 16:42:03 +02:00
82dddebfe7
Linux 4.9.224
Greg Kroah-Hartman   commited 2020-05-20 08:15:44 +02:00
e4ebe4fae2
Makefile: disallow data races on gcc-10 as well
commit b1112139a103b4b1101d0d2d72931f2d33d8c978 upstream.

gcc-10 will rename --param=allow-store-data-races=0
to -fno-allow-store-data-races.

The flag change happened at https://gcc.gnu.org/PR92046.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Cc: Thomas Backlund <tmb@mageia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Sergei Trofimovich   authored and   Greg Kroah-Hartman   commited 2020-05-20 08:15:43 +02:00
3bead443ef
gcc-10: disable 'restrict' warning for now
commit adc71920969870dfa54e8f40dac8616284832d02 upstream.

gcc-10 now warns about passing aliasing pointers to functions that take
restricted pointers.

That's actually a great warning, and if we ever start using 'restrict'
in the kernel, it might be quite useful.  But right now we don't, and it
turns out that the only thing this warns about is an idiom where we have
declared a few functions to be "printf-like" (which seems to make gcc
pick up the restricted pointer thing), and then we print to the same
buffer that we also use as an input.

And people do that as an odd concatenation pattern, with code like this:

    #define sysfs_show_gen_prop(buffer, fmt, ...) \
        snprintf(buffer, PAGE_SIZE, "%s"fmt, buffer, __VA_ARGS__)

where we have 'buffer' as both the destination of the final result, and
as the initial argument.

Yes, it's a bit questionable.  And outside of the kernel, people do have
standard declarations like

    int snprintf( char *restrict buffer, size_t bufsz,
                  const char *restrict format, ... );

where that output buffer is marked as a restrict pointer that cannot
alias with any other arguments.

But in the context of the kernel, that 'use snprintf() to concatenate to
the end result' does work, and the pattern shows up in multiple places.
And we have not marked our own version of snprintf() as taking restrict
pointers, so the warning is incorrect for now, and gcc picks it up on
its own.

If we do start using 'restrict' in the kernel (and it might be a good
idea if people find places where it matters), we'll need to figure out
how to avoid this issue for snprintf and friends.  But in the meantime,
this warning is not useful.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linus Torvalds   authored and   Greg Kroah-Hartman   commited 2020-05-20 08:15:38 +02:00
9799d95718
gcc-10: disable 'stringop-overflow' warning for now
commit 5a76021c2eff7fcf2f0918a08fd8a37ce7922921 upstream.

This is the final array bounds warning removal for gcc-10 for now.

Again, the warning is good, and we should re-enable all these warnings
when we have converted all the legacy array declaration cases to
flexible arrays. But in the meantime, it's just noise.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linus Torvalds   authored and   Greg Kroah-Hartman   commited 2020-05-20 08:15:38 +02:00
01d51bb312
gcc-10: disable 'array-bounds' warning for now
commit 44720996e2d79e47d508b0abe99b931a726a3197 upstream.

This is another fine warning, related to the 'zero-length-bounds' one,
but hitting the same historical code in the kernel.

Because C didn't historically support flexible array members, we have
code that instead uses a one-sized array, the same way we have cases of
zero-sized arrays.

The one-sized arrays come from either not wanting to use the gcc
zero-sized array extension, or from a slight convenience-feature, where
particularly for strings, the size of the structure now includes the
allocation for the final NUL character.

So with a "char name[1];" at the end of a structure, you can do things
like

       v = my_malloc(sizeof(struct vendor) + strlen(name));

and avoid the "+1" for the terminator.

Yes, the modern way to do that is with a flexible array, and using
'offsetof()' instead of 'sizeof()', and adding the "+1" by hand.  That
also technically gets the size "more correct" in that it avoids any
alignment (and thus padding) issues, but this is another long-term
cleanup thing that will not happen for 5.7.

So disable the warning for now, even though it's potentially quite
useful.  Having a slew of warnings that then hide more urgent new issues
is not an improvement.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linus Torvalds   authored and   Greg Kroah-Hartman   commited 2020-05-20 08:15:38 +02:00
55e8e4b87b
gcc-10: disable 'zero-length-bounds' warning for now
commit 5c45de21a2223fe46cf9488c99a7fbcf01527670 upstream.

This is a fine warning, but we still have a number of zero-length arrays
in the kernel that come from the traditional gcc extension.  Yes, they
are getting converted to flexible arrays, but in the meantime the gcc-10
warning about zero-length bounds is very verbose, and is hiding other
issues.

I missed one actual build failure because it was hidden among hundreds
of lines of warning.  Thankfully I caught it on the second go before
pushing things out, but it convinced me that I really need to disable
the new warnings for now.

We'll hopefully be all done with our conversion to flexible arrays in
the not too distant future, and we can then re-enable this warning.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linus Torvalds   authored and   Greg Kroah-Hartman   commited 2020-05-20 08:15:38 +02:00
207ad349e2
Stop the ad-hoc games with -Wno-maybe-initialized
commit 78a5255ffb6a1af189a83e493d916ba1c54d8c75 upstream.

We have some rather random rules about when we accept the
"maybe-initialized" warnings, and when we don't.

For example, we consider it unreliable for gcc versions < 4.9, but also
if -O3 is enabled, or if optimizing for size.  And then various kernel
config options disabled it, because they know that they trigger that
warning by confusing gcc sufficiently (ie PROFILE_ALL_BRANCHES).

And now gcc-10 seems to be introducing a lot of those warnings too, so
it falls under the same heading as 4.9 did.

At the same time, we have a very straightforward way to _enable_ that
warning when wanted: use "W=2" to enable more warnings.

So stop playing these ad-hoc games, and just disable that warning by
default, with the known and straight-forward "if you want to work on the
extra compiler warnings, use W=123".

Would it be great to have code that is always so obvious that it never
confuses the compiler whether a variable is used initialized or not?
Yes, it would.  In a perfect world, the compilers would be smarter, and
our source code would be simpler.

That's currently not the world we live in, though.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linus Torvalds   authored and   Greg Kroah-Hartman   commited 2020-05-20 08:15:37 +02:00
ce9f411be7
kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
commit b303c6df80c9f8f13785aa83a0471fca7e38b24d upstream.

Since -Wmaybe-uninitialized was introduced by GCC 4.7, we have patched
various false positives:

 - commit e74fc973b6 ("Turn off -Wmaybe-uninitialized when building
   with -Os") turned off this option for -Os.

 - commit 815eb71e71 ("Kbuild: disable 'maybe-uninitialized' warning
   for CONFIG_PROFILE_ALL_BRANCHES") turned off this option for
   CONFIG_PROFILE_ALL_BRANCHES

 - commit a76bcf557e ("Kbuild: enable -Wmaybe-uninitialized warning
   for "make W=1"") turned off this option for GCC < 4.9
   Arnd provided more explanation in https://lkml.org/lkml/2017/3/14/903

I think this looks better by shifting the logic from Makefile to Kconfig.

Link: https://github.com/ClangBuiltLinux/linux/issues/350
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Masahiro Yamada   authored and   Greg Kroah-Hartman   commited 2020-05-20 08:15:37 +02:00
c0138cf0fd
Linux 4.9.223
Greg Kroah-Hartman   commited 2020-05-10 10:28:04 +02:00
270f791a31
Linux 4.9.222
Greg Kroah-Hartman   commited 2020-05-05 19:14:41 +02:00
ffd00fbcb5
Linux 4.9.221
Greg Kroah-Hartman   commited 2020-05-02 17:23:20 +02:00
775dfa8c1c
Linux 4.9.220
Greg Kroah-Hartman   commited 2020-04-24 07:59:16 +02:00
0661b3d6cf
Linux 4.9.219
Greg Kroah-Hartman   commited 2020-04-13 10:32:59 +02:00
5188957a31
Linux 4.9.218
Greg Kroah-Hartman   commited 2020-04-02 17:20:41 +02:00
a5ad06fc4b
Linux 4.9.217
Greg Kroah-Hartman   commited 2020-03-20 09:07:59 +01:00
10a20903d7
Linux 4.9.216
Greg Kroah-Hartman   commited 2020-03-11 07:53:14 +01:00
19c646f01e
Linux 4.9.215
Greg Kroah-Hartman   commited 2020-02-28 15:42:57 +01:00
4cd444443b
Linux 4.9.214
Greg Kroah-Hartman   commited 2020-02-14 16:31:10 -05:00
7ce439266f
Linux 4.9.213
Greg Kroah-Hartman   commited 2020-02-05 13:05:57 +00:00
0e96b1eb0e
Linux 4.9.212
Greg Kroah-Hartman   commited 2020-01-29 10:24:41 +01:00
6f8dc95670
Linux 4.9.211
Greg Kroah-Hartman   commited 2020-01-23 08:19:43 +01:00
80f0831c72
Linux 4.9.210
Greg Kroah-Hartman   commited 2020-01-14 20:04:32 +01:00
36fa7559a1
Linux 4.9.209
Greg Kroah-Hartman   commited 2020-01-12 11:24:28 +01:00
753a4bcdbe
Linux 4.9.208
Greg Kroah-Hartman   commited 2020-01-04 13:41:15 +01:00
e77ff35fa7
Linux 4.9.207
Greg Kroah-Hartman   commited 2019-12-21 10:42:35 +01:00
5b7a2c7d46
kbuild: fix single target build for external module
[ Upstream commit e07db28eea38ed4e332b3a89f3995c86b713cb5b ]

Building a single target in an external module fails due to missing
.tmp_versions directory.

For example,

  $ make -C /lib/modules/$(uname -r)/build M=$PWD foo.o

will fail in the following way:

  CC [M]  /home/masahiro/foo/foo.o
/bin/sh: 1: cannot create /home/masahiro/foo/.tmp_versions/foo.mod: Directory nonexistent

This is because $(cmd_crmodverdir) is executed only before building
/, %/, %.ko single targets of external modules. Create .tmp_versions
in the 'prepare' target.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>

Masahiro Yamada   authored and   Greg Kroah-Hartman   commited 2019-12-21 10:41:18 +01:00
b1335cdef4
Linux 4.9.206
Greg Kroah-Hartman   commited 2019-12-05 15:35:34 +01:00
de84c554e3
Linux 4.9.205
Greg Kroah-Hartman   commited 2019-11-29 09:31:25 +01:00
6620daa748
Linux 4.9.204
Greg Kroah-Hartman   commited 2019-11-28 18:29:06 +01:00
95e55e41e6
Linux 4.9.203
Greg Kroah-Hartman   commited 2019-11-25 09:53:54 +01:00
a777e9dd40
Linux 4.9.202
Greg Kroah-Hartman   commited 2019-11-16 10:29:58 +01:00
a86e4a77b5
Linux 4.9.201
Greg Kroah-Hartman   commited 2019-11-12 19:16:25 +01:00
9829ecfd82
Linux 4.9.200
Greg Kroah-Hartman   commited 2019-11-10 11:23:33 +01:00
574a61d201
kbuild: add -fcf-protection=none when using retpoline flags
[ Upstream commit 29be86d7f9cb18df4123f309ac7857570513e8bc ]

The gcc -fcf-protection=branch option is not compatible with
-mindirect-branch=thunk-extern. The latter is used when
CONFIG_RETPOLINE is selected, and this will fail to build with
a gcc which has -fcf-protection=branch enabled by default. Adding
-fcf-protection=none when building with retpoline enabled
prevents such build failures.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>

Seth Forshee   authored and   Greg Kroah-Hartman   commited 2019-11-10 11:23:30 +01:00
0446b0300c
kbuild: use -fmacro-prefix-map to make __FILE__ a relative path
[ Upstream commit a73619a845d5625079cc1b3b820f44c899618388 ]

The __FILE__ macro is used everywhere in the kernel to locate the file
printing the log message, such as WARN_ON(), etc.  If the kernel is
built out of tree, this can be a long absolute path, like this:

  WARNING: CPU: 1 PID: 1 at /path/to/build/directory/arch/arm64/kernel/foo.c:...

This is because Kbuild runs in the objtree instead of the srctree,
then __FILE__ is expanded to a file path prefixed with $(srctree)/.

Commit 9da0763bdd ("kbuild: Use relative path when building in a
subdir of the source tree") improved this to some extent; $(srctree)
becomes ".." if the objtree is a child of the srctree.

For other cases of out-of-tree build, __FILE__ is still the absolute
path.  It also means the kernel image depends on where it was built.

A brand-new option from GCC, -fmacro-prefix-map, solves this problem.
If your compiler supports it, __FILE__ is the relative path from the
srctree regardless of O= option.  This provides more readable log and
more reproducible builds.

Please note __FILE__ is always an absolute path for external modules.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>

Masahiro Yamada   authored and   Greg Kroah-Hartman   commited 2019-11-10 11:23:30 +01:00
2e1dff7b0d
Kbuild: make designated_init attribute fatal
[ Upstream commit c834f0e8a8bb3025aac38e802fca2e686720f544 ]

If a structure is marked with __attribute__((designated_init)) from
GCC or Sparse, it needs to have all static initializers using designated
initialization. Fail the build for any missing cases. This attribute will
be used by the randstruct plugin to make sure randomized structures are
being correctly initialized.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>

Kees Cook   authored and   Greg Kroah-Hartman   commited 2019-11-10 11:23:29 +01:00
a250cab009
Linux 4.9.199
Greg Kroah-Hartman   commited 2019-11-06 12:18:29 +01:00
352b498db8
Linux 4.9.198
Greg Kroah-Hartman   commited 2019-10-29 09:15:27 +01:00
9e48f0c28d
Linux 4.9.197
Greg Kroah-Hartman   commited 2019-10-17 13:42:47 -07:00
364ef83db0
Linux 4.9.196
Greg Kroah-Hartman   commited 2019-10-07 18:53:25 +02:00
140fcbee3e
Linux 4.9.195
Greg Kroah-Hartman   commited 2019-10-05 12:30:37 +02:00
6eea609ac3
Linux 4.9.194
Greg Kroah-Hartman   commited 2019-09-21 07:14:23 +02:00
1b2be6d75a
Linux 4.9.193
Greg Kroah-Hartman   commited 2019-09-16 08:19:34 +02:00
779cde69dc
Linux 4.9.192
Greg Kroah-Hartman   commited 2019-09-10 10:31:05 +01:00
5ce2e06002
Linux 4.9.191
Greg Kroah-Hartman   commited 2019-09-06 10:19:54 +02:00
bf489db05e