On 5 January 2017 at 23:21, Nick Leli wrote: > I am trying to compile GCC from Ubuntu, for Darwin by following this > guide: http://wiki.osdev.org/GCC_Cross-Compiler#The_Build > > I have followed the steps but feel like I am missing something based > on the comments from the configure suffix error I am receiving: > https://gcc.gnu.org/wiki/FAQ#configure_suffix . > > Here are the steps I've taken: > 1. Downloaded the gcc pre-requisites Just downloaded the tarballs? Built and installed them? Or run the contrib/download_prerequisites script? > 2. Configured and built binutils from outside the source directory Just built, or built and installed? > 3. Configured and built gcc from outside the source directory, and > separate from binutils. The target used was the same target value I > see on OSX 10.11.6 (x86_64-apple-darwin15.6.0) > 4. Ensured the src/gcc-6.3.0 directory is in my path, so GMP/MPFR/MPC > can be found This step is not necessary, there are no executables for GMP, MPFR or MPC, so nothing to be found in your PATH. > 5. Deleted contents of build directory and started over with the steps above. > 6. Ensured all pre-requisites are on the host: > https://gcc.gnu.org/install/prerequisites.html > 7. Attempted to configure gcc with --disable-werror > > I was under the impression that gcc can be built for any architecture, > as long as you specify what you want to build it for. Is there > something additional I need to do in order to get a working compiler > for a different architecture? Any insight is greatly appreciated. > > Here is the gcc configure command I ran: ../gcc-6.3.0/configure > --target=x86_64-apple-darwin15.6.0 --prefix="$PREFIX" --disable-nls > --enable-languages=c --without-headers --disable-werror > > Here is the last error I'm seeing in > $build_directory/x86_64-apple-darwin15.6.0/libgcc/config.log > > configure:3653: checking for suffix of object files > configure:3675: /home/ubuntu/src/build-gcc/./gcc/xgcc > -B/home/ubuntu/src/build-gcc/./gcc/ > -B/home/ubuntu/opt/cross/x86_64-apple-darwin15.6.0/bin/ > -B/home/ubuntu/opt/cross/x86_64-apple-darwin15.6.0/lib/ -isystem > /home/ubuntu/opt/cross/x86_64-apple-darwin15.6.0/include -isystem > /home/ubuntu/opt/cross/x86_64-apple-darwin15.6.0/sys-include -c -g > -O2 conftest.c >&5 > /home/ubuntu/src/build-gcc/./gcc/as: 106: exec: -arch: not found This suggests an assembler for the target was not found. Did you install binutils? Is it either in $PREFIX or is $PREFIX/bin in your PATH?