FreeBSD 8 upgrade
After upgrading to FreeBSD 8 and doing a “portupgrade -fa” until it bailed out I removed all the old files & libraries (cd /usr/src && make delete-old) and then started hunting down broken ports. For that purpose I wrote a small Perl script (see http://www.nagilum.net/checkports/index.html) but there was one error I could not get around even after rebuilding all dependencies (I used “make all-depends-list|xargs -n1 -J % make -C % describe|cut -d\| -f1|xargs” to get the list):
cc -o x264 x264.o matroska.o muxers.o libx264.a -L/usr/local/lib -L/usr/local/lib -lm -pthread -lgpac -s -fprofile-generate
/usr/lib/libgcov.a(_gcov.o)(.text+0x1175): In function `gcov_exit':
: undefined reference to `__stack_chk_fail_local'
gmake[1]: *** [x264] Error 1
gmake[1]: Leaving directory `/var/tmp/export/ports/multimedia/x264/work/x264-snapshot-20081218-2245'
gmake: *** [fprofiled] Error 2
*** Error code 1
Stop in /export/ports/multimedia/x264.
*** Error code 1
Turns out that this is part of the stack protector and to link this properly you have to link with “-fstack-protector”. So to fix the multimedia/x264 port run “make extract” and edit “work/x264-snapshot-20081218-2245/Makefile” and look for:
x264$(EXE): $(OBJCLI) libx264.a
$(CC) -o $@ $+ $(LDFLAGS)
and change it to:
x264$(EXE): $(OBJCLI) libx264.a
$(CC) -o $@ $+ $(LDFLAGS) -fstack-protector
After that the port should compile and install as usual.
To build ffmpeg with x264 I did “LDFLAGS=-fstack-protector make“.
I just ran into the same problem and your solution worked. Thank you very much.
Comment by Stu — October 27, 2009 @ 18:02:12