Thu Jun 17, 2010 8:01 pm
I am trying to build k3b from source and am getting a make error:
/usr/bin/ld: /usr/local/lib/libavcodec.a(utils.: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [lib/k3bffmpegdecoder.so] Error 1
make: *** [plugins/decoder/ffmpeg/CMakeFiles/k3bffmpegdecoder.dir/all] Error 2
I have all of the dependencies installed and a full build environment on Ubuntu 10.4 64 bit. I built it fine on 9.04. I did a full make on ffmpeg-0.5.2 and it went fine.
Do I have to hack the makefiles to "recompile with -fPIC". And, recompile what? There were hundreds of modules.
What am I doing wrong?
Thu Jun 17, 2010 10:39 pm
You need to recompile ffmpeg with -fPIC, as the file that is having issues is /usr/local/lib/libavcodec.a
Fri Jun 18, 2010 5:54 pm
The INSTALL file says:
install mandatory and optionally optional junk
If the cmake run was successful you are presented with a list of configure results that shows
which optional features are enabled. Now just compile K3b:
Now you are ready to install:
make install (as root)
Does the makefile need to be hacked? It was created by the cmake process, so wouldn't any changes be overwritten?
Here are all of the references to ffmpeg in the makefile
brianp@trex:/mnt/sda4.home/brianp/download/k3b/k3b-1.93.0/build$ grep ffmpeg *
Makefile:# Target rules for targets named k3bffmpegdecoder
Makefile: $(MAKE) -f CMakeFiles/Makefile2 k3bffmpegdecoder
Makefile:.PHONY : k3bffmpegdecoder
Makefile: $(MAKE) -f plugins/decoder/ffmpeg/CMakeFiles/k3bffmpegdecoder.dir/build.make plugins/decoder/ffmpeg/CMakeFiles/k3bffmpegdecoder.dir/build
Makefile:.PHONY : k3bffmpegdecoder/fast
Makefile:# Target rules for targets named k3bffmpegdecoder_automoc
Makefile: $(MAKE) -f CMakeFiles/Makefile2 k3bffmpegdecoder_automoc
Makefile:.PHONY : k3bffmpegdecoder_automoc
Makefile: $(MAKE) -f plugins/decoder/ffmpeg/CMakeFiles/k3bffmpegdecoder_automoc.dir/build.make plugins/decoder/ffmpeg/CMakeFiles/k3bffmpegdecoder_automoc.dir/build
Makefile:.PHONY : k3bffmpegdecoder_automoc/fast
Makefile: @echo "... k3bffmpegdecoder"
Makefile: @echo "... k3bffmpegdecoder_automoc"
Where would one put the -fPIC directive?
This has to be bug when following the instructions on a downloaded package yields a low level linker error. Is there an obvious fix I am overlooking? For usability alone, this deserves a bug writeup.
With configure, you can slip in various options and find out which ones with configure --help. How do you do the same thing with cmake when the help tells you the options of cmake, not of the package being built.
Fri Jun 18, 2010 10:16 pm
The Makefile for K3b isn't the problem. The problem lies in the configuration of ffmpeg when it was built.