Summary: | shared libraries of media-video/ffmpeg fail to load on ppc with "R_PPC_REL24 relocation" errors due to no -fPIC | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Saphirus <saphirus497> |
Component: | Current packages | Assignee: | Gentoo Media-video project <media-video> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | bugs-gentoo, gstreamer, heluani, nuernbe, ppc, volkmar |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | PPC | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
ffmpeg build log (latest ~ppc)
ffmpeg build log with EXTRA_FFMPEG_CONF=--enable-pic |
Description
Saphirus
2009-08-23 01:40:16 UTC
I'm not a PPC dev, but the equivalent error on x86/amd64 is caused by trying to load a 32bit library into a 64bit address space (which is not possible, at least on x86/amd64). This is indeed an ffmpeg error. The shared libraries generated by ffmpeg are compiled without the -fPIC CFLAG and thus include R_PPC_REL24 relocations. As mentioned in bug #13032 this is not allowed for shared libraries on ppc. Recompiling ffmpeg with -fPIC fixed the problem for me. The ffmpeg ebuild needs to be fixed. Re-assigning to ffmpeg maintainers then. Keeping gstreamer@ in CC, gnome@ doesn't need to worry about this (gstreamer is being gradually transitioned to be gstreamer@ only instead of together with gnome@). please paste a ffmpeg build log, try with 0.5 and latest ~arch do ffplay & ffmpeg work correctly? also try if 'EXTRA_FFMPEG_CONF=--enable-pic emerge -1 ffmpeg' works with ~arch ffmpeg. Created attachment 205568 [details]
ffmpeg build log (latest ~ppc)
Attached the build log of ffmpeg 0.5_p19928 (latest ~ppc).
Created attachment 205569 [details]
ffmpeg build log with EXTRA_FFMPEG_CONF=--enable-pic
the --enable-pic option adds -fPIC to the compiler flags and thus seems to fix the problem.
I tried 0.5-r1 (current ppc stable) where the problem exists. I also tried 0.5_p19928 (latest ~ppc) which still has the same problem. The build also warns about that: * QA Notice: The following files contain runtime text relocations * Text relocations force the dynamic linker to perform extra * work at startup, waste system resources, and may pose a security * risk. On some architectures, the code may not even function * properly, if at all. * For more information, see http://hardened.gentoo.org/pic-fix-guide.xml * Please include the following list of files in your report: * TEXTREL usr/lib/libavcodec.so.52.35.0 * TEXTREL usr/lib/libpostproc.so.51.2.0 * TEXTREL usr/lib/libavformat.so.52.38.0 * TEXTREL usr/lib/libavdevice.so.52.2.0 * TEXTREL usr/lib/libavfilter.so.0.5.0 * TEXTREL usr/lib/libswscale.so.0.7.1 * TEXTREL usr/lib/libavutil.so.50.3.0 ffplay works correctly (didn't test ffmpeg). But the code fails when gstreamer is trying to load the shared libraries as plugin. I then tried the EXTRA_FFMPEG_CONF=--enable-pic which seems to fix the problem by adding -fPIC to the compiler flags. See the attached build logs for the differences. I got it too. Now, we have to know if it's ppc-only or more complicated than that. If a ppc team member can try to reproduce this bug. (In reply to comment #8) > I got it too. > Now, we have to know if it's ppc-only or more complicated than that. > > If a ppc team member can try to reproduce this bug. > Honestly, I don't know why this isn't fixed, yet. The fix is quite simple and according to the QA Notice it should be applied on all architectures, not only ppc. Is there any reason to build the shared libraries of ffmpeg without the --enable-pic switch? (In reply to comment #9) > (In reply to comment #8) > > I got it too. > > Now, we have to know if it's ppc-only or more complicated than that. > > > > If a ppc team member can try to reproduce this bug. > > > > Honestly, I don't know why this isn't fixed, yet. The fix is quite simple and > according to the QA Notice it should be applied on all architectures, not only > ppc. Is there any reason to build the shared libraries of ffmpeg without the > --enable-pic switch? It is upstream default because pic makes ffmpeg *much* slower. As far as I understand it, the ppc problem is not because shared libs have to be pic but because relocations are too "big" when loaded from some libraries (ffplay/ffmpeg seems to work and load the same library). I've added a pic useflag to -9999 ebuild, which means it'll be in the next snapshot and ppc team will be able to use.force it. I was able to get ffmpeg-0.5-r1 working with USE="X alsa altivec amr dirac encode faac faad gsm hardcoded-tables mp3 schroedinger sdl speex theora vorbis x264 xvid zlib -3dnow -3dnowext -bindist -custom-cflags -debug -doc -ieee1394 -ipv6 -jpeg2k -mmx -mmxext -network -oss -ssse3 -test -threads -v4l -v4l2 -vdpau -vhook -video_cards_nvidia" I'm not sure why and how it's now working because I was using these flags before. Maybe linked to gcc bump ? I don't know. Anyhow, I can't reproduce this bug anymore on my laptop. I can't reproduce this either. Please re-open the bug if you have this happen again. *** Bug 304589 has been marked as a duplicate of this bug. *** I am experiencing REL24 errors as mentioned in this bug running on Linux fernet 2.6.31-gentoo-r6 #3 Thu Feb 18 10:31:49 PST 2010 ppc 7447A, altivec supported PowerBook6,4 GNU/Linux When trying to watch an avi on totem I get (totem:25711): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-0.10/libgstffmpeg.so': /usr/lib/gstreamer-0.10/libgstffmpeg.so: R_PPC_REL24 relocation at 0x0c88cfbc for symbol `__errno_location' out of range ffplay shows the file fine without trouble and it is the latest stable ppc and was compiled with USE=pic: $ ffmpeg FFmpeg version SVN-r20373, Copyright (c) 2000-2009 Fabrice Bellard, et al. built on Jun 24 2010 16:34:21 with gcc 4.3.4 configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --enable-static --enable-shared --cc=powerpc-unknown-linux-gnu-gcc --disable-debug --disable-network --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libxvid --enable-libdc1394 --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-x11grab --enable-pthreads --enable-libfaad --enable-libspeex --enable-libgsm --enable-libfaac --enable-nonfree --disable-vdpau --disable-vdpau --disable-vaapi --disable-mmx --disable-ssse3 --disable-mmx2 --disable-amd3dnow --disable-amd3dnowext --enable-pic --cpu=7450 --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-avfilter-lavf --disable-stripping --enable-hardcoded-tables libavutil 50. 3. 0 / 50. 3. 0 libavcodec 52.37. 1 / 52.37. 1 libavformat 52.39. 2 / 52.39. 2 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1. 4. 1 / 1. 4. 1 libswscale 0. 7. 1 / 0. 7. 1 libpostproc 51. 2. 0 / 51. 2. 0 My previous post was misplaced, the relocation issues were on gst-plugins-ffmpeg, opened a corresponding bug there. |