This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-arch: not found


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
2. Configured and built binutils from outside the source directory
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
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
configure:3679: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/";
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3693: error: in
`/home/ubuntu/src/build-gcc/x86_64-apple-darwin15.6.0/libgcc':
configure:3696: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]