way to fix ffmpeg-devel build on amd64 [Was: amd64: cc -dumpmachine [ffmpeg]]

Andriy Gapon avg at icyb.net.ua
Fri Apr 20 08:39:34 UTC 2007

I've already sent this to ahze@, but I thought I'd forward this here
since multimedia@ is registered as a maintainer of the port.

P.S. Kris is CC-ed just in case.

-------- Original Message --------
Subject: Re: amd64: cc -dumpmachine [ffmpeg]
Date: Thu, 19 Apr 2007 20:37:57 +0300
From: Andriy Gapon <avg at icyb.net.ua>
To: Michael Johnson <ahze at ahze.net>
References: <4614BD4B.5010109 at icyb.net.ua>
<b2203fed0704050409w52840391g676ebfe1d39ef7e7 at mail.gmail.com>

on 05/04/2007 14:09 Michael Johnson said the following:
> yeah, I noticed that. ffmpeg doesn't build on amd64 right now as
> ARCH_X86 or ARCH_X86_64. and ffmpeg-devel tries to compile
> amd64 as ARCH_X86 right now.


I've noticed that ffmpeg-devel has been updated recently, both upstream
and port-wise, but it still doesn't compile on amd64.
I've done some googling and found the following post:

To be honest, I've understood less than 10% of the discussion in that
thread about relocations, registers and so on. Not sure what the patch
at the end of the post actually does (maybe disables assembly
completely?), but it allowed compilation to proceed further.

Still port build failed at a later step:

cc -shared -Wl,-soname,libavcodec.so.1 -Wl,--warn-common
-L/usr/local/lib -fPIC -rdynamic -export-dynamic
-o libavcodec.so.1 bitstream.o ...................
-lavutil -L/usr/local/lib  -pthread -lm -lz -la52 -ldts -lm -lgsm
-lmp3lame -lm -lvorbis -lvorbisenc -logg -logg -lxvidcore -lx264 -lfaac
/usr/bin/ld: /usr/local/lib/libdts.a(parse.o): relocation R_X86_64_32S
can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libdts.a: could not read symbols: Bad value
gmake[1]: *** [libavcodec.so.1] Error 1
gmake[1]: Leaving directory
gmake: *** [lib] Error 2
*** Error code 2

Stop in /usr/ports/multimedia/ffmpeg-devel.

It seems that on amd64 multimedia/libdts goes through extra step to
specify that dependents should link with -ldts_pic. I am not sure why
ffmeg-devel didn't do that, but after I manually changed config.mak the
build was able to complete successfully!

Hope this is of any help.

Andriy Gapon

Andriy Gapon

More information about the freebsd-multimedia mailing list