Compile error: /lib/libz.a(crc32.o): relocation R_X86_64_32

*nix specific usage questions
ygao-developer
New Cone
New Cone
Posts: 4
Joined: 15 Aug 2013 20:39

Compile error: /lib/libz.a(crc32.o): relocation R_X86_64_32

Postby ygao-developer » 15 Aug 2013 20:46

Compile from 2.0.4 and master (git clone)
Can somebody help with this issue? It happens with libz and libavcodec.

CC libaccess_realrtsp_plugin_la-real_rmff.lo
CC libaccess_realrtsp_plugin_la-real_sdpplin.lo
CC libaccess_realrtsp_plugin_la-real_asmrp.lo
CCLD libaccess_avio_plugin.la
CXXLD liblive555_plugin.la
/usr/bin/ld: /linux/vlc/contrib/x86_64-linux-gnu/lib/libz.a(crc32.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/linux/vlc/contrib/x86_64-linux-gnu/lib/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[5]: *** [libaccess_avio_plugin.la] Error 1

libz/rules.mak

.zlib: zlib
cd $< && $(HOSTVARS) $(ZLIB_CONFIG_VARS) ./configure --prefix=$(PREFIX) --static
cd $< && $(MAKE) install

CXXLD libstream_out_chromaprint_plugin.la
/usr/bin/ld: /linux/video/vlc/contrib/x86_64-linux-gnu/lib/libavcodec.a(fft.o): relocation R_X86_64_PC32 against symbol `ff_cos_32' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Compile error: /lib/libz.a(crc32.o): relocation R_X86_64

Postby Jean-Baptiste Kempf » 15 Aug 2013 22:59

Recompile with -fPIC enabled.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

ygao-developer
New Cone
New Cone
Posts: 4
Joined: 15 Aug 2013 20:39

Re: Compile error: /lib/libz.a(crc32.o): relocation R_X86_64

Postby ygao-developer » 16 Aug 2013 16:33

It works for the first error with CFLAGS=-fPIC before the ./configure because it is C compile.
But for second error with libavcodec, it is about fft.asm assembly. Don't know how to do with yasm for it.
Have to comment out chromaprint module as work around.

Jonathan Websdale
New Cone
New Cone
Posts: 8
Joined: 15 Nov 2013 12:55

Re: Compile error: /lib/libz.a(crc32.o): relocation R_X86_64

Postby Jonathan Websdale » 19 Dec 2013 15:57

I get the same error and have been disabling the chromaprint plugin because of it. Does not happen on my Ubuntu 32bit machine, only on my 64bit install. Did you get this resolved?

andrew46
Blank Cone
Blank Cone
Posts: 60
Joined: 01 Jun 2009 11:36
Operating System: Linux

Re: Compile error: /lib/libz.a(crc32.o): relocation R_X86_64

Postby andrew46 » 05 Feb 2014 12:00

Same error here with current vlc-git on a 64bit system:

Code: Select all

/usr/bin/ld: /home/andrew/vlc_build/vlcdeps/usr/lib/libavcodec.a(fft.o): relocation R_X86_64_PC32 against symbol `ff_cos_32' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value
and the FFmpeg libraries have been compiled with --enable-pic. Compiling without chromaprint bypases the issue...

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Compile error: /lib/libz.a(crc32.o): relocation R_X86_64

Postby Rémi Denis-Courmont » 05 Feb 2014 17:29

Run 'make distclean' in your libav source tree, reconfigure it and rebuild.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

andrew46
Blank Cone
Blank Cone
Posts: 60
Joined: 01 Jun 2009 11:36
Operating System: Linux

Re: Compile error: /lib/libz.a(crc32.o): relocation R_X86_64

Postby andrew46 » 07 Feb 2014 00:06

Thanks Rémi for looking at this. I removed the FFmpeg 2.1.3 source completely and reconfigured + reinstalled using --enable-pic and unfortunately under 64bit linux still received the same error:

Code: Select all

CXXLD libstream_out_chromaprint_plugin.la /usr/bin/ld: /home/andrew/vlc_build/vlcdeps/usr/lib/libavcodec.a(fft.o): relocation R_X86_64_PC32 against symbol `ff_cos_32' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status make[5]: *** [libstream_out_chromaprint_plugin.la] Error 1

Etna
New Cone
New Cone
Posts: 2
Joined: 19 May 2014 17:47

Re: Compile error: /lib/libz.a(crc32.o): relocation R_X86_64

Postby Etna » 19 May 2014 17:51

I'm also getting the same problem with the latest stable tarball of VLC, v2.1.4:

Code: Select all

Making all in stream_out make[3]: Entering directory `/home/etna/Downloads/Applications/VLC/vlc-2.1.4/modules/stream_out' make all-am make[4]: Entering directory `/home/etna/Downloads/Applications/VLC/vlc-2.1.4/modules/stream_out' CXXLD libstream_out_chromaprint_plugin.la /usr/bin/ld: /home/etna/Downloads/Applications/VLC/vlc-2.1.4/contrib/x86_64-mageia-linux-gnu/lib/libavcodec.a(fft.o): relocation R_X86_64_PC32 against symbol `ff_cos_32' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: ld returned 1 exit status make[4]: *** [libstream_out_chromaprint_plugin.la] Error 1
All the dependencies needed were done using the "contrib" method as described in the Wiki https://wiki.videolan.org/UnixCompile#T ... .22_method, and it seems that I'm not the only one to have this issue as well. Can anyone help? The Videolan IRC channel did not help much.

Etna
New Cone
New Cone
Posts: 2
Joined: 19 May 2014 17:47

Re: Compile error: /lib/libz.a(crc32.o): relocation R_X86_64

Postby Etna » 28 Jul 2014 04:39

I can confirm that this is still an issue in VLC 2.1.5. Basically,the only way to proceed is to run ./configure --disable-chromaprint, but this is at best just a work around to the issue.

Also, i noticed something very interesting; I currently have both VLC 2.1.4 and VLC 2.1.5 in my machine. If i compile any one release (e.g.: 2.1.5) with the contribs method and modify the ffmpeg rules.mak to --enable-shared --enable-static, that release will compile without having any problems with chromaprint, but the other version (which will be 2.1.4), when compiled with the same contribs method and the sane --enable-shared --enable-static rules in the ffmpeg rules.mak, will successfully complete but will not be able to see the ffmpeg codecs at all.

And both will also fail to actually activate the audio fingerprinter even though the plugin is already present in VLC.

Any ideas on what could be the problem?


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 16 guests