* [Buildroot] [PATCH v1] libdrm: fix libatomic_ops linking
@ 2017-12-16 19:55 Peter Seiderer
2017-12-17 12:12 ` Bernd Kuhls
2017-12-18 13:07 ` Thomas Petazzoni
0 siblings, 2 replies; 4+ messages in thread
From: Peter Seiderer @ 2017-12-16 19:55 UTC (permalink / raw)
To: buildroot
Add explicit libatomic_ops linking, fixes etnavid tests linking
Fixes [1]:
CCLD etnaviv_cmd_stream_test
../../etnaviv/.libs/libdrm_etnaviv.so: undefined reference to `AO_store_full_emulation'
../../etnaviv/.libs/libdrm_etnaviv.so: undefined reference to `AO_fetch_compare_and_swap_emulation'
collect2: error: ld returned 1 exit status
[1] http://autobuild.buildroot.net/results/92e074c49417261843eef95872ff935a56077c98
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
package/libdrm/libdrm.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/libdrm/libdrm.mk b/package/libdrm/libdrm.mk
index 3d7b67122b..ecc525ca1e 100644
--- a/package/libdrm/libdrm.mk
+++ b/package/libdrm/libdrm.mk
@@ -21,6 +21,7 @@ LIBDRM_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
ifeq ($(BR2_PACKAGE_LIBATOMIC_OPS),y)
LIBDRM_DEPENDENCIES += libatomic_ops
+LIBDRM_CONF_ENV += LIBS="-latomic_ops"
ifeq ($(BR2_sparc_v8)$(BR2_sparc_leon3),y)
LIBDRM_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -DAO_NO_SPARC_V9"
endif
--
2.15.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [Buildroot] [PATCH v1] libdrm: fix libatomic_ops linking
2017-12-16 19:55 [Buildroot] [PATCH v1] libdrm: fix libatomic_ops linking Peter Seiderer
@ 2017-12-17 12:12 ` Bernd Kuhls
2017-12-18 13:07 ` Thomas Petazzoni
1 sibling, 0 replies; 4+ messages in thread
From: Bernd Kuhls @ 2017-12-17 12:12 UTC (permalink / raw)
To: buildroot
Am Sat, 16 Dec 2017 20:55:16 +0100 schrieb Peter Seiderer:
> Add explicit libatomic_ops linking, fixes etnavid tests linking
>
> Fixes [1]:
>
> CCLD etnaviv_cmd_stream_test
> ../../etnaviv/.libs/libdrm_etnaviv.so: undefined reference to
> `AO_store_full_emulation' ../../etnaviv/.libs/libdrm_etnaviv.so:
> undefined reference to `AO_fetch_compare_and_swap_emulation'
> collect2: error: ld returned 1 exit status
>
> [1]
> http://autobuild.buildroot.net/
results/92e074c49417261843eef95872ff935a56077c98
Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
(build-tested using the defconfig mentioned here)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v1] libdrm: fix libatomic_ops linking
2017-12-16 19:55 [Buildroot] [PATCH v1] libdrm: fix libatomic_ops linking Peter Seiderer
2017-12-17 12:12 ` Bernd Kuhls
@ 2017-12-18 13:07 ` Thomas Petazzoni
2017-12-18 18:57 ` Peter Seiderer
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2017-12-18 13:07 UTC (permalink / raw)
To: buildroot
Hello,
On Sat, 16 Dec 2017 20:55:16 +0100, Peter Seiderer wrote:
> Add explicit libatomic_ops linking, fixes etnavid tests linking
>
> Fixes [1]:
>
> CCLD etnaviv_cmd_stream_test
> ../../etnaviv/.libs/libdrm_etnaviv.so: undefined reference to `AO_store_full_emulation'
> ../../etnaviv/.libs/libdrm_etnaviv.so: undefined reference to `AO_fetch_compare_and_swap_emulation'
> collect2: error: ld returned 1 exit status
>
> [1] http://autobuild.buildroot.net/results/92e074c49417261843eef95872ff935a56077c98
>
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> package/libdrm/libdrm.mk | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/package/libdrm/libdrm.mk b/package/libdrm/libdrm.mk
> index 3d7b67122b..ecc525ca1e 100644
> --- a/package/libdrm/libdrm.mk
> +++ b/package/libdrm/libdrm.mk
> @@ -21,6 +21,7 @@ LIBDRM_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
>
> ifeq ($(BR2_PACKAGE_LIBATOMIC_OPS),y)
> LIBDRM_DEPENDENCIES += libatomic_ops
> +LIBDRM_CONF_ENV += LIBS="-latomic_ops"
> ifeq ($(BR2_sparc_v8)$(BR2_sparc_leon3),y)
> LIBDRM_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -DAO_NO_SPARC_V9"
> endif
I think this is not the correct fix, because you will link against
atomic_ops as soon as libatomic_ops is available for the target, even
when libdrm doesn't need it (like when it uses the atomic built-ins of
the compiler).
I think the right approach is to fix libdrm instead to use pkg-config
to detect libatomic_ops and link against it when needed. See the
attached libdrm patch that does this (tested successfully with the
breaking SPARC configuration).
You just need to modify libdrm.mk for autoreconf, which includes the
need to add host-xutil_util-macros to the dependencies.
Could you have a look at this, and if it also works for you, submit it
as a patch?
Thanks a lot!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-configure-Makefile.am-use-pkg-config-to-discover-lib.patch
Type: text/x-patch
Size: 5811 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20171218/ff16bd45/attachment.bin>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v1] libdrm: fix libatomic_ops linking
2017-12-18 13:07 ` Thomas Petazzoni
@ 2017-12-18 18:57 ` Peter Seiderer
0 siblings, 0 replies; 4+ messages in thread
From: Peter Seiderer @ 2017-12-18 18:57 UTC (permalink / raw)
To: buildroot
Hello Thomas,
On Mon, 18 Dec 2017 14:07:02 +0100, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Sat, 16 Dec 2017 20:55:16 +0100, Peter Seiderer wrote:
> > Add explicit libatomic_ops linking, fixes etnavid tests linking
> >
> > Fixes [1]:
> >
> > CCLD etnaviv_cmd_stream_test
> > ../../etnaviv/.libs/libdrm_etnaviv.so: undefined reference to `AO_store_full_emulation'
> > ../../etnaviv/.libs/libdrm_etnaviv.so: undefined reference to `AO_fetch_compare_and_swap_emulation'
> > collect2: error: ld returned 1 exit status
> >
> > [1] http://autobuild.buildroot.net/results/92e074c49417261843eef95872ff935a56077c98
> >
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > ---
> > package/libdrm/libdrm.mk | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/package/libdrm/libdrm.mk b/package/libdrm/libdrm.mk
> > index 3d7b67122b..ecc525ca1e 100644
> > --- a/package/libdrm/libdrm.mk
> > +++ b/package/libdrm/libdrm.mk
> > @@ -21,6 +21,7 @@ LIBDRM_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
> >
> > ifeq ($(BR2_PACKAGE_LIBATOMIC_OPS),y)
> > LIBDRM_DEPENDENCIES += libatomic_ops
> > +LIBDRM_CONF_ENV += LIBS="-latomic_ops"
> > ifeq ($(BR2_sparc_v8)$(BR2_sparc_leon3),y)
> > LIBDRM_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -DAO_NO_SPARC_V9"
> > endif
>
> I think this is not the correct fix, because you will link against
> atomic_ops as soon as libatomic_ops is available for the target, even
> when libdrm doesn't need it (like when it uses the atomic built-ins of
> the compiler).
>
> I think the right approach is to fix libdrm instead to use pkg-config
> to detect libatomic_ops and link against it when needed. See the
> attached libdrm patch that does this (tested successfully with the
> breaking SPARC configuration).
>
> You just need to modify libdrm.mk for autoreconf, which includes the
> need to add host-xutil_util-macros to the dependencies.
>
> Could you have a look at this, and if it also works for you, submit it
> as a patch?
Works (and updated patch submitted)...
Regards,
Peter
>
> Thanks a lot!
>
> Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-18 18:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-16 19:55 [Buildroot] [PATCH v1] libdrm: fix libatomic_ops linking Peter Seiderer
2017-12-17 12:12 ` Bernd Kuhls
2017-12-18 13:07 ` Thomas Petazzoni
2017-12-18 18:57 ` Peter Seiderer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox