diff mbox series

[1/1] package/grpc: fix build with libexecinfo

Message ID 20220315173231.1943484-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/1] package/grpc: fix build with libexecinfo | expand

Commit Message

Fabrice Fontaine March 15, 2022, 5:32 p.m. UTC
Fix the following build failure raised on uclibc and musl since the
reintroduction of the package in commit
16ff948444c3978d63f483344a3d92d994c64312:

/home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: /home/buildroot/autobuild/instance-1/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libabsl_stacktrace.so.2111.0.0: undefined reference to `backtrace'

Fixes:
 - http://autobuild.buildroot.org/results/63ab2bc86cad03d5258492b17d1707078761d9b3

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/grpc/grpc.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Arnout Vandecappelle March 24, 2022, 9:12 p.m. UTC | #1
On 15/03/2022 18:32, Fabrice Fontaine wrote:
> Fix the following build failure raised on uclibc and musl since the
> reintroduction of the package in commit
> 16ff948444c3978d63f483344a3d92d994c64312:
> 
> /home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: /home/buildroot/autobuild/instance-1/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libabsl_stacktrace.so.2111.0.0: undefined reference to `backtrace'
> 
> Fixes:
>   - http://autobuild.buildroot.org/results/63ab2bc86cad03d5258492b17d1707078761d9b3
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   package/grpc/grpc.mk | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/package/grpc/grpc.mk b/package/grpc/grpc.mk
> index 23b92f1750..9138b4ea59 100644
> --- a/package/grpc/grpc.mk
> +++ b/package/grpc/grpc.mk
> @@ -21,6 +21,7 @@ HOST_GRPC_DEPENDENCIES = host-protobuf
>   # which doesn't do this.  These CARES settings trick the gRPC cmake code into
>   # not looking for c-ares at all and yet still linking with the library.
>   GRPC_CONF_OPTS = \
> +	-DCMAKE_EXE_LINKER_FLAGS="$(GRPC_EXE_LINKER_FLAGS)" \
>   	-DgRPC_ABSL_PROVIDER=package \
>   	-D_gRPC_CARES_LIBRARIES=cares \
>   	-DgRPC_CARES_PROVIDER=none \
> @@ -36,10 +37,15 @@ GRPC_CONF_OPTS = \
>   	-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
>   	-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF
>   
> +ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
> +GRPC_DEPENDENCIES += libexecinfo
> +GRPC_EXE_LINKER_FLAGS += -lexecinfo
> +endif
> +
>   # grpc can use __atomic builtins, so we need to link with
>   # libatomic when available
>   ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
> -GRPC_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
> +GRPC_EXE_LINKER_FLAGS += -latomic
>   endif
>   
>   GRPC_CFLAGS = $(TARGET_CFLAGS)
Peter Korsgaard March 29, 2022, 7:52 p.m. UTC | #2
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix the following build failure raised on uclibc and musl since the
 > reintroduction of the package in commit
 > 16ff948444c3978d63f483344a3d92d994c64312:

