* [Buildroot] [PATCH 1/1] zeromq: fix static build with libatomic
@ 2018-09-13 18:24 Fabrice Fontaine
2018-09-13 18:59 ` Thomas Petazzoni
2018-10-01 19:32 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2018-09-13 18:24 UTC (permalink / raw)
To: buildroot
Second patch added support to link with -latomic if needed however using
LDFLAGS doesn't work when statically linking because LDFLAGS is added
before LIBS
Detection of atomic fails with:
configure:23230: /accts/mlweber1/instance-2/output/host/bin/sparc-linux-g++ -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static -static -pedantic -Werror -Wall -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -Wno-long-long -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -latomic conftest.cpp -lrt -lpthread -lstdc++ >&5
/tmp/ccgrvVTg.o: In function `main':
conftest.cpp:(.text.startup+0x10): undefined reference to `__atomic_fetch_add_4'
collect2: error: ld returned 1 exit status
So use LIBS instead of LDFLAGS
As second patch was already merged upstream, a new PR was sent:
https://github.com/zeromq/libzmq/pull/3250
Fixes:
- http://autobuild.buildroot.net/results/c471d6b1061a8516f7772735e471db68a32965aa
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
...cinclude.m4-check-if-latomic-is-needed.patch | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/package/zeromq/0002-acinclude.m4-check-if-latomic-is-needed.patch b/package/zeromq/0002-acinclude.m4-check-if-latomic-is-needed.patch
index a0c188a5c3..233b364662 100644
--- a/package/zeromq/0002-acinclude.m4-check-if-latomic-is-needed.patch
+++ b/package/zeromq/0002-acinclude.m4-check-if-latomic-is-needed.patch
@@ -11,9 +11,11 @@ try fails, we try to link again with -latomic and add LIBS="-latomic" in case we
succeeded.
Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Update to use LIBS: https://github.com/zeromq/libzmq/pull/3250]
---
- acinclude.m4 | 32 ++++++++++++++++++++++++++++----
- 1 file changed, 28 insertions(+), 4 deletions(-)
+ acinclude.m4 | 31 +++++++++++++++++++++++++++----
+ 1 file changed, 27 insertions(+), 4 deletions(-)
diff --git a/acinclude.m4 b/acinclude.m4
index f648ed0f..aa35195f 100644
@@ -28,7 +30,7 @@ index f648ed0f..aa35195f 100644
/* atomic intrinsics test */
int v = 0;
int main (int, char **)
-@@ -677,9 +677,33 @@ int main (int, char **)
+@@ -677,9 +677,32 @@ int main (int, char **)
return t;
}
])],
@@ -39,8 +41,8 @@ index f648ed0f..aa35195f 100644
+ [libzmq_cv_has_atomic_instrisics="no"])
+
+ if test "x$libzmq_cv_has_atomic_instrisics" = "xno"; then
-+ save_LDFLAGS=$LDFLAGS
-+ LDFLAGS="$LDFLAGS -latomic"
++ save_LIBS=$LIBS
++ LIBS="$LIBS -latomic"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([
+ /* atomic intrinsics test */
+ int v = 0;
@@ -50,9 +52,8 @@ index f648ed0f..aa35195f 100644
+ return t;
+ }
+ ])],
-+ [libzmq_cv_has_atomic_instrisics="yes" LIBS="-latomic"],
-+ [libzmq_cv_has_atomic_instrisics="no"])
-+ LDFLAGS=$save_LDFLAGS
++ [libzmq_cv_has_atomic_instrisics="yes"],
++ [libzmq_cv_has_atomic_instrisics="no" LIBS=$save_LIBS])
+ fi
+
+ if test "x$libzmq_cv_has_atomic_instrisics" = "xyes"; then
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/1] zeromq: fix static build with libatomic
2018-09-13 18:24 [Buildroot] [PATCH 1/1] zeromq: fix static build with libatomic Fabrice Fontaine
@ 2018-09-13 18:59 ` Thomas Petazzoni
2018-10-01 19:32 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2018-09-13 18:59 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 13 Sep 2018 20:24:19 +0200, Fabrice Fontaine wrote:
> Second patch added support to link with -latomic if needed however using
> LDFLAGS doesn't work when statically linking because LDFLAGS is added
> before LIBS
>
> Detection of atomic fails with:
>
> configure:23230: /accts/mlweber1/instance-2/output/host/bin/sparc-linux-g++ -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static -static -pedantic -Werror -Wall -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -Wno-long-long -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -latomic conftest.cpp -lrt -lpthread -lstdc++ >&5
> /tmp/ccgrvVTg.o: In function `main':
> conftest.cpp:(.text.startup+0x10): undefined reference to `__atomic_fetch_add_4'
> collect2: error: ld returned 1 exit status
>
> So use LIBS instead of LDFLAGS
>
> As second patch was already merged upstream, a new PR was sent:
> https://github.com/zeromq/libzmq/pull/3250
>
> Fixes:
> - http://autobuild.buildroot.net/results/c471d6b1061a8516f7772735e471db68a32965aa
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> ...cinclude.m4-check-if-latomic-is-needed.patch | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/1] zeromq: fix static build with libatomic
2018-09-13 18:24 [Buildroot] [PATCH 1/1] zeromq: fix static build with libatomic Fabrice Fontaine
2018-09-13 18:59 ` Thomas Petazzoni
@ 2018-10-01 19:32 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-10-01 19:32 UTC (permalink / raw)
To: buildroot
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
> Second patch added support to link with -latomic if needed however using
> LDFLAGS doesn't work when statically linking because LDFLAGS is added
> before LIBS
> Detection of atomic fails with:
> configure:23230: /accts/mlweber1/instance-2/output/host/bin/sparc-linux-g++ -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static -static -pedantic -Werror -Wall -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -Wno-long-long -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -latomic conftest.cpp -lrt -lpthread -lstdc++ >&5
> /tmp/ccgrvVTg.o: In function `main':
> conftest.cpp:(.text.startup+0x10): undefined reference to `__atomic_fetch_add_4'
> collect2: error: ld returned 1 exit status
> So use LIBS instead of LDFLAGS
> As second patch was already merged upstream, a new PR was sent:
> https://github.com/zeromq/libzmq/pull/3250
> Fixes:
> - http://autobuild.buildroot.net/results/c471d6b1061a8516f7772735e471db68a32965aa
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Committed to 2018.05.x and 2018.08.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-01 19:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-13 18:24 [Buildroot] [PATCH 1/1] zeromq: fix static build with libatomic Fabrice Fontaine
2018-09-13 18:59 ` Thomas Petazzoni
2018-10-01 19:32 ` Peter Korsgaard
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.