* [Buildroot] [PATCH 1/1] package/ntpsec: fix build on xtensa
@ 2024-07-27 9:40 Dario Binacchi
2024-07-27 14:13 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Dario Binacchi @ 2024-07-27 9:40 UTC (permalink / raw)
To: buildroot; +Cc: Dario Binacchi
Fix the following build failure on xtensa:
Waf: Entering directory `/home/buildroot/instance-0/output-1/build/ntpsec-1.2.3/build/host'
[1/2] Processing ntpd/ntp_parser.y
[2/2] Compiling build/host/ntpd/ntp_parser.tab.c
gcc: error: unrecognized command-line option '-mlongcalls'
gcc: error: unrecognized command-line option '-mauto-litpools'
The 'longcalls' and 'auto-litpools' options are added to CFLAGS for
xtensa in package/Makefile.in, but as highlighted by the error message,
in this case, the options need to be removed.
Fixes:
- http://autobuild.buildroot.org/results/9321a637f2c340ce8dcb24249676bb6c44d0dfc6
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
package/ntpsec/ntpsec.mk | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/package/ntpsec/ntpsec.mk b/package/ntpsec/ntpsec.mk
index 661af788423c..70c993ba6b10 100644
--- a/package/ntpsec/ntpsec.mk
+++ b/package/ntpsec/ntpsec.mk
@@ -37,6 +37,9 @@ NTPSEC_DEPENDENCIES = \
libcap \
openssl
+NTPSEC_TARGET_CFLAGS = \
+ $(filter-out mlongcalls -mauto-litpools,$(TARGET_CFLAGS))
+
# CC="$(HOSTCC)" is strange but needed to build some host tools, the
# cross-compiler will properly be used to build target code thanks to
# --cross-compiler
@@ -45,7 +48,7 @@ NTPSEC_CONF_OPTS = \
PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python3-config" \
--libdir=/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/ntp \
--cross-compiler="$(TARGET_CC)" \
- --cross-cflags="$(TARGET_CFLAGS) -std=gnu99" \
+ --cross-cflags="$(NTSPEC_TARGET_CFLAGS) -std=gnu99" \
--cross-ldflags="$(TARGET_LDFLAGS)" \
--notests \
--enable-early-droproot \
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/ntpsec: fix build on xtensa
2024-07-27 9:40 [Buildroot] [PATCH 1/1] package/ntpsec: fix build on xtensa Dario Binacchi
@ 2024-07-27 14:13 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-27 14:13 UTC (permalink / raw)
To: Dario Binacchi; +Cc: buildroot
Hello Dario,
On Sat, 27 Jul 2024 11:40:29 +0200
Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:
> Fix the following build failure on xtensa:
>
> Waf: Entering directory `/home/buildroot/instance-0/output-1/build/ntpsec-1.2.3/build/host'
> [1/2] Processing ntpd/ntp_parser.y
> [2/2] Compiling build/host/ntpd/ntp_parser.tab.c
> gcc: error: unrecognized command-line option '-mlongcalls'
> gcc: error: unrecognized command-line option '-mauto-litpools'
Thanks for the patch, but I'm pretty sure this is not the right fix.
You can see from the error message above that what is happening here is
that those flags, which are target CFLAGS, are passed to the host
compiler "gcc".
So your patch is not correct in several ways:
- It will not solve the problem of other target CFLAGS used for other
CPU architectures, which are also not supported by the host gcc
compiler
- It drops those target CFLAGS from the build of target code, which is
not correct, as if some flags are present, there's a good reason for
that.
So, the correct fix is to look in more details into the ntpsec build
system, and make sure it doesn't use target CFLAGS when building host
code.
Could you have a look into this?
Thanks a lot,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-27 14:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-27 9:40 [Buildroot] [PATCH 1/1] package/ntpsec: fix build on xtensa Dario Binacchi
2024-07-27 14:13 ` Thomas Petazzoni via buildroot
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.