summaryrefslogtreecommitdiffstats
path: root/vlc/build/vlc_x264_static.diff
blob: 960b8d2a29b4cd76d676ffcff04b6587dd59b97f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From: Pierre Ynard <linkfanel@yahoo.fr>
Date: Thu, 26 Mar 2009 17:11:17 +0000 (+0100)
Subject: x264: Use -Bsymbolic to fix static link
X-Git-Url: http://git.videolan.org/?p=vlc.git;a=commitdiff_plain;h=c20cca8148346e2a3b1a7c0bae69fa74675731ed

x264: Use -Bsymbolic to fix static link

On my linux x86_64 system, when trying to statically link the x264
module against libx264, I get the following error:

/usr/bin/ld: /usr/local/lib/libx264.a(cabac-a.o): relocation
R_X86_64_PC32 against symbol `x264_cabac_range_lps' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value

Even though libx264 was compiled as PIC. Dynamically linking against the
shared library, built during the same process, works well.

The x264 folks said that VLC needed to use the -Bsymbolic flag to allow
conversation of a static PIC library into a shared library, so that's
what I did, and it works for me.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
---

diff --git a/configure.ac b/configure.ac
index 8ae1003..ffc4d36 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3748,7 +3748,7 @@ if test "${enable_x264}" != "no"; then
       VLC_ADD_LIBS([x264],[-L${real_x264_tree}])
       PKG_CHECK_MODULES(X264,x264, [
         VLC_ADD_PLUGIN([x264])
-        VLC_ADD_LDFLAGS([x264],[${X264_LIBS}])
+        VLC_ADD_LDFLAGS([x264],[${X264_LIBS} -Wl,-Bsymbolic])
         VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
         if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
           VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
@@ -3764,7 +3764,7 @@ if test "${enable_x264}" != "no"; then
   else
       PKG_CHECK_MODULES(X264,x264, [
         VLC_ADD_PLUGIN([x264])
-        VLC_ADD_LDFLAGS([x264],[${X264_LIBS}])
+        VLC_ADD_LDFLAGS([x264],[${X264_LIBS} -Wl,-Bsymbolic])
         VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
         if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
           VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])