When build on Debian 11 (gcc10), squid fails to build[0] because of a
bug[1] in the configure step (it mixes options between old native compiler
and recent target compiler: the former needs the std=c++17 option, the latter
doesn't).

The workaround is to force the "-std=c++17" option for the native build.

NB: Our Buildroot friends have the same workaround[2].

[0]: 
https://autobuilder.yoctoproject.org/typhoon/#/builders/155/builds/23/steps/28/logs/stdio
[1]: https://bugs.squid-cache.org/show_bug.cgi?id=5376
     Bug closed as invalid by upstream
[2]: 
https://github.com/buildroot/buildroot/blob/932b52fad87d79d9f26a343edafe2981079de16e/package/squid/squid.mk#L24

Signed-off-by: Yoann Congal <[email protected]>
Reviewed-by: Alexandre Truong <[email protected]>
---
I'm not 100% sure that all the host compiler of all the supported
distributions take the "-std=c++17" option. I've tested it only on
Debian11&12.
---
 meta-networking/recipes-daemons/squid/squid_6.9.bb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta-networking/recipes-daemons/squid/squid_6.9.bb 
b/meta-networking/recipes-daemons/squid/squid_6.9.bb
index f0663a5e04..33d286e122 100644
--- a/meta-networking/recipes-daemons/squid/squid_6.9.bb
+++ b/meta-networking/recipes-daemons/squid/squid_6.9.bb
@@ -68,6 +68,11 @@ EXTRA_OECONF += "--with-default-user=squid \
                  --with-logdir=${localstatedir}/log/${BPN} \
                  'PERL=${USRBINPATH}/env perl'"
 
+# Workaround a build failure when using a native compiler that need -std=c++17
+# with a cross-compiler that doesn't.
+# Upstream issue closed as invalid : 
https://bugs.squid-cache.org/show_bug.cgi?id=5376
+BUILD_CXXFLAGS += "-std=c++17"
+
 export BUILDCXXFLAGS="${BUILD_CXXFLAGS}"
 
 TESTDIR = "test-suite"
-- 
2.39.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#110431): 
https://lists.openembedded.org/g/openembedded-devel/message/110431
Mute This Topic: https://lists.openembedded.org/mt/106155607/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to