All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH/next 1/2] squid: remove gnu atomics handling
@ 2018-11-24 14:54 Fabrice Fontaine
  2018-11-24 14:54 ` [Buildroot] [PATCH/next 2/2] squid: needs atomic Fabrice Fontaine
  2018-11-29 21:58 ` [Buildroot] [PATCH/next 1/2] squid: remove gnu atomics handling Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2018-11-24 14:54 UTC (permalink / raw)
  To: buildroot

gnu atomics has been removed since version 3.5.27:
https://github.com/squid-cache/squid/commit/ddd4edb743d82be97fc651d529e04bf55329a50d
So remove squid_cv_gnu_atomics handling

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/squid/squid.mk | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/package/squid/squid.mk b/package/squid/squid.mk
index b661d5d133..2b6c830a62 100644
--- a/package/squid/squid.mk
+++ b/package/squid/squid.mk
@@ -38,15 +38,6 @@ SQUID_CONF_OPTS = \
 	--with-swapdir=/var/cache/squid/ \
 	--with-default-user=squid
 
-# Atomics in Squid use __sync built-ins on 4 and 8 bytes. However, the
-# configure script tests them using AC_TRY_RUN, so we have to give
-# some hints.
-ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_4)$(BR2_TOOLCHAIN_HAS_SYNC_8),yy)
-SQUID_CONF_ENV += squid_cv_gnu_atomics=yes
-else
-SQUID_CONF_ENV += squid_cv_gnu_atomics=no
-endif
-
 ifeq ($(BR2_PACKAGE_LIBKRB5),y)
 SQUID_CONF_OPTS += --with-mit-krb5
 SQUID_DEPENDENCIES += libkrb5
-- 
2.17.1

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

* [Buildroot] [PATCH/next 2/2] squid: needs atomic
  2018-11-24 14:54 [Buildroot] [PATCH/next 1/2] squid: remove gnu atomics handling Fabrice Fontaine
@ 2018-11-24 14:54 ` Fabrice Fontaine
  2018-11-29 21:58   ` Thomas Petazzoni
  2018-11-29 21:58 ` [Buildroot] [PATCH/next 1/2] squid: remove gnu atomics handling Thomas Petazzoni
  1 sibling, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2018-11-24 14:54 UTC (permalink / raw)
  To: buildroot

Since https://github.com/squid-cache/squid/commit/4b0f89121135aae68fbaf2aa33b5fb2e0da66d3e
squid tries to find if latomic is needed through:
AC_SEARCH_LIBS([__atomic_load_8],[atomic],[ATOMICLIB="-latomic"],[])

However, this can fails on:
configure:21147: /home/fabrice/buildroot/output/host/bin/arc-buildroot-linux-gnu-g++ -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -matomic -Os   -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g conftest.cpp -latomic   >&5
conftest.cpp:55:6: error: new declaration 'char __atomic_load_8()' ambiguates built-in declaration 'long long unsigned int __atomic_load_8(const volatile void*, int)' [-fpermissive]
 char __atomic_load_8 ();
      ^~~~~~~~~~~~~~~
conftest.cpp: In function 'int main()':
conftest.cpp:59:25: error: too few arguments to function 'long long unsigned int __atomic_load_8(const volatile void*, int)'
 return __atomic_load_8 ();

So add -latomic to LIBS if BR2_TOOLCHAIN_HAS_LIBATOMIC is set

Fixes:
 - http://autobuild.buildroot.org/results/13082cea836a12ac8bf85cbdb53a56a5d30c70b1

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/squid/Config.in | 2 ++
 package/squid/squid.mk  | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/package/squid/Config.in b/package/squid/Config.in
index 50f65de433..726160b01d 100644
--- a/package/squid/Config.in
+++ b/package/squid/Config.in
@@ -1,10 +1,12 @@
 comment "squid needs a toolchain w/ C++, gcc >= 4.8 not affected by bug 64735"
 	depends on BR2_USE_MMU
+	depends on BR2_TOOLCHAIN_HAS_ATOMIC
 	depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735 || \
 		!BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
 
 config BR2_PACKAGE_SQUID
 	bool "squid"
+	depends on BR2_TOOLCHAIN_HAS_ATOMIC
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # std::current_exception
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
diff --git a/package/squid/squid.mk b/package/squid/squid.mk
index 2b6c830a62..4a3318b40b 100644
--- a/package/squid/squid.mk
+++ b/package/squid/squid.mk
@@ -38,6 +38,10 @@ SQUID_CONF_OPTS = \
 	--with-swapdir=/var/cache/squid/ \
 	--with-default-user=squid
 
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+SQUID_CONF_ENV += LIBS=-latomic
+endif
+
 ifeq ($(BR2_PACKAGE_LIBKRB5),y)
 SQUID_CONF_OPTS += --with-mit-krb5
 SQUID_DEPENDENCIES += libkrb5
-- 
2.17.1

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

* [Buildroot] [PATCH/next 1/2] squid: remove gnu atomics handling
  2018-11-24 14:54 [Buildroot] [PATCH/next 1/2] squid: remove gnu atomics handling Fabrice Fontaine
  2018-11-24 14:54 ` [Buildroot] [PATCH/next 2/2] squid: needs atomic Fabrice Fontaine
@ 2018-11-29 21:58 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2018-11-29 21:58 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 24 Nov 2018 15:54:49 +0100, Fabrice Fontaine wrote:
> gnu atomics has been removed since version 3.5.27:
> https://github.com/squid-cache/squid/commit/ddd4edb743d82be97fc651d529e04bf55329a50d
> So remove squid_cv_gnu_atomics handling
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/squid/squid.mk | 9 ---------
>  1 file changed, 9 deletions(-)

Applied to next, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH/next 2/2] squid: needs atomic
  2018-11-24 14:54 ` [Buildroot] [PATCH/next 2/2] squid: needs atomic Fabrice Fontaine
@ 2018-11-29 21:58   ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2018-11-29 21:58 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 24 Nov 2018 15:54:50 +0100, Fabrice Fontaine wrote:
> Since https://github.com/squid-cache/squid/commit/4b0f89121135aae68fbaf2aa33b5fb2e0da66d3e
> squid tries to find if latomic is needed through:
> AC_SEARCH_LIBS([__atomic_load_8],[atomic],[ATOMICLIB="-latomic"],[])
> 
> However, this can fails on:
> configure:21147: /home/fabrice/buildroot/output/host/bin/arc-buildroot-linux-gnu-g++ -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -matomic -Os   -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g conftest.cpp -latomic   >&5
> conftest.cpp:55:6: error: new declaration 'char __atomic_load_8()' ambiguates built-in declaration 'long long unsigned int __atomic_load_8(const volatile void*, int)' [-fpermissive]
>  char __atomic_load_8 ();
>       ^~~~~~~~~~~~~~~
> conftest.cpp: In function 'int main()':
> conftest.cpp:59:25: error: too few arguments to function 'long long unsigned int __atomic_load_8(const volatile void*, int)'
>  return __atomic_load_8 ();

I've applied to next, but could you fix the upstream code so that the
-latomic detection works correctly, and we can drop the workaround in
Buildroot at some point in the future ?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2018-11-29 21:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-24 14:54 [Buildroot] [PATCH/next 1/2] squid: remove gnu atomics handling Fabrice Fontaine
2018-11-24 14:54 ` [Buildroot] [PATCH/next 2/2] squid: needs atomic Fabrice Fontaine
2018-11-29 21:58   ` Thomas Petazzoni
2018-11-29 21:58 ` [Buildroot] [PATCH/next 1/2] squid: remove gnu atomics handling Thomas Petazzoni

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.