diff --git a/pkgs/development/compilers/gcc/common/configure-flags.nix b/pkgs/development/compilers/gcc/common/configure-flags.nix index be7f3df42de..f38ce180b1f 100644 --- a/pkgs/development/compilers/gcc/common/configure-flags.nix +++ b/pkgs/development/compilers/gcc/common/configure-flags.nix @@ -58,8 +58,9 @@ let "--with-gnu-as" "--with-gnu-ld" "--disable-debug" - "--enable-sjlj-exceptions" "--disable-win32-registry" + ] ++ lib.optionals (crossMingw && targetPlatform.isx86_32) [ + "--enable-sjlj-exceptions" ] else [ (if crossDarwin then "--with-sysroot=${lib.getLib libcCross}/share/sysroot" else "--with-headers=${lib.getDev libcCross}${libcCross.incdir or "/include"}") @@ -81,13 +82,14 @@ let # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 "--disable-libmpx" ] ++ lib.optionals crossMingw [ - "--enable-sjlj-exceptions" "--enable-hash-synchronization" "--enable-libssp" "--disable-nls" - "--with-dwarf2" # To keep ABI compatibility with upstream mingw-w64 "--enable-fully-dynamic-string" + ] ++ lib.optionals (crossMingw && targetPlatform.isx86_32) [ + "--enable-sjlj-exceptions" + "--with-dwarf2" ] ++ lib.optional (targetPlatform.libc == "newlib") "--with-newlib" ++ lib.optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" );