1

I'm trying to build a cross-compiler, but for some reason binutils is failing to compile. When I run make all, this is what I get after a while:

loading cache .././config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether to install libbfd... no
checking for executable suffix... (cached) .dSYM
checking for gcc... (cached) /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
checking whether the C compiler (/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
make: * [configure-opcodes] Error 1

Looking at the config.log this is what I got:

configure:565: checking for Cygwin environment
configure:598: checking for mingw32 environment
configure:675: checking host system type
configure:696: checking target system type
configure:714: checking build system type
configure:739: checking for gcc
configure:852: checking whether the C compiler (/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 -g -O2 ) works
configure:868: /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 -o conftest -g -O2   conftest.c  1>&5
configure:894: checking whether the C compiler (/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 -g -O2 ) is a cross-compiler
configure:899: checking whether we are using GNU C
configure:927: checking whether /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 accepts -g
configure:959: checking for POSIXized ISC
configure:997: checking for a BSD compatible install
configure:1050: checking whether build environment is sane
configure:1107: checking whether make sets ${MAKE}
configure:1153: checking for working aclocal
configure:1166: checking for working autoconf
configure:1179: checking for working automake
configure:1192: checking for working autoheader
configure:1205: checking for working makeinfo
configure:1228: checking for ar
configure:1260: checking for ranlib
configure:1407: checking for ld used by GCC
configure:1475: checking if the linker (/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2) is GNU ld
configure:1492: checking for /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 option to reload object files
configure:1504: checking for BSD-compatible nm
configure:1542: checking whether ln -s works
configure:1563: checking how to recognise dependant libraries
configure:1736: checking for object suffix
configure:1762: checking for executable suffix
configure:1932: checking for ranlib
configure:1999: checking for strip
ltconfig:678:checking for /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 option to produce PIC
ltconfig:687:checking that /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 PIC flag  -fPIC -DPIC works.
ltconfig:749: checking if /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 static flag  works
ltconfig:780: finding the maximum length of command line arguments
ltconfig:@lineno@: result: 98305
ltconfig:887: checking if /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 supports -fno-rtti -fno-exceptions
ltconfig:888: /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 -c -g -O2 -fno-rtti -fno-exceptions -c conftest.c  conftest.c 1>&5
ltconfig:1431: checking if global_symbol_pipe works
ltconfig:1432: /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 -c -g -O2  conftest.c 1>&5
ltconfig:1435: eval "nm conftest.o | sed -n -e 's/^.*[  ]\([BCDEGRST][BCDEGRST]*\)[     ][  ]*\(\)\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2\3 \3/p' > conftest.nm"
cannot find nm_test_var in conftest.nm
ltconfig:1431: checking if global_symbol_pipe works
ltconfig:1432: /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 -c -g -O2  conftest.c 1>&5
ltconfig:1435: eval "nm conftest.o | sed -n -e 's/^.*[  ]\([BCDEGRST][BCDEGRST]*\)[     ][  ]*\(_\)\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2\3 \3/p' > conftest.nm"
ltconfig:1487: /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 -o conftest -g -O2 -fno-builtin   conftest.c conftstm.o 1>&5
configure:2338: checking whether to enable maintainer-specific portions of Makefiles
configure:2361: checking whether to install libbfd
configure:2398: checking for executable suffix
configure:2434: checking for gcc
configure:2547: checking whether the C compiler (/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 -g -O2 ) works
configure:2563: /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 -o conftest.dSYM -g -O2   conftest.c  1>&5
ld: can't open output file for writing: conftest.dSYM, errno=21 for architecture x86_64
collect2: ld returned 1 exit status
configure: failed program was:

#line 2558 "configure"
#include "confdefs.h"

main(){return(0);}

What should I do to correct this?

Nathan Campos
  • 28,769
  • 59
  • 194
  • 300
  • Here's what's happening: `configure` needs to find the suffix used for executables (e.g., `.exe` on Windows; nothing on most UNIX systems). Mac OS X stores debugging information in a directory ending with `.dSYM`. `configure` thinks that's the executable and guesses the executable suffix is `.dSYM`. It then tries to compile the source `conftest.c` to the executable `conftest.dSYM`, which clashes with the debug directory, `conftest.dSYM`. It initially created the `conftest.dSYM` directory and then tries to open it for writing, which failed with `EISDIR` (file is directory). – icktoofay Aug 24 '13 at 23:56

0 Answers0