Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Configure Error - C compiler can't crea...

Help
BLRCalvin
2011-06-21
2013-03-12
  • BLRCalvin
    BLRCalvin
    2011-06-21

    Hi All,

    I am trying to build SDCC on cygwin. For this, I have downloaded the latest snapshot of src "sdcc-src-20110619-6596.tar.bz2".

    Procedure followed for configuring & make:

    Decompressed and extracted source using bzip2 and tar xvf commands respectively. Later, as per 2.4.4 sec in sdccman.pdf, I am using the script ’sdcc/support/scripts/sdcc_cygwin_mingw32’ for configuring and further build. I am running the script from the sdcc directory. However, I am encourntering an error =>  "configure: error: C compiler cannot create executables".

    After observing the config.log, I believe the error is due to "-mno-cygwin" flag used with gcc compiler. gcc gives the following message: "gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.".

    I need some help on how to rectify this problem. Since I do not know how to attach a file in this forum, I am herewith providing the platform & core tests info of config.log for your reference & debugging. Let me know incase you require complete text of config.log.

    config.log :

    ## ------ ##
    ## Platform. ##
    ## ------ ##

    hostname = myhost
    uname -m = i686
    uname -r = 1.7.9(0.237/5/3)
    uname -s = CYGWIN_NT-6.1
    uname -v = 2011-03-29 10:10
    ## ------- ##
    ## Core tests. ##
    ## ------- ##

    configure:2458: creating cache config.cache
    configure:2539: checking for gawk
    configure:2555: found /usr/bin/gawk
    configure:2566: result: gawk
    configure:2578: checking version of the package
    configure:2582: result: 3.0.3
    configure:2689: checking for gcc
    configure:2716: result: gcc -mno-cygwin
    configure:2945: checking for C compiler version
    configure:2954: gcc -mno-cygwin -version >&5
    gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.

    configure:2965: $? = 1
    configure:2954: gcc -mno-cygwin -v >&5
    gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.

    configure:2965: $? = 1
    configure:2954: gcc -mno-cygwin -V >&5
    gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.

    configure:2965: $? = 1
    configure:2954: gcc -mno-cygwin -qversion >&5
    gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.

    configure:2965: $? = 1
    configure:2985: checking whether the C compiler works
    configure:3007: gcc -mno-cygwin    conftest.c  >&5
    gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.

    configure:3011: $? = 1
    configure:3049: result: no
    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 SDCC_VERSION_LO 0
    | #define SDCC_VERSION_HI 3
    | #define SDCC_VERSION_P 3
    | #define SDCC_VERSION_STR "3.0.3"
    | /* end confdefs.h.  */
    |
    | int
    | main ()
    | {
    |
    |   ;
    |   return 0;
    | }
    configure:3054: error: in `/cygdrive/c/userdata/projects/sdcc/downloads/snapshots/after_v3/#6596_19_JUN_11/sdcc':
    configure:3056: error: C compiler cannot create executables

    Thanks in advance,

    Best Regards,
    Raghunath.

     
  • Maarten Brock
    Maarten Brock
    2011-06-22

    I think it's better to file this in the bug tracker.

     
  • BLRCalvin
    BLRCalvin
    2011-06-22

    Thanks for the reply. OK, I will do that.

     
  • BLRCalvin
    BLRCalvin
    2011-07-07

    Hello All,

    Namaste.

    Finally, I successfully built SDCC on cygwin.

    The following are the issues encountered during the build and their corresponding solutions:

    •  GCC v4 (pre-installed on my cygwin system) onwards does not accept “–mno-cygwin”flag used in SDCC build scripts. So, build fails. - GCC v3.4.4 used to compile which accepts this flag. Switch your default gcc to version 3.x by using
    /usr/bin/set-gcc-default-3.sh

    • Multiple definition errors of “TYPEDEF” in linker source – commented the typedefs in “lkar.h” accordingly. Re-build.

    • Boost C++ libraries (used in the latest snapshot #6613) installation – Downloaded from the web (www.boost.org)  and configured for CYGWIN. Build script updated with the GCC compiler flags for the installation path of the libraries. Re-build.

    • Linker error on multiple definitions of built-in functions like _log, _exp etc., (found in MINGW multiple libraries libm.a & libmsvcrt.a) – On googling the web, found that GCC compiler allows multiple definitions when a special linker flag is used; Updated the scripts with “—allow-multiple-definition” linker flag and re-build.

    SDCC builds successfully finally :-)

    Namaste,
    Raghunath Lolur.