Skip to content

Commit d81d9d3

Browse files
t-8chNicolas Schier
authored andcommitted
kbuild: don't enable CC_CAN_LINK if the dummy program generates warnings
It is possible that the kernel toolchain generates warnings when used together with the system toolchain. This happens for example when the older kernel toolchain does not handle new versions of sframe debug information. While these warnings where ignored during the evaluation of CC_CAN_LINK, together with CONFIG_WERROR the actual userprog build will later fail. Example warning: .../x86_64-linux/13.2.0/../../../../x86_64-linux/bin/ld: error in /lib/../lib64/crt1.o(.sframe); no .sframe will be created collect2: error: ld returned 1 exit status Make sure that the very simple example program does not generate warnings already to avoid breaking the userprog compilations. Fixes: ec4a399 ("kbuild: respect CONFIG_WERROR for linker and assembler") Fixes: 3f0ff4c ("kbuild: respect CONFIG_WERROR for userprogs") Signed-off-by: Thomas Weißschuh <[email protected]> Reviewed-by: Nicolas Schier <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Nicolas Schier <[email protected]>
1 parent 7bade3f commit d81d9d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/cc-can-link.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
# SPDX-License-Identifier: GPL-2.0
33

4-
cat << "END" | $@ -x c - -o /dev/null >/dev/null 2>&1
4+
cat << "END" | $@ -Werror -Wl,--fatal-warnings -x c - -o /dev/null >/dev/null 2>&1
55
#include <stdio.h>
66
int main(void)
77
{

0 commit comments

Comments
 (0)