I am trying to compile FFmpeg in CentOS from source code. I referenced the official compilation guide (https://trac.ffmpeg.org/wiki/CompilationGuide/Centos) for CentOS step by step, and have installed the listed dependencies. But when I tried to configure FFmpeg, I met with a problem as below:

enter image description here

The error lines (1249~1270) in file configure are:

    check_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }

    log check_exec_crash "$@"

    # exit() is not async signal safe.  _Exit (C99) and _exit (POSIX)
    # are safe but may not be available everywhere.  Thus we use
    # raise(SIGTERM) instead.  The check is run in a subshell so we
    # can redirect the "Terminated" message from the shell.  SIGBUS
    # is not defined by standard C so it is used conditionally.

    (check_exec "$@") >> $logfile 2>&1 <<EOF

The config.log shows:

mktemp -u XXXXXX
check_ld cc
BEGIN /tmp/ffconf.rgbbriKe.c
    1   int main(void){ return 0; }
END /tmp/ffconf.rgbbriKe.c
gcc -I/home/vis/guangli/local/include -c -o /tmp/ffconf.LLalSg6X.o /tmp/ffconf.rgbbriKe.c
gcc -L/home/vis/guangli/local/lib -ldl -o /tmp/ffconf.G3SYKa9M /tmp/ffconf.LLalSg6X.o
C compiler test failed.

My OS is CentOS x86_64, the gcc installed in system is gcc-4.4.6, but in order to compile FFmpeg with gcc-4.8.2, I add GCC482_HOME/{bin,include} to environment variables: PATH, C_INCLUDE_PATH correspondingly.

  • I don't think it's the problem, but to eliminate the tput errors executeexport TERM=xterm before running config. It seems that the terminfo database on this system does not have a definition for xterm-256color. – Deathgrip Jun 7 '17 at 16:15
  • What about the message: C compiler test failed ? – Beanocean Jun 7 '17 at 16:38
  • I would fix the TERM variable and just try it. Is there a reason you're trying to compile it instead of maybe just getting the RPM from a source like repoforge.org? You also might want to specify which CentOS release you are using. 5.X, 6.X, 7.X? cat /etc/centos-release or cat /etc/lsb_release. – Deathgrip Jun 7 '17 at 16:48
  • I have fix the tput problem by exporting environmental variable TERMINFO. The message C compiler test failed still appears. The version of my CentOS is 6.3. The output of cat /etc/centos-release is CentOS release 6.3 (Final). Because I need to distribute the libraries of FFmpeg to other machines, so I have to compile it myself. (>﹏<) – Beanocean Jun 7 '17 at 16:54
  • Could you confirm that creating that source file and then running those commands actually results in a segfault? If so, what if you take off the -L/home/vis/guangli/local/lib ? – derobert Jun 7 '17 at 17:01

Turns out (for reasons yet unknown) that any executable placed in /tmp on your system segfaults. Even cp /bin/ls /tmp && cd /tmp && ./ls gives an ls that segfaults. But if moved to your home directory, then it works.

That is breaking configure; the obvious workaround is to create a subdirectory of your home directory and set TMPDIR to that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.