Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/grpc: add explicitly link with libatomic
@ 2018-12-07 17:12 Ryan Barnett
  2018-12-07 18:03 ` robert rose
  2018-12-31 14:54 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Ryan Barnett @ 2018-12-07 17:12 UTC (permalink / raw)
  To: buildroot

On some architectures, you must link with libatomic, on some other
architectures, they are available built-in, but in all cases, linking
against libatomic does not harm.

Fixes:
  http://autobuild.buildroot.org/results/2f2/2f208fbfe4e9da94be5b9c030dbd278cb8ba053c/

Signed-off-by: Ryan Barnett <ryan.barnett@rockwellcollins.com>
---
 package/grpc/grpc.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/grpc/grpc.mk b/package/grpc/grpc.mk
index 6ca6536fff..527c7fa7e2 100644
--- a/package/grpc/grpc.mk
+++ b/package/grpc/grpc.mk
@@ -23,6 +23,12 @@ GRPC_CONF_OPTS = \
 	-DgRPC_ZLIB_PROVIDER=package \
 	-DgRPC_NATIVE_CPP_PLUGIN=$(HOST_DIR)/bin/grpc_cpp_plugin
 
+# grpc can uses __atomic builtins, so we need to link with
+# libatomic for the architectures who need libatomic.
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+GRPC_CONF_OPTS += -DCMAKE_C_STANDARD_LIBRARIES="-latomic"
+endif
+
 HOST_GRPC_CONF_OPTS = \
 	-D_gRPC_CARES_LIBRARIES=cares \
 	-DgRPC_CARES_PROVIDER=none \
-- 
2.17.1

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

* [Buildroot] [PATCH 1/1] package/grpc: add explicitly link with libatomic
  2018-12-07 17:12 [Buildroot] [PATCH 1/1] package/grpc: add explicitly link with libatomic Ryan Barnett
@ 2018-12-07 18:03 ` robert rose
  2018-12-31 14:54 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: robert rose @ 2018-12-07 18:03 UTC (permalink / raw)
  To: buildroot

Reviewed-by: Robert Rose <robertroyrose@gmail.com>

On Fri, Dec 7, 2018 at 9:12 AM Ryan Barnett <
ryan.barnett@rockwellcollins.com> wrote:

> On some architectures, you must link with libatomic, on some other
> architectures, they are available built-in, but in all cases, linking
> against libatomic does not harm.
>
> Fixes:
>
> http://autobuild.buildroot.org/results/2f2/2f208fbfe4e9da94be5b9c030dbd278cb8ba053c/
>
> Signed-off-by: Ryan Barnett <ryan.barnett@rockwellcollins.com>
> ---
>  package/grpc/grpc.mk | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/package/grpc/grpc.mk b/package/grpc/grpc.mk
> index 6ca6536fff..527c7fa7e2 100644
> --- a/package/grpc/grpc.mk
> +++ b/package/grpc/grpc.mk
> @@ -23,6 +23,12 @@ GRPC_CONF_OPTS = \
>         -DgRPC_ZLIB_PROVIDER=package \
>         -DgRPC_NATIVE_CPP_PLUGIN=$(HOST_DIR)/bin/grpc_cpp_plugin
>
> +# grpc can uses __atomic builtins, so we need to link with
> +# libatomic for the architectures who need libatomic.
> +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
> +GRPC_CONF_OPTS += -DCMAKE_C_STANDARD_LIBRARIES="-latomic"
> +endif
> +
>  HOST_GRPC_CONF_OPTS = \
>         -D_gRPC_CARES_LIBRARIES=cares \
>         -DgRPC_CARES_PROVIDER=none \
> --
> 2.17.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20181207/f3b0fdcf/attachment.html>

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

* [Buildroot] [PATCH 1/1] package/grpc: add explicitly link with libatomic
  2018-12-07 17:12 [Buildroot] [PATCH 1/1] package/grpc: add explicitly link with libatomic Ryan Barnett
  2018-12-07 18:03 ` robert rose
@ 2018-12-31 14:54 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2018-12-31 14:54 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri,  7 Dec 2018 11:12:41 -0600, Ryan Barnett wrote:
> On some architectures, you must link with libatomic, on some other
> architectures, they are available built-in, but in all cases, linking
> against libatomic does not harm.
> 
> Fixes:
>   http://autobuild.buildroot.org/results/2f2/2f208fbfe4e9da94be5b9c030dbd278cb8ba053c/
> 
> Signed-off-by: Ryan Barnett <ryan.barnett@rockwellcollins.com>

It's a bit more complicated than that:

 - If it uses atomic built-ins, one needs to "depends on
   BR2_TOOLCHAIN_HAS_ATOMIC"

 - It can also use sync builtins.

So I've fixed that up, and applied your patch with the following
changes:

    [Thomas:
     - add the dependency on sync or atomic builtins in Config.in
     - use -DCMAKE_EXE_LINKER_FLAGS instead of
       -DCMAKE_C_STANDARD_LIBRARIES, to be consistent with what we do in
       some other cmake-based packages
     - tweak commit log]

Best regards,

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

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

end of thread, other threads:[~2018-12-31 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-07 17:12 [Buildroot] [PATCH 1/1] package/grpc: add explicitly link with libatomic Ryan Barnett
2018-12-07 18:03 ` robert rose
2018-12-31 14:54 ` Thomas Petazzoni

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