Hi All,
I am trying to build SDCC (snapshot - 6596) on cygwin. For this, I have downloaded the snapshot of src "sdcc-src-20110619-6596.tar.bz2".
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 suspect the error may be 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 am herewith attaching the config.log for your reference & debugging.
Best Regards,
Raghunath Lolur.
config.log on cygwin
Dear Developers,
Namaste.
Finally, I successfully built SDCC (using snapshot #6613) 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 :-)
I request the developers team to modify the ./configure script where necessary.
Namaste,
Raghunath Lolur.
configure options script for building SDCC on cygwin
Hello All,
In my above comment, where I listed the issues/solutions, "sdcc_cygwin_mingw32" script under /sdcc/support/scripts was used and also updated with the following:
For C++ Boost libraries, use CPPFLAGS="-I/usr/local/boost/boost_1_46_1" \
For allowing multiple definitions, use LDFLAGS="-Wl,--allow-multiple-definition" \
I am herewith attaching the sdcc_cygwin_mingw32 script with the above changes for your reference. This script has to be run from /sdcc folder.
Sorry for the incomple info in the above comment.
Namaste,
Raghunath Lolur.
Boost library can be installed directly from the CygWin package manager. In this case it is installed in standard directories, so no additional include director paths (-I ...) in CPPFLAGS are required.
Borut