Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] package/ntpsec: fix host building
@ 2024-08-20 17:23 Dario Binacchi
  2024-08-20 21:36 ` Thomas Petazzoni via buildroot
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dario Binacchi @ 2024-08-20 17:23 UTC (permalink / raw)
  To: buildroot; +Cc: Dario Binacchi, linux-amarula, Thomas Petazzoni

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'

reveals that the target's CFLAGS are being used for host compilation.
The patch fixes the host compilation by correctly setting the CFLAGS to
be used.

It should be noted that the build script used by ntpsec applies CFLAGS
for host compilation and --cross-cflags for target compilation.

Fixes:
 - http://autobuild.buildroot.org/results/9321a637f2c340ce8dcb24249676bb6c44d0dfc6

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
Changes v1 -> v2:
  - Rework the patch following the suggestion of Thomas Petazzoni.
  - Update the commit message

 package/ntpsec/ntpsec.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/ntpsec/ntpsec.mk b/package/ntpsec/ntpsec.mk
index 661af788423c..3acf7745cf07 100644
--- a/package/ntpsec/ntpsec.mk
+++ b/package/ntpsec/ntpsec.mk
@@ -42,6 +42,7 @@ NTPSEC_DEPENDENCIES = \
 # --cross-compiler
 NTPSEC_CONF_OPTS = \
 	CC="$(HOSTCC)" \
+	CFLAGS="$(HOST_CFLAGS)" \
 	PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python3-config" \
 	--libdir=/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/ntp \
 	--cross-compiler="$(TARGET_CC)" \
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-09-18 11:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 17:23 [Buildroot] [PATCH v2] package/ntpsec: fix host building Dario Binacchi
2024-08-20 21:36 ` Thomas Petazzoni via buildroot
2024-08-20 21:36 ` Yann E. MORIN
2024-08-20 21:41   ` Yann E. MORIN
2024-09-18 11:14 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox