* [Buildroot] [PATCH v2 1/1] kconfig/lxdialog: fix check() with GCC14
@ 2024-04-08 21:16 Robert Marko
2024-04-08 22:45 ` Petr Vorel
2024-04-30 18:01 ` Yann E. MORIN
0 siblings, 2 replies; 4+ messages in thread
From: Robert Marko @ 2024-04-08 21:16 UTC (permalink / raw)
To: buildroot; +Cc: Petr Vorel, Robert Marko
GCC14 now treats implicit int types as error so when check() from
check-lxdialog.sh is called to check whether we can link against ncurses
it will fail silently and the help text indicating to install ncurses is
printed.
However, this is not due to missing ncurses but once the stderr redirect
to /dev/null is removed we can see the root cause:
<stdin>:2:1: error: return type defaults to ‘int’ [-Wimplicit-int]
So, in order for menuconfig to work with GCC14 lets just specify the
return type of main() as int.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
Tested-by: Petr Vorel <petr.vorel@gmail.com>
---
support/kconfig/lxdialog/check-lxdialog.sh | 2 +-
...config-lxdialog-fix-check-with-GCC14.patch | 43 +++++++++++++++++++
support/kconfig/patches/series | 1 +
3 files changed, 45 insertions(+), 1 deletion(-)
create mode 100644 support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
diff --git a/support/kconfig/lxdialog/check-lxdialog.sh b/support/kconfig/lxdialog/check-lxdialog.sh
index 16cd9a3186..27d6c30a57 100755
--- a/support/kconfig/lxdialog/check-lxdialog.sh
+++ b/support/kconfig/lxdialog/check-lxdialog.sh
@@ -48,7 +48,7 @@ trap "rm -f $tmp" 0 1 2 3 15
check() {
$cc -x c - -o $tmp 2>/dev/null <<'EOF'
#include CURSES_LOC
-main() {}
+int main() {}
EOF
if [ $? != 0 ]; then
echo " *** Unable to find the ncurses libraries or the" 1>&2
diff --git a/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
new file mode 100644
index 0000000000..41081bb45d
--- /dev/null
+++ b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
@@ -0,0 +1,43 @@
+From 3ae91337b53fa3ccf0bad7f181fcaf483fab22ee Mon Sep 17 00:00:00 2001
+From: Robert Marko <robimarko@gmail.com>
+Date: Wed, 3 Apr 2024 14:18:07 +0200
+Subject: [PATCH] kconfig/lxdialog: fix check() with GCC14
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+GCC14 now treats implicit int types as error so when check() from
+check-lxdialog.sh is called to check whether we can link against ncurses
+it will fail silently and the help text indicating to install ncurses is
+printed.
+
+However, this is not due to missing ncurses but once the stderr redirect
+to /dev/null is removed we can see the root cause:
+<stdin>:2:1: error: return type defaults to ‘int’ [-Wimplicit-int]
+
+So, in order for menuconfig to work with GCC14 lets just specify the
+return type of main() as int.
+
+Signed-off-by: Robert Marko <robimarko@gmail.com>
+Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
+Tested-by: Petr Vorel <petr.vorel@gmail.com>
+---
+ kconfig/lxdialog/check-lxdialog.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kconfig/lxdialog/check-lxdialog.sh b/kconfig/lxdialog/check-lxdialog.sh
+index 16cd9a3186..27d6c30a57 100755
+--- a/kconfig/lxdialog/check-lxdialog.sh
++++ b/kconfig/lxdialog/check-lxdialog.sh
+@@ -48,7 +48,7 @@ trap "rm -f $tmp" 0 1 2 3 15
+ check() {
+ $cc -x c - -o $tmp 2>/dev/null <<'EOF'
+ #include CURSES_LOC
+-main() {}
++int main() {}
+ EOF
+ if [ $? != 0 ]; then
+ echo " *** Unable to find the ncurses libraries or the" 1>&2
+--
+2.44.0
+
diff --git a/support/kconfig/patches/series b/support/kconfig/patches/series
index e5a6f69d8f..f120e323b7 100644
--- a/support/kconfig/patches/series
+++ b/support/kconfig/patches/series
@@ -10,3 +10,4 @@
19-merge_config.sh-add-br2-external-support.patch
20-merge_config.sh-Allow-to-define-config-prefix.patch
21-Avoid-false-positive-matches-from-comment-lines.patch
+22-kconfig-lxdialog-fix-check-with-GCC14.patch
--
2.44.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [Buildroot] [PATCH v2 1/1] kconfig/lxdialog: fix check() with GCC14
2024-04-08 21:16 [Buildroot] [PATCH v2 1/1] kconfig/lxdialog: fix check() with GCC14 Robert Marko
@ 2024-04-08 22:45 ` Petr Vorel
2024-04-30 18:01 ` Yann E. MORIN
1 sibling, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2024-04-08 22:45 UTC (permalink / raw)
To: Robert Marko; +Cc: Thomas Petazzoni, buildroot
Hi Robert, Thomas,
> GCC14 now treats implicit int types as error so when check() from
> check-lxdialog.sh is called to check whether we can link against ncurses
> it will fail silently and the help text indicating to install ncurses is
> printed.
> However, this is not due to missing ncurses but once the stderr redirect
> to /dev/null is removed we can see the root cause:
> <stdin>:2:1: error: return type defaults to ‘int’ [-Wimplicit-int]
> So, in order for menuconfig to work with GCC14 lets just specify the
> return type of main() as int.
> Signed-off-by: Robert Marko <robimarko@gmail.com>
> Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
> Tested-by: Petr Vorel <petr.vorel@gmail.com>
Thanks for quickly adding v2.
BTW there were whitespace issues (but fixed by git am):
Description: [v2,1/1] kconfig/lxdialog: fix check() with GCC14
Applying: kconfig/lxdialog: fix check() with GCC14
.git/rebase-apply/patch:65: space before tab in indent.
if [ $? != 0 ]; then
.git/rebase-apply/patch:66: space before tab in indent.
echo " *** Unable to find the ncurses libraries or the" 1>&2
.git/rebase-apply/patch:67: trailing whitespace.
--
.git/rebase-apply/patch:69: new blank line at EOF.
+
warning: 3 lines applied after fixing whitespace errors.
Otherwise LGTM.
And I see the toolchain warnings for gconfig and xconfig (which are likely fixed
in newer kconfig in the Linux kernel).
Kind regards,
Petr
> ---
> support/kconfig/lxdialog/check-lxdialog.sh | 2 +-
> ...config-lxdialog-fix-check-with-GCC14.patch | 43 +++++++++++++++++++
> support/kconfig/patches/series | 1 +
> 3 files changed, 45 insertions(+), 1 deletion(-)
> create mode 100644 support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> diff --git a/support/kconfig/lxdialog/check-lxdialog.sh b/support/kconfig/lxdialog/check-lxdialog.sh
> index 16cd9a3186..27d6c30a57 100755
> --- a/support/kconfig/lxdialog/check-lxdialog.sh
> +++ b/support/kconfig/lxdialog/check-lxdialog.sh
> @@ -48,7 +48,7 @@ trap "rm -f $tmp" 0 1 2 3 15
> check() {
> $cc -x c - -o $tmp 2>/dev/null <<'EOF'
> #include CURSES_LOC
> -main() {}
> +int main() {}
> EOF
> if [ $? != 0 ]; then
> echo " *** Unable to find the ncurses libraries or the" 1>&2
> diff --git a/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> new file mode 100644
> index 0000000000..41081bb45d
> --- /dev/null
> +++ b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> @@ -0,0 +1,43 @@
> +From 3ae91337b53fa3ccf0bad7f181fcaf483fab22ee Mon Sep 17 00:00:00 2001
> +From: Robert Marko <robimarko@gmail.com>
> +Date: Wed, 3 Apr 2024 14:18:07 +0200
> +Subject: [PATCH] kconfig/lxdialog: fix check() with GCC14
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +GCC14 now treats implicit int types as error so when check() from
> +check-lxdialog.sh is called to check whether we can link against ncurses
> +it will fail silently and the help text indicating to install ncurses is
> +printed.
> +
> +However, this is not due to missing ncurses but once the stderr redirect
> +to /dev/null is removed we can see the root cause:
> +<stdin>:2:1: error: return type defaults to ‘int’ [-Wimplicit-int]
> +
> +So, in order for menuconfig to work with GCC14 lets just specify the
> +return type of main() as int.
> +
> +Signed-off-by: Robert Marko <robimarko@gmail.com>
> +Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
> +Tested-by: Petr Vorel <petr.vorel@gmail.com>
> +---
> + kconfig/lxdialog/check-lxdialog.sh | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/kconfig/lxdialog/check-lxdialog.sh b/kconfig/lxdialog/check-lxdialog.sh
> +index 16cd9a3186..27d6c30a57 100755
> +--- a/kconfig/lxdialog/check-lxdialog.sh
> ++++ b/kconfig/lxdialog/check-lxdialog.sh
> +@@ -48,7 +48,7 @@ trap "rm -f $tmp" 0 1 2 3 15
> + check() {
> + $cc -x c - -o $tmp 2>/dev/null <<'EOF'
> + #include CURSES_LOC
> +-main() {}
> ++int main() {}
> + EOF
> + if [ $? != 0 ]; then
> + echo " *** Unable to find the ncurses libraries or the" 1>&2
> +--
> +2.44.0
> +
> diff --git a/support/kconfig/patches/series b/support/kconfig/patches/series
> index e5a6f69d8f..f120e323b7 100644
> --- a/support/kconfig/patches/series
> +++ b/support/kconfig/patches/series
> @@ -10,3 +10,4 @@
> 19-merge_config.sh-add-br2-external-support.patch
> 20-merge_config.sh-Allow-to-define-config-prefix.patch
> 21-Avoid-false-positive-matches-from-comment-lines.patch
> +22-kconfig-lxdialog-fix-check-with-GCC14.patch
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Buildroot] [PATCH v2 1/1] kconfig/lxdialog: fix check() with GCC14
2024-04-08 21:16 [Buildroot] [PATCH v2 1/1] kconfig/lxdialog: fix check() with GCC14 Robert Marko
2024-04-08 22:45 ` Petr Vorel
@ 2024-04-30 18:01 ` Yann E. MORIN
2024-05-15 13:22 ` Peter Korsgaard
1 sibling, 1 reply; 4+ messages in thread
From: Yann E. MORIN @ 2024-04-30 18:01 UTC (permalink / raw)
To: Robert Marko; +Cc: Petr Vorel, buildroot
Robert, All,
On 2024-04-08 23:16 +0200, Robert Marko spake thusly:
> GCC14 now treats implicit int types as error so when check() from
> check-lxdialog.sh is called to check whether we can link against ncurses
> it will fail silently and the help text indicating to install ncurses is
> printed.
>
> However, this is not due to missing ncurses but once the stderr redirect
> to /dev/null is removed we can see the root cause:
> <stdin>:2:1: error: return type defaults to ‘int’ [-Wimplicit-int]
>
> So, in order for menuconfig to work with GCC14 lets just specify the
> return type of main() as int.
I've also added a little note that there is no commit from the kernel
tree that we can backport, because the kernel tree no longer has that
script.
> Signed-off-by: Robert Marko <robimarko@gmail.com>
> Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
> Tested-by: Petr Vorel <petr.vorel@gmail.com>
Applied to master with the little note abouve added, thanks.
Regards,
Yann E. MORIN.
> ---
> support/kconfig/lxdialog/check-lxdialog.sh | 2 +-
> ...config-lxdialog-fix-check-with-GCC14.patch | 43 +++++++++++++++++++
> support/kconfig/patches/series | 1 +
> 3 files changed, 45 insertions(+), 1 deletion(-)
> create mode 100644 support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
>
> diff --git a/support/kconfig/lxdialog/check-lxdialog.sh b/support/kconfig/lxdialog/check-lxdialog.sh
> index 16cd9a3186..27d6c30a57 100755
> --- a/support/kconfig/lxdialog/check-lxdialog.sh
> +++ b/support/kconfig/lxdialog/check-lxdialog.sh
> @@ -48,7 +48,7 @@ trap "rm -f $tmp" 0 1 2 3 15
> check() {
> $cc -x c - -o $tmp 2>/dev/null <<'EOF'
> #include CURSES_LOC
> -main() {}
> +int main() {}
> EOF
> if [ $? != 0 ]; then
> echo " *** Unable to find the ncurses libraries or the" 1>&2
> diff --git a/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> new file mode 100644
> index 0000000000..41081bb45d
> --- /dev/null
> +++ b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> @@ -0,0 +1,43 @@
> +From 3ae91337b53fa3ccf0bad7f181fcaf483fab22ee Mon Sep 17 00:00:00 2001
> +From: Robert Marko <robimarko@gmail.com>
> +Date: Wed, 3 Apr 2024 14:18:07 +0200
> +Subject: [PATCH] kconfig/lxdialog: fix check() with GCC14
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +GCC14 now treats implicit int types as error so when check() from
> +check-lxdialog.sh is called to check whether we can link against ncurses
> +it will fail silently and the help text indicating to install ncurses is
> +printed.
> +
> +However, this is not due to missing ncurses but once the stderr redirect
> +to /dev/null is removed we can see the root cause:
> +<stdin>:2:1: error: return type defaults to ‘int’ [-Wimplicit-int]
> +
> +So, in order for menuconfig to work with GCC14 lets just specify the
> +return type of main() as int.
> +
> +Signed-off-by: Robert Marko <robimarko@gmail.com>
> +Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
> +Tested-by: Petr Vorel <petr.vorel@gmail.com>
> +---
> + kconfig/lxdialog/check-lxdialog.sh | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/kconfig/lxdialog/check-lxdialog.sh b/kconfig/lxdialog/check-lxdialog.sh
> +index 16cd9a3186..27d6c30a57 100755
> +--- a/kconfig/lxdialog/check-lxdialog.sh
> ++++ b/kconfig/lxdialog/check-lxdialog.sh
> +@@ -48,7 +48,7 @@ trap "rm -f $tmp" 0 1 2 3 15
> + check() {
> + $cc -x c - -o $tmp 2>/dev/null <<'EOF'
> + #include CURSES_LOC
> +-main() {}
> ++int main() {}
> + EOF
> + if [ $? != 0 ]; then
> + echo " *** Unable to find the ncurses libraries or the" 1>&2
> +--
> +2.44.0
> +
> diff --git a/support/kconfig/patches/series b/support/kconfig/patches/series
> index e5a6f69d8f..f120e323b7 100644
> --- a/support/kconfig/patches/series
> +++ b/support/kconfig/patches/series
> @@ -10,3 +10,4 @@
> 19-merge_config.sh-add-br2-external-support.patch
> 20-merge_config.sh-Allow-to-define-config-prefix.patch
> 21-Avoid-false-positive-matches-from-comment-lines.patch
> +22-kconfig-lxdialog-fix-check-with-GCC14.patch
> --
> 2.44.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Buildroot] [PATCH v2 1/1] kconfig/lxdialog: fix check() with GCC14
2024-04-30 18:01 ` Yann E. MORIN
@ 2024-05-15 13:22 ` Peter Korsgaard
0 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2024-05-15 13:22 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: Petr Vorel, Robert Marko, buildroot
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
> Robert, All,
> On 2024-04-08 23:16 +0200, Robert Marko spake thusly:
>> GCC14 now treats implicit int types as error so when check() from
>> check-lxdialog.sh is called to check whether we can link against ncurses
>> it will fail silently and the help text indicating to install ncurses is
>> printed.
>>
>> However, this is not due to missing ncurses but once the stderr redirect
>> to /dev/null is removed we can see the root cause:
>> <stdin>:2:1: error: return type defaults to ‘int’ [-Wimplicit-int]
>>
>> So, in order for menuconfig to work with GCC14 lets just specify the
>> return type of main() as int.
> I've also added a little note that there is no commit from the kernel
> tree that we can backport, because the kernel tree no longer has that
> script.
>> Signed-off-by: Robert Marko <robimarko@gmail.com>
>> Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
>> Tested-by: Petr Vorel <petr.vorel@gmail.com>
> Applied to master with the little note abouve added, thanks.
Committed to 2024.02.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-15 13:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-08 21:16 [Buildroot] [PATCH v2 1/1] kconfig/lxdialog: fix check() with GCC14 Robert Marko
2024-04-08 22:45 ` Petr Vorel
2024-04-30 18:01 ` Yann E. MORIN
2024-05-15 13:22 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.