Page 1 of 1

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

Posted: 15 Aug 2013 20:46
by ygao-developer
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

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

Posted: 15 Aug 2013 22:59
by Jean-Baptiste Kempf
Recompile with -fPIC enabled.

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

Posted: 16 Aug 2013 16:33
by ygao-developer
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.

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

Posted: 19 Dec 2013 15:57
by Jonathan Websdale
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?

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

Posted: 05 Feb 2014 12:00
by andrew46
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...

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

Posted: 05 Feb 2014 17:29
by Rémi Denis-Courmont
Run 'make distclean' in your libav source tree, reconfigure it and rebuild.

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

Posted: 07 Feb 2014 00:06
by andrew46
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

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

Posted: 19 May 2014 17:51
by Etna
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.

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

Posted: 28 Jul 2014 04:39
by Etna
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?