Huh? This is the commit where ola was reintroduced, but this is a
failure in grpc and the config doesn't even have ola enabled?

 > /home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld:
 > /home/buildroot/autobuild/instance-1/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libabsl_stacktrace.so.2111.0.0:
 > undefined reference to `backtrace'

 > Fixes:
 >  - http://autobuild.buildroot.org/results/63ab2bc86cad03d5258492b17d1707078761d9b3

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 > ---
 >  package/grpc/grpc.mk | 8 +++++++-
 >  1 file changed, 7 insertions(+), 1 deletion(-)

 > diff --git a/package/grpc/grpc.mk b/package/grpc/grpc.mk
 > index 23b92f1750..9138b4ea59 100644
 > --- a/package/grpc/grpc.mk
 > +++ b/package/grpc/grpc.mk
 > @@ -21,6 +21,7 @@ HOST_GRPC_DEPENDENCIES = host-protobuf
 >  # which doesn't do this.  These CARES settings trick the gRPC cmake code into
 >  # not looking for c-ares at all and yet still linking with the library.
 >  GRPC_CONF_OPTS = \
 > +	-DCMAKE_EXE_LINKER_FLAGS="$(GRPC_EXE_LINKER_FLAGS)" \
 >  	-DgRPC_ABSL_PROVIDER=package \
 >  	-D_gRPC_CARES_LIBRARIES=cares \
 >  	-DgRPC_CARES_PROVIDER=none \
 > @@ -36,10 +37,15 @@ GRPC_CONF_OPTS = \
 >  	-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
 >  	-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF
 
 > +ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
 > +GRPC_DEPENDENCIES += libexecinfo
 > +GRPC_EXE_LINKER_FLAGS += -lexecinfo
 > +endif
 > +
 >  # grpc can use __atomic builtins, so we need to link with
 >  # libatomic when available
 >  ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
 > -GRPC_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
 > +GRPC_EXE_LINKER_FLAGS += -latomic
 >  endif
 
 >  GRPC_CFLAGS = $(TARGET_CFLAGS)
 > -- 

 > 2.35.1

 > _______________________________________________
 > buildroot mailing list
 > buildroot@buildroot.org
 > https://lists.buildroot.org/mailman/listinfo/buildroot
Fabrice Fontaine March 29, 2022, 9:22 p.m. UTC | #3
Le mar. 29 mars 2022 à 21:53, Peter Korsgaard <peter@korsgaard.com> a écrit :
>
> >>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
>
>  > Fix the following build failure raised on uclibc and musl since the
>  > reintroduction of the package in commit
>  > 16ff948444c3978d63f483344a3d92d994c64312:
>
> Huh? This is the commit where ola was reintroduced, but this is a
> failure in grpc and the config doesn't even have ola enabled?

Indeed, I made a copy / paste error, the correct commit message should
have been:
"Fix the following build failure raised on uclibc and musl since the
addition of libexecinfo package in commit
eea8ba446c10701a273432552108d80fb2224ef4"

>
>  > /home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld:
>  > /home/buildroot/autobuild/instance-1/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libabsl_stacktrace.so.2111.0.0:
>  > undefined reference to `backtrace'
>
>  > Fixes:
>  >  - http://autobuild.buildroot.org/results/63ab2bc86cad03d5258492b17d1707078761d9b3
>
>  > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>  > ---
>  >  package/grpc/grpc.mk | 8 +++++++-
>  >  1 file changed, 7 insertions(+), 1 deletion(-)
>
>  > diff --git a/package/grpc/grpc.mk b/package/grpc/grpc.mk
>  > index 23b92f1750..9138b4ea59 100644
>  > --- a/package/grpc/grpc.mk
>  > +++ b/package/grpc/grpc.mk
>  > @@ -21,6 +21,7 @@ HOST_GRPC_DEPENDENCIES = host-protobuf
>  >  # which doesn't do this.  These CARES settings trick the gRPC cmake code into
>  >  # not looking for c-ares at all and yet still linking with the library.
>  >  GRPC_CONF_OPTS = \
>  > +    -DCMAKE_EXE_LINKER_FLAGS="$(GRPC_EXE_LINKER_FLAGS)" \
>  >      -DgRPC_ABSL_PROVIDER=package \
>  >      -D_gRPC_CARES_LIBRARIES=cares \
>  >      -DgRPC_CARES_PROVIDER=none \
>  > @@ -36,10 +37,15 @@ GRPC_CONF_OPTS = \
>  >      -DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
>  >      -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF
>
>  > +ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
>  > +GRPC_DEPENDENCIES += libexecinfo
>  > +GRPC_EXE_LINKER_FLAGS += -lexecinfo
>  > +endif
>  > +
>  >  # grpc can use __atomic builtins, so we need to link with
>  >  # libatomic when available
>  >  ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
>  > -GRPC_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
>  > +GRPC_EXE_LINKER_FLAGS += -latomic
>  >  endif
>
>  >  GRPC_CFLAGS = $(TARGET_CFLAGS)
>  > --
>
>  > 2.35.1
>
>  > _______________________________________________
>  > buildroot mailing list
>  > buildroot@buildroot.org
>  > https://lists.buildroot.org/mailman/listinfo/buildroot
>
>
> --
> Bye, Peter Korsgaard

