GCC on Cygwin is not configured with --enable-checking=release. This makes the
compiler run very slow due to extra diagnostic checks.
I'm seeing C++ compile 10 times slower on Cygwin
Here's GCC configure options and the warning message about extra diagnostics on
Cygwin compared to Ubuntu 24.04
---------------------------------------------------------
On Cygwin
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/16/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with:
/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20250720/configure
--srcdir=/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20250720
--prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc
--docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C
--build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin
--without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib
--with-gcc-major-version-only --enable-shared --enable-shared-libgcc
--enable-static --enable-version-specific-runtime-libs --enable-bootstrap
--enable-__cxa_atexit --enable-clocale=newlib --with-dwarf2 --with-tune=generic
--enable-languages=ada,c,c++,fortran,lto,objc,obj-c++,jit --enable-graphite
--enable-threads=posix --enable-libatomic --enable-libgomp --enable-libquadmath
--enable-libquadmath-support --disable-libssp --enable-libada --disable-symvers
--disable-multilib --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/inclu
de/cloog-isl --without-libiconv-prefix --without-libintl-prefix
--with-system-zlib --enable-linker-build-id
--with-default-libstdcxx-abi=gcc4-compatible --enable-libstdcxx-filesystem-ts
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20250720 (experimental) (GCC)
gcc -xc -ftime-report -c -o empty.o - < <(echo "")
Time variable wall GGC
phase setup : 0.01 ( 85%) 1994k ( 92%)
TOTAL : 0.01 2176k
Extra diagnostic checks enabled; compiler may run slowly.
Configure with --enable-checking=release to disable checks.
---------------------------------------------------------
On Ubuntu 24.04
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/14/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
14.2.0-4ubuntu2~24.04' --with-bugurl=file:///usr/share/doc/gcc-14/README.Bugs
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2,rust --prefix=/usr
--with-gcc-major-version-only --program-suffix=-14
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace
--enable-gnu-unique-object --disable-vtable-verify --enable-plugin
--enable-default-pie --with-system-zlib --enable-libphobos-checking=release
--with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch
--disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none=/bu
ild/gcc-14-ig5ci0/gcc-14-14.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-14-ig5ci0/gcc-14-14.2.0/debian/tmp-gcn/usr
--enable-offload-defaulted --without-cuda-driver --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.0 (Ubuntu 14.2.0-4ubuntu2~24.04)
gcc -xc -ftime-report -c -o empty.o - < <(echo "")
Time variable usr sys wall
GGC
phase setup : 0.00 ( 0%) 0.00 ( 0%) 0.00 ( 0%)
1841k ( 92%)
phase opt and generate : 0.00 ( 0%) 0.01 (100%) 0.01 (100%)
2104 ( 0%)
callgraph optimization : 0.00 ( 0%) 0.00 ( 0%) 0.01 (100%)
0 ( 0%)
callgraph ipa passes : 0.00 ( 0%) 0.01 (100%) 0.01 (100%)
1952 ( 0%)
ipa free lang data : 0.00 ( 0%) 0.01 (100%) 0.00 ( 0%)
0 ( 0%)
TOTAL : 0.00 0.01 0.01
2002k
---------------------------------------------------------
Zartaj
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple