Commit graph

1553 commits

Author SHA1 Message Date
Greg Kroah-Hartman
a5aa80588f Linux 4.19.67 2019-08-16 10:12:54 +02:00
Greg Kroah-Hartman
893af1c79e Linux 4.19.66 2019-08-09 17:52:35 +02:00
Greg Kroah-Hartman
cc4c818b22 Linux 4.19.65 2019-08-06 19:06:58 +02:00
Masahiro Yamada
4c5a442561 kbuild: initialize CLANG_FLAGS correctly in the top Makefile
commit 5241ab4cf4 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: 238bcbc4e0 ("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 19:06:53 +02:00
Greg Kroah-Hartman
b3060a1a31 Linux 4.19.64 2019-08-04 09:30:58 +02:00
Greg Kroah-Hartman
9a9de33a9d Linux 4.19.63 2019-07-31 07:27:12 +02:00
Nathan Chancellor
27f2335e14 kbuild: Add -Werror=unknown-warning-option to CLANG_FLAGS
[ Upstream commit 589834b3a0 ]

In commit ebcc5928c5 ("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 c3f0d0bc5b ("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-07-31 07:27:02 +02:00
Greg Kroah-Hartman
64f4694072 Linux 4.19.62 2019-07-28 08:29:30 +02:00
Greg Kroah-Hartman
7250956f6e Linux 4.19.61 2019-07-26 09:14:31 +02:00
Greg Kroah-Hartman
be9b6782a9 Linux 4.19.60 2019-07-21 09:03:18 +02:00
Greg Kroah-Hartman
3bd837bfe4 Linux 4.19.59 2019-07-14 08:11:23 +02:00
Greg Kroah-Hartman
7a6bfa08b9 Linux 4.19.58 2019-07-10 09:53:48 +02:00
Greg Kroah-Hartman
1a05924366 Linux 4.19.57 2019-07-03 13:14:50 +02:00
Greg Kroah-Hartman
aec3002d07 Linux 4.19.56 2019-06-25 11:36:02 +08:00
Linus Torvalds
76343a1363 gcc-9: silence 'address-of-packed-member' warning
commit 6f303d6053 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-06-25 11:35:52 +08:00
Greg Kroah-Hartman
7877807109 Linux 4.19.55 2019-06-22 11:23:18 +02:00
Greg Kroah-Hartman
63bbbcd8ed Linux 4.19.54 2019-06-22 08:15:22 +02:00
Greg Kroah-Hartman
9f31eb60d7 Linux 4.19.53 2019-06-19 08:18:07 +02:00
Greg Kroah-Hartman
6500aa436d Linux 4.19.52 2019-06-17 19:51:57 +02:00
Greg Kroah-Hartman
7aa823a959 Linux 4.19.51 2019-06-15 11:54:11 +02:00
Greg Kroah-Hartman
768292d053 Linux 4.19.50 2019-06-11 12:20:57 +02:00
Greg Kroah-Hartman
bb7b450e61 Linux 4.19.49 2019-06-09 09:17:25 +02:00
Greg Kroah-Hartman
e109a984cf Linux 4.19.48 2019-06-04 08:02:35 +02:00
Masahiro Yamada
0276ebf166 jump_label: move 'asm goto' support test to Kconfig
commit e9666d10a5 upstream.

Currently, CONFIG_JUMP_LABEL just means "I _want_ to use jump label".

The jump label is controlled by HAVE_JUMP_LABEL, which is defined
like this:

  #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
  # define HAVE_JUMP_LABEL
  #endif

We can improve this by testing 'asm goto' support in Kconfig, then
make JUMP_LABEL depend on CC_HAS_ASM_GOTO.

Ugly #ifdef HAVE_JUMP_LABEL will go away, and CONFIG_JUMP_LABEL will
match to the real kernel capability.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
[nc: Fix trivial conflicts in 4.19
     arch/xtensa/kernel/jump_label.c doesn't exist yet
     Ensured CC_HAVE_ASM_GOTO and HAVE_JUMP_LABEL were sufficiently
     eliminated]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-04 08:02:34 +02:00
Greg Kroah-Hartman
0df021b2e8 Linux 4.19.47 2019-05-31 06:46:35 -07:00
Greg Kroah-Hartman
8b2fc00582 Linux 4.19.46 2019-05-25 18:23:48 +02:00
Greg Kroah-Hartman
c3a0725977 Linux 4.19.45 2019-05-22 07:37:46 +02:00
Masahiro Yamada
98bdd33883 kbuild: turn auto.conf.cmd into a mandatory include file
commit d2f8ae0e4c upstream.

syncconfig is responsible for keeping auto.conf up-to-date, so if it
fails for any reason, the build must be terminated immediately.

However, since commit 9390dff66a ("kbuild: invoke syncconfig if
include/config/auto.conf.cmd is missing"), Kbuild continues running
even after syncconfig fails.

You can confirm this by intentionally making syncconfig error out:

#  diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
#  index 08ba146..307b9de 100644
#  --- a/scripts/kconfig/confdata.c
#  +++ b/scripts/kconfig/confdata.c
#  @@ -1023,6 +1023,9 @@ int conf_write_autoconf(int overwrite)
#          FILE *out, *tristate, *out_h;
#          int i;
#
#  +       if (overwrite)
#  +               return 1;
#  +
#          if (!overwrite && is_present(autoconf_name))
#                  return 0;

Then, syncconfig fails, but Make would not stop:

  $ make -s mrproper allyesconfig defconfig
  $ make
  scripts/kconfig/conf  --syncconfig Kconfig

  *** Error during sync of the configuration.

  make[2]: *** [scripts/kconfig/Makefile;69: syncconfig] Error 1
  make[1]: *** [Makefile;557: syncconfig] Error 2
  make: *** [include/config/auto.conf.cmd] Deleting file 'include/config/tristate.conf'
  make: Failed to remake makefile 'include/config/auto.conf'.
    SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
    SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
    SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
    SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
  [ continue running ... ]

The reason is in the behavior of a pattern rule with multi-targets.

  %/auto.conf %/auto.conf.cmd %/tristate.conf: $(KCONFIG_CONFIG)
          $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig

GNU Make knows this rule is responsible for making all the three files
simultaneously. As far as examined, auto.conf.cmd is the target in
question when this rule is invoked. It is probably because auto.conf.cmd
is included below the inclusion of auto.conf.

The inclusion of auto.conf is mandatory, while that of auto.conf.cmd
is optional. GNU Make does not care about the failure in the process
of updating optional include files.

I filed this issue (https://savannah.gnu.org/bugs/?56301) in case this
behavior could be improved somehow in future releases of GNU Make.
Anyway, it is quite easy to fix our Makefile.

Given that auto.conf is already a mandatory include file, there is no
reason to stick auto.conf.cmd optional. Make it mandatory as well.

Cc: linux-stable <stable@vger.kernel.org> # 5.0+
Fixes: 9390dff66a ("kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[commented out diff above to keep patch happy - gregkh]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-22 07:37:45 +02:00
Greg Kroah-Hartman
dafc674bbc Linux 4.19.44 2019-05-16 19:41:32 +02:00
Greg Kroah-Hartman
3351e9d399 Linux 4.19.43 2019-05-14 19:18:00 +02:00
Greg Kroah-Hartman
9c2556f428 Linux 4.19.42 2019-05-10 17:54:12 +02:00
Greg Kroah-Hartman
21de7eb67c Linux 4.19.41 2019-05-08 07:21:55 +02:00
Greg Kroah-Hartman
1656b14572 Linux 4.19.40 2019-05-05 14:42:41 +02:00
Greg Kroah-Hartman
ad119c970b Linux 4.19.39 2019-05-04 09:20:22 +02:00
Greg Kroah-Hartman
a03957ab0f Linux 4.19.38 2019-05-02 09:59:01 +02:00
Greg Kroah-Hartman
19bb613acb Linux 4.19.37 2019-04-27 09:36:41 +02:00
Matthias Kaehlcke
c21bcc2352 Revert "kbuild: use -Oz instead of -Os when using clang"
commit a75bb4eb9e 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 6748cb3c29.

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:36:40 +02:00
Greg Kroah-Hartman
c98875d930 Linux 4.19.36 2019-04-20 09:16:05 +02:00
Greg Kroah-Hartman
4b0e041c9d Linux 4.19.35 2019-04-17 08:38:55 +02:00
Nick Desaulniers
f66a52d991 kbuild: clang: choose GCC_TOOLCHAIN_DIR not on LD
commit ad15006cc7 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: 785f11aa59 ("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:38:45 +02:00
Greg Kroah-Hartman
4d552acf33 Linux 4.19.34 2019-04-05 22:33:17 +02:00
Masahiro Yamada
638ecaf583 kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing
[ Upstream commit 9390dff66a ]

If include/config/auto.conf.cmd is lost for some reasons, it is not
self-healing, so the top Makefile misses to run syncconfig.
Move include/config/auto.conf.cmd to the target side.

I used a pattern rule instead of a normal rule here although it is
a bit gross.

If the rule were written with a normal rule like this,

  include/config/auto.conf \
  include/config/auto.conf.cmd \
  include/config/tristate.conf: $(KCONFIG_CONFIG)
          $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig

... syncconfig would be executed per target.

Using a pattern rule makes sure that syncconfig is executed just once
because Make assumes the recipe will create all of the targets.

Here is a quote from the GNU Make manual [1]:

"Pattern rules may have more than one target. Unlike normal rules,
this does not act as many different rules with the same prerequisites
and recipe. If a pattern rule has multiple targets, make knows that
the rule's recipe is responsible for making all of the targets. The
recipe is executed only once to make all the targets. When searching
for a pattern rule to match a target, the target patterns of a rule
other than the one that matches the target in need of a rule are
incidental: make worries only about giving a recipe and prerequisites
to the file presently in question. However, when this file's recipe is
run, the other targets are marked as having been updated themselves."

[1]: https://www.gnu.org/software/make/manual/html_node/Pattern-Intro.html

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-05 22:33:01 +02:00
Greg Kroah-Hartman
4b3a3ab00f Linux 4.19.33 2019-04-03 06:26:31 +02:00
Rolf Eike Beer
0603e3a928 objtool: Query pkg-config for libelf location
commit 056d28d135 upstream.

If it is not in the default location, compilation fails at several points.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/91a25e992566a7968fedc89ec80e7f4c83ad0548.1553622500.git.jpoimboe@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03 06:26:28 +02:00
Greg Kroah-Hartman
3a2156c839 Linux 4.19.32 2019-03-27 14:14:43 +09:00
Greg Kroah-Hartman
a2cddfe2ce Linux 4.19.31 2019-03-23 20:10:14 +01:00
Greg Kroah-Hartman
7794d35226 Linux 4.19.30 2019-03-19 13:12:42 +01:00
Greg Kroah-Hartman
ce194fa2b2 Linux 4.19.29 2019-03-13 14:02:41 -07:00
Greg Kroah-Hartman
6a31767f84 Linux 4.19.28 2019-03-10 07:17:22 +01:00
Greg Kroah-Hartman
adc2a008ae Linux 4.19.27 2019-03-05 17:58:54 +01:00