Best Regards,

Fabrice
Peter Korsgaard March 30, 2022, 7:52 a.m. UTC | #4
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Le mar. 29 mars 2022 à 21:53, Peter Korsgaard <peter@korsgaard.com> a écrit :
 >> 
 >> >>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
 >> 
 >> > Fix the following build failure raised on uclibc and musl since the
 >> > reintroduction of the package in commit
 >> > 16ff948444c3978d63f483344a3d92d994c64312:
 >> 
 >> Huh? This is the commit where ola was reintroduced, but this is a
 >> failure in grpc and the config doesn't even have ola enabled?

 > Indeed, I made a copy / paste error, the correct commit message should
 > have been:
 > "Fix the following build failure raised on uclibc and musl since the
 > addition of libexecinfo package in commit
 > eea8ba446c10701a273432552108d80fb2224ef4"

Ahh, so it also applies to the version we have in 2022.02.x (1.43.0)?
Strangely enough we only have autobuilder failures for 1.44.0.
Fabrice Fontaine March 30, 2022, 9:53 a.m. UTC | #5
Le mer. 30 mars 2022 à 09:52, Peter Korsgaard <peter@korsgaard.com> a écrit :
>
> >>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
>
>  > Le mar. 29 mars 2022 à 21:53, Peter Korsgaard <peter@korsgaard.com> a écrit :
>  >>
>  >> >>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
>  >>
>  >> > Fix the following build failure raised on uclibc and musl since the
>  >> > reintroduction of the package in commit
>  >> > 16ff948444c3978d63f483344a3d92d994c64312:
>  >>
>  >> Huh? This is the commit where ola was reintroduced, but this is a
>  >> failure in grpc and the config doesn't even have ola enabled?
>
>  > Indeed, I made a copy / paste error, the correct commit message should
>  > have been:
>  > "Fix the following build failure raised on uclibc and musl since the
>  > addition of libexecinfo package in commit
>  > eea8ba446c10701a273432552108d80fb2224ef4"
>
> Ahh, so it also applies to the version we have in 2022.02.x (1.43.0)?
> Strangely enough we only have autobuilder failures for 1.44.0.

After further investigation, the build failure is raised by a library
provided by libabseil-cpp.
libabseil-cpp uses execinfo.h since version 20210324.0 and
https://github.com/abseil/abseil-cpp/commit/dc969f34a79d019497abb61c2a3f79b5b4be2ea9

2022.02.x uses 20211102.0 so I think this patch should be applied to
this branch.

>
> --
> Bye, Peter Korsgaard
Best Regards,

Fabrice
diff mbox series

Patch

diff --git a/package/grpc/grpc.mk b/package/grpc/grpc.mk
index 23b92f1750..9138b4ea59 100644
--- a/package/grpc/grpc.mk
+++ b/package/grpc/grpc.mk
@@ -21,6 +21,7 @@  HOST_GRPC_DEPENDENCIES = host-protobuf
 # which doesn't do this.  These CARES settings trick the gRPC cmake code into
 # not looking for c-ares at all and yet still linking with the library.
 GRPC_CONF_OPTS = \
+	-DCMAKE_EXE_LINKER_FLAGS="$(GRPC_EXE_LINKER_FLAGS)" \
 	-DgRPC_ABSL_PROVIDER=package \
 	-D_gRPC_CARES_LIBRARIES=cares \
 	-DgRPC_CARES_PROVIDER=none \
@@ -36,10 +37,15 @@  GRPC_CONF_OPTS = \
 	-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
 	-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF
 
+ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
+GRPC_DEPENDENCIES += libexecinfo
+GRPC_EXE_LINKER_FLAGS += -lexecinfo
+endif
+
 # grpc can use __atomic builtins, so we need to link with
 # libatomic when available
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
-GRPC_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
+GRPC_EXE_LINKER_FLAGS += -latomic
 endif
 
 GRPC_CFLAGS = $(TARGET_CFLAGS)