Cannot configure crt on Mac OSX

2011-01-21
2013-06-06
  • Wai Bong Yung

    Wai Bong Yung - 2011-01-21

    I tried to compile mingw64 on Mac OSX 10.6 because the automated builds seem to lack g++.

    I have gmp, mpc, mpfr and bin-util installed

    This are the commands I used for the process

    cd /Users/patrick/Documents/developer/source/binutils-2.21/macbuild
    ../configure -target=x86_64-w64-mingw32 -disable-multilib
    sudo make -j6 install

    cd /Users/patrick/Documents/developer/source/mingw-w64-v1.0-20101003/mingw-w64-headers/
    mkdir macbuild
    cd macbuild
    sudo ../configure -host=x86_64-w64-mingw32
    sudo make -j6 install
    sudo ln -s /usr/local/x86_64-w64-mingw32 /usr/local/mingw
    sudo mkdir -p /usr/local/x86_64-w64-mingw32/lib
    sudo ln -s /usr/local/x86_64-w64-mingw32/lib /usr/local/x86_64-w64-mingw32/lib64

    cd /Users/patrick/Documents/developer/source/gcc-4.5.2/
    mkdir build-darwin-mingw32
    cd build-darwin-mingw32
    ../configure -target=x86_64-w64-mingw32 -disable-multilib
    sudo make all-gcc -j6
    sudo make install-gcc

    cd /Users/patrick/Documents/developer/source/mingw-w64-v1.0-20101003/mingw-w64-crt/
    mkdir macbuild
    cd macbuild
    sudo ../configure -host=x86_64-w64-mingw32
    sudo make -j6
    sudo make install
    cd /Users/patrick/Documents/developer/source/gcc-4.5.2/build-darwin-mingw32
    sudo make -j6
    sudo make install

    The process stops when trying to configure crt. It finds the gcc-core in /usr/local/bin but I get this error message

    PatMBP:macbuild patrick$ sudo ../configure -host=x86_64-w64-mingw32
    configure: WARNING: If you wanted to set the -build type, don't use -host.
        If a cross compiler is detected then cross compile mode will be used.
    checking for a BSD-compatible install… /usr/bin/install -c
    checking whether build environment is sane… yes
    checking for x86_64-w64-mingw32-strip… no
    checking for strip… strip
    checking for a thread-safe mkdir -p… ../build-aux/install-sh -c -d
    checking for gawk… no
    checking for mawk… no
    checking for nawk… no
    checking for awk… awk
    checking whether make sets $(MAKE)… yes
    checking whether to enable maintainer-specific portions of Makefiles… no
    checking build system type… x86_64-apple-darwin10.6.0
    checking host system type… x86_64-w64-mingw32
    checking for sysroot… no
    checking for a sed that does not truncate output… /usr/bin/sed
    checking for x86_64-w64-mingw32-gcc… x86_64-w64-mingw32-gcc
    checking whether we are cross compiling… yes
    checking for suffix of object files… configure: error: in `/Users/patrick/Documents/developer/source/mingw-w64-v1.0-20101003/mingw-w64-crt/macbuild':
    configure: error: cannot compute suffix of object files: cannot compile
    See `config.log' for more details.

    In the log file,  I get this in core tests,

    ## ------- ##
    ## Core tests. ##
    ## ------- ##

    configure:2155: checking for a BSD-compatible install
    configure:2223: result: /usr/bin/install -c
    configure:2234: checking whether build environment is sane
    configure:2284: result: yes
    configure:2333: checking for x86_64-w64-mingw32-strip
    configure:2363: result: no
    configure:2373: checking for strip
    configure:2389: found /usr/bin/strip
    configure:2400: result: strip
    configure:2425: checking for a thread-safe mkdir -p
    configure:2464: result: ../build-aux/install-sh -c -d
    configure:2477: checking for gawk
    configure:2507: result: no
    configure:2477: checking for mawk
    configure:2507: result: no
    configure:2477: checking for nawk
    configure:2507: result: no
    configure:2477: checking for awk
    configure:2493: found /usr/bin/awk
    configure:2504: result: awk
    configure:2515: checking whether make sets $(MAKE)
    configure:2537: result: yes
    configure:2618: checking whether to enable maintainer-specific portions of Makefiles
    configure:2627: result: no
    configure:2645: checking build system type
    configure:2659: result: x86_64-apple-darwin10.6.0
    configure:2679: checking host system type
    configure:2692: result: x86_64-w64-mingw32
    configure:2713: checking for sysroot
    configure:2750: result: no
    configure:2770: checking for a sed that does not truncate output
    configure:2834: result: /usr/bin/sed
    configure:2847: checking for x86_64-w64-mingw32-gcc
    configure:2863: found /usr/local/bin/x86_64-w64-mingw32-gcc
    configure:2874: result: x86_64-w64-mingw32-gcc
    configure:3143: checking for C compiler version
    configure:3152: x86_64-w64-mingw32-gcc -version >&5
    x86_64-w64-mingw32-gcc (GCC) 4.5.2
    Copyright (C) 2010 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    configure:3163: $? = 0
    configure:3152: x86_64-w64-mingw32-gcc -v >&5
    Using built-in specs.
    COLLECT_GCC=x86_64-w64-mingw32-gcc
    COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-w64-mingw32/4.5.2/lto-wrapper
    Target: x86_64-w64-mingw32
    Configured with: ../configure -target=x86_64-w64-mingw32 -disable-multilib
    Thread model: win32
    gcc version 4.5.2 (GCC)
    configure:3163: $? = 0
    configure:3152: x86_64-w64-mingw32-gcc -V >&5
    x86_64-w64-mingw32-gcc: '-V' option must have argument
    configure:3163: $? = 1
    configure:3152: x86_64-w64-mingw32-gcc -qversion >&5
    x86_64-w64-mingw32-gcc: unrecognized option '-qversion'
    x86_64-w64-mingw32-gcc: no input files
    configure:3163: $? = 1
    configure:3183: x86_64-w64-mingw32-gcc -o conftest    conftest.c  >&5
    conftest.c:2:Unknown pseudo-op: .scl
    conftest.c:2:Rest of line ignored. 1st junk character valued 50 (2).
    conftest.c:2:Unknown pseudo-op: .type
    conftest.c:2:Rest of line ignored. 1st junk character valued 51 (3).
    conftest.c:2:Unknown pseudo-op: .endef
    conftest.c:5:Unknown pseudo-op: .scl
    conftest.c:5:Rest of line ignored. 1st junk character valued 50 (2).
    conftest.c:5:Unknown pseudo-op: .type
    conftest.c:5:Rest of line ignored. 1st junk character valued 51 (3).
    conftest.c:5:Unknown pseudo-op: .endef
    configure:3187: $? = 1
    configure:3401: checking whether we are cross compiling
    configure:3439: result: yes
    configure:3443: checking for suffix of object files
    configure:3465: x86_64-w64-mingw32-gcc -c   conftest.c >&5
    conftest.c:2:Unknown pseudo-op: .scl
    conftest.c:2:Rest of line ignored. 1st junk character valued 50 (2).
    conftest.c:2:Unknown pseudo-op: .type
    conftest.c:2:Rest of line ignored. 1st junk character valued 51 (3).
    conftest.c:2:Unknown pseudo-op: .endef
    conftest.c:5:Unknown pseudo-op: .scl
    conftest.c:5:Rest of line ignored. 1st junk character valued 50 (2).
    conftest.c:5:Unknown pseudo-op: .type
    conftest.c:5:Rest of line ignored. 1st junk character valued 51 (3).
    conftest.c:5:Unknown pseudo-op: .endef
    configure:3469: $? = 1
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME "mingw-w64-runtime"
    | #define PACKAGE_TARNAME "mingw-w64-runtime"
    | #define PACKAGE_VERSION "1.0b"
    | #define PACKAGE_STRING "mingw-w64-runtime 1.0b"
    | #define PACKAGE_BUGREPORT "mingw-w64-public@lists.sourceforge.net"
    | #define PACKAGE_URL ""
    | #define PACKAGE "mingw-w64-runtime"
    | #define VERSION "1.0b"
    | /* end confdefs.h.  */
    |
    | int
    | main ()
    | {
    |
    |   ;
    |   return 0;
    | }
    configure:3483: error: in `/Users/patrick/Documents/developer/source/mingw-w64-v1.0-20101003/mingw-w64-crt/macbuild':
    configure:3486: error: cannot compute suffix of object files: cannot compile
    See `config.log' for more details.

    I don't know what's wrong despite trying with Mingw64 1.0 snapshot and the trunk and GCC-4.5.2 and also the 4.6 trunk.

    Any help is appreciated!

     
  • Jonathan Yong

    Jonathan Yong - 2011-01-21

    Looks like you didn't install cross binutils for x86_64-w64-mingw32, you should get the latest cvs snapshot to work with. The released copies are too old.

     
  • Wai Bong Yung

    Wai Bong Yung - 2011-01-21

    This is part of the log file in the build directory of gcc-4.5.2

    configure:5858: gcc -c -g -O2  -I/usr/local/include   conftest.c >&5
    conftest.c:10:19: error: ppl_c.h: No such file or directory
    conftest.c: In function 'main':
    conftest.c:16: error: 'choke' undeclared (first use in this function)
    conftest.c:16: error: (Each undeclared identifier is reported only once
    conftest.c:16: error: for each function it appears in.)
    conftest.c:16: error: expected ';' before 'me'
    configure:5858: $? = 1
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME ""
    | #define PACKAGE_TARNAME ""
    | #define PACKAGE_VERSION ""
    | #define PACKAGE_STRING ""
    | #define PACKAGE_BUGREPORT ""
    | #define PACKAGE_URL ""
    | #define LT_OBJDIR ".libs/"
    | /* end confdefs.h.  */
    | #include "ppl_c.h"
    | int
    | main ()
    | {
    |
    |   #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR != 10
    |   choke me
    |   #endif
    |
    |   ;
    |   return 0;
    | }
    configure:5862: result: no

    Looks like you didn't install cross binutils for x86_64-w64-mingw32, you should get the latest cvs snapshot to work with. The released copies are too old.

    binutil-2.21 was released in Dec-2010. Are you sure it is too old? I compiled for x64_64-w64-mingw32 from binutil-2.21 source and it seems fine.

     
  • Jonathan Yong

    Jonathan Yong - 2011-01-21

    I'm not sure about 2.21 release, I think its new enough, but 2.20 is definitely too old.

    In your log:
    configure:2333: checking for x86_64-w64-mingw32-strip
    configure:2363: result: no
    configure:2373: checking for strip
    configure:2389: found /usr/bin/strip configure:2400: result: strip

    You don't have cross binutils installed.

     
  • Wai Bong Yung

    Wai Bong Yung - 2011-01-22

    you are correct. I have compiled cross binutils. But now I'm stuck at mingw-w64-crt.

    Configure can't find the headers.

    configure: WARNING: unrecognized options: -disable-multilib
    configure: WARNING: If you wanted to set the -build type, don't use -host.
        If a cross compiler is detected then cross compile mode will be used.
    checking for a BSD-compatible install… /usr/bin/install -c
    checking whether build environment is sane… yes
    checking for x86_64-w64-mingw32-strip… x86_64-w64-mingw32-strip
    checking for a thread-safe mkdir -p… ../../src/mingw-w64-trunk/mingw-w64-crt/build-aux/install-sh -c -d
    checking for gawk… no
    checking for mawk… no
    checking for nawk… no
    checking for awk… awk
    checking whether make sets $(MAKE)… yes
    checking whether to enable maintainer-specific portions of Makefiles… no
    checking build system type… x86_64-apple-darwin10.6.0
    checking host system type… x86_64-w64-mingw32
    checking for sysroot… no
    checking for a sed that does not truncate output… /usr/bin/sed
    checking for x86_64-w64-mingw32-gcc… no
    checking for gcc… gcc
    checking whether the C compiler works… yes
    checking for C compiler default output file name… a.out
    checking for suffix of executables…
    checking whether we are cross compiling… no
    checking for suffix of object files… o
    checking whether we are using the GNU C compiler… yes
    checking whether gcc accepts -g… yes
    checking for gcc option to accept ISO C89… none needed
    checking for style of include used by make… GNU
    checking dependency style of gcc… gcc3
    checking for x86_64-w64-mingw32-g++… no
    checking for x86_64-w64-mingw32-c++… no
    checking for x86_64-w64-mingw32-gpp… no
    checking for x86_64-w64-mingw32-aCC… no
    checking for x86_64-w64-mingw32-CC… no
    checking for x86_64-w64-mingw32-cxx… no
    checking for x86_64-w64-mingw32-cc++… no
    checking for x86_64-w64-mingw32-cl.exe… no
    checking for x86_64-w64-mingw32-FCC… no
    checking for x86_64-w64-mingw32-KCC… no
    checking for x86_64-w64-mingw32-RCC… no
    checking for x86_64-w64-mingw32-xlC_r… no
    checking for x86_64-w64-mingw32-xlC… no
    checking for g++… g++
    checking whether we are using the GNU C++ compiler… yes
    checking whether g++ accepts -g… yes
    checking dependency style of g++… gcc3
    checking for x86_64-w64-mingw32-ranlib… x86_64-w64-mingw32-ranlib
    checking for x86_64-w64-mingw32-dlltool… x86_64-w64-mingw32-dlltool
    checking dependency style of gcc… gcc3
    checking for x86_64-w64-mingw32-ar… x86_64-w64-mingw32-ar
    checking for x86_64-w64-mingw32-as… x86_64-w64-mingw32-as
    checking whether gcc and cc understand -c and -o together… yes
    checking whether to enable globbing… no
    checking whether to enable leading underscores… yes
    checking whether to enable private exports… no
    checking whether to enable delay import libs… no
    checking whether the compiler supports -municode… no
    checking how to run the C preprocessor… gcc -E
    checking for grep that handles long lines and -e… /usr/bin/grep
    checking for egrep… /usr/bin/grep -E
    checking for ANSI C header files… yes
    checking for sys/types.h… yes
    checking for sys/stat.h… yes
    checking for stdlib.h… yes
    checking for string.h… yes
    checking for memory.h… yes
    checking for strings.h… yes
    checking for inttypes.h… yes
    checking for stdint.h… yes
    checking for unistd.h… yes
    checking _mingw_mac.h usability… no
    checking _mingw_mac.h presence… no
    checking for _mingw_mac.h… no
    configure: error: Please check if the mingw-w64 header set and the build/host option are set properly.
    make: *** No targets specified and no makefile found.  Stop.
    make: *** No rule to make target `install'.  Stop.

    I use these to create symbol links. I have two different builds of headers because I don't want to deal with the nasty errors in building multilib cross compiler.

    cd $buildDIR
    mkdir mingw-header-64
    cd mingw-header-64
    ../../src/mingw-w64-trunk/mingw-w64-headers/configure -host=x86_64-w64-mingw32
    make -j3;make install

    cd $buildDIR
    mkdir mingw-header-32
    cd mingw-header-32
    ../../src/mingw-w64-trunk/mingw-w64-headers/configure -host=i686-w64-mingw32
    make -j3;make install

    ln -s /usr/local/x86_64-w64-mingw32 /usr/local/mingw
    mkdir -p /usr/local/x86_64-w64-mingw32/lib
    ln -s /usr/local/x86_64-w64-mingw32/lib /usr/local/x86_64-w64-mingw32/lib64
    ln -s /usr/local/i686-w64-mingw32/lib /usr/local/x86_64-w64-mingw32/lib32

     
  • NightStrike

    NightStrike - 2011-01-22

    You're reinventing the wheel here.  Just download our makefile and run it.  It's in svn under experimental/buildsystem/makebuildroot.mk

     
  • Wai Bong Yung

    Wai Bong Yung - 2011-01-23

    You are right. I'm reinventing the wheel. I'm going to modify the script instead.

    I want to organise the folders the way I like.

    Thanks

     
  • Wai Bong Yung

    Wai Bong Yung - 2011-01-26

    I have successfully built the cross compilers with gcc 4.5.2,  gmp-5.0.1, mpfr-3.0.0 and mpc-0.8.2.
    I think gcc trunk had some configuration issues with ppl, cloog and lto and i had to disable lto explicitly and remove ppl and cloog from the source folder just to compile.
    But with 4.5.2 it compiles even without this flag.

     
  • Panayotis Katsaloulis

    Is it possible to describe how you manage to compile it under Mac?
    Since I believe more people would benefit from it, I'd suggest to help you even create e macports entry for everyone :)

     
  • NightStrike

    NightStrike - 2011-03-21

    teras: There's nothing special.  Just download and run the makefile.

    I suppose if you have an older installation, you might have to make sure that gcc 4.2 is your default gcc.  4.0 won't work.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks