* [Buildroot] [PATCH v2] vlc: fix compile error with uClibc-ng Linuxthreads
@ 2016-08-25 19:08 Waldemar Brodkorb
2016-08-26 9:15 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Waldemar Brodkorb @ 2016-08-25 19:08 UTC (permalink / raw)
To: buildroot
The fallback code path didn't work correctly, so fix it.
Fixes:
http://autobuild.buildroot.net/results/3122287ddea1e316a64ccf0d0dc9415bfefebb49/
Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
---
v1 -> v2:
- rework autobuild failure, there is fallback code for non-NPTL,
so fix it up. Suggested by Thomas Petazzoni
---
package/vlc/0008-fix-fallback-time.patch | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100644 package/vlc/0008-fix-fallback-time.patch
diff --git a/package/vlc/0008-fix-fallback-time.patch b/package/vlc/0008-fix-fallback-time.patch
new file mode 100644
index 0000000..9692001
--- /dev/null
+++ b/package/vlc/0008-fix-fallback-time.patch
@@ -0,0 +1,27 @@
+fix fallback code and add missing libraries to link command
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff -Nur vlc-2.2.4.orig/configure.ac vlc-2.2.4/configure.ac
+--- vlc-2.2.4.orig/configure.ac 2016-05-31 18:11:07.000000000 +0200
++++ vlc-2.2.4/configure.ac 2016-08-24 21:15:50.555256426 +0200
+@@ -121,6 +121,7 @@
+ ;;
+ linux*)
+ SYS=linux
++ AC_CHECK_LIB([rt], [posix_spawnp], [VLC_ADD_LIBS([libvlccore],[-lpthread -lrt])], [], [-lpthread])
+ ;;
+ bsdi*)
+ SYS=bsdi
+diff -Nur vlc-2.2.4.orig/src/posix/thread.c vlc-2.2.4/src/posix/thread.c
+--- vlc-2.2.4.orig/src/posix/thread.c 2015-02-02 20:42:32.000000000 +0100
++++ vlc-2.2.4/src/posix/thread.c 2016-08-24 19:46:02.717783031 +0200
+@@ -85,7 +85,7 @@
+
+ static void vlc_clock_setup_once (void)
+ {
+-# if (_POSIX_MONOTONIC_CLOCK == 0)
++# if (_POSIX_MONOTONIC_CLOCK == 0) && (_POSIX_CLOCK_SELECTION > 0)
+ long val = sysconf (_SC_MONOTONIC_CLOCK);
+ assert (val != 0);
+ vlc_clock_id = (val < 0) ? CLOCK_REALTIME : CLOCK_MONOTONIC;
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* [Buildroot] [PATCH v2] vlc: fix compile error with uClibc-ng Linuxthreads
2016-08-25 19:08 [Buildroot] [PATCH v2] vlc: fix compile error with uClibc-ng Linuxthreads Waldemar Brodkorb
@ 2016-08-26 9:15 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-08-26 9:15 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 25 Aug 2016 21:08:32 +0200, Waldemar Brodkorb wrote:
> diff --git a/package/vlc/0008-fix-fallback-time.patch b/package/vlc/0008-fix-fallback-time.patch
> new file mode 100644
> index 0000000..9692001
> --- /dev/null
> +++ b/package/vlc/0008-fix-fallback-time.patch
> @@ -0,0 +1,27 @@
> +fix fallback code and add missing libraries to link command
> +
> +Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
VLC is hosted in a Git repository, so a Git-formatted patch would be
preferred.
> ++ AC_CHECK_LIB([rt], [posix_spawnp], [VLC_ADD_LIBS([libvlccore],[-lpthread -lrt])], [], [-lpthread])
Why are you linking with -lpthread here?
With uClibc, seems like linking with -lrt is sufficient:
thomas at skate:~/projets/buildroot (master)$ ./output/host/usr/bin/arm-linux-gcc -o foo foo.c
/tmp/ccigljuI.o: In function `main':
foo.c:(.text+0x2c): undefined reference to `posix_spawn'
collect2: error: ld returned 1 exit status
thomas at skate:~/projets/buildroot (master)$ ./output/host/usr/bin/arm-linux-gcc -o foo foo.c -lrt
thomas at skate:~/projets/buildroot (master)$
And it builds fine with glibc with no additional library at all
(neither -lrt nor -lpthread).
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-26 9:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-25 19:08 [Buildroot] [PATCH v2] vlc: fix compile error with uClibc-ng Linuxthreads Waldemar Brodkorb
2016-08-26 9:15 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox