Linuxbrew / brew

:beer::penguin: The Homebrew package manager for Linux
https://linuxbrew.sh
BSD 2-Clause "Simplified" License
2.66k stars 237 forks source link

configure: error: C compiler cannot create executables #884

Closed RobertKoval closed 6 years ago

RobertKoval commented 6 years ago

Can't configure packages.

==> ../configure --prefix=/home/thethird/.linuxbrew/Cellar/gcc@4.9/4.9.4_1 --libdir=/home/thethird/.linuxbrew/Cellar/gcc@4.9/4.9.4_1/lib/gcc/4.9 --enable-languages=c,c++,fortran,objc,obj-c++ --program-suffix=-4.9 --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --enable-plugin --with-build-config=bootstrap-
Last 15 lines from /home/thethird/logs/gcc@4.9/01.configure:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for libatomic support... yes
checking for libcilkrts support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for gcc... gcc-4.4
checking for C compiler default output file name... 
configure: error: in `/home/thethird/tmp/gcc@4.9-20181112-2356387-iou7sl/gcc-4.9.4/build':
configure: error: C compiler cannot create executables
See `config.log' for more details.

p.s. config.log removed after error, because it's in /tmp, so I can't open it.

I think it's related to old gcc: gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) But I can't update gcc, because I get this error. Same error on other packages.

Gist for gcc: https://gist.github.com/RobertKoval/6045ef641a8bb13faa170c487beb8035

sjackman commented 6 years ago

brew gist-logs is supposed to include config.log, but it doesn't in this case because it's in a subdirectory. =/ You can brew install -dv gcc@4.9 and then once it fails select shell, which will give you access to config.log. Or try…

brew install -s hello
brew gist-logs hello
RobertKoval commented 6 years ago

I just reinstall linuxbrew with my previous fix: https://github.com/Linuxbrew/brew/issues/881 and it's work.