1

I've read all the internet and try many solutions but nothing worked for me. I have gcc 4.5.2 (specially this version, because newer versions of gcc add a lot of unnecessary when compiling, and the file size will grow significantly).

So gcc -v:

C:\MinGW\bin>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.5.2 (GCC)

So question: How to change this confire on windows? (I have msys, I think I need it for changing config with './configure') For example I want to write '--disable-libgomp'. How can I make this?

PS: maybe it will be usefull, I build my program with 'gcc -o prog.exe prog.cpp prog.o -s -Os -lole32 -luuid -lshlwapi -lcomctl32 -mwindows -lstdc++' (60Kb with gcc 4.8.1 and 20Kb with gcc 4.5.2).

UPDATE

This is the perfect solution of "How build GCC"

My configure flags:

./configure --enable-languages=c,c++ --disable-static --enable-shared --disable-sjlj-exceptions --disable-libgcj --disable-bootstrap --disable-libstdcxx-pch --disable-libgomp --with-dwarf2 --disable-win32-registry --disable-libstdcxx-debug --disable-concept-checks --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw --with-gmp=c:/mingw/src/gmp --with-mpfr=c:/mingw/src/mpfr --with-mpc=c:/mingw/src/mpc --with-libelf=c:/mingw/src/libelf

or with other flags you need.

Don't forget to mount with MSYS: mount PATH_TO_MINGW /mingw like

mount c:/mingw /mingw

You will run into some errors, but they are very simple to correct.

Good luck!

Community
  • 1
  • 1
tesst
  • 149
  • 1
  • 11
  • 1
    You need to rebuild the compiler itself, you can't change what it was configured with after the fact. – Mat Jan 27 '15 at 06:50
  • 1
    "newer versions of gcc add a lot of unnecessary when compiling, and the file size will grow significantly" Dubious assertion with no proof. – n. m. could be an AI Jan 27 '15 at 06:56
  • You should try to compile [GCC 4.9.2](https://gcc.gnu.org/gcc-4.9/); your ancient 4.5.2 version is unsupported - no more bugfixes!- ; what recent versions added the most are new optimizations, bug fixes, support of up-to-date standards (C++11), and better support of hardware. – Basile Starynkevitch Jan 27 '15 at 08:38
  • If you bother compiling GCC from source code (which is not a very easy task), you'll better use 4.9.2 not 4.8.1 – Basile Starynkevitch Jan 27 '15 at 08:52

0 Answers0