diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index b2330abd4b75b..54e5e9bbfcc2e 100644 --- a/pkgs/development/compilers/gcc/11/default.nix +++ b/pkgs/development/compilers/gcc/11/default.nix @@ -87,7 +87,9 @@ let majorVersion = "11"; ++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch # openjdk build fails without this on -march=opteron; is upstream in gcc12 - ++ [ ./gcc-issue-103910.patch ]; + ++ [ ./gcc-issue-103910.patch ] + + ++ optional (langFortran && crossMingw) ../mingw-gfortran-no-pthread_t-alias.patch; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; diff --git a/pkgs/development/compilers/gcc/12/default.nix b/pkgs/development/compilers/gcc/12/default.nix index 78dc30a34463e..76979647d1840 100644 --- a/pkgs/development/compilers/gcc/12/default.nix +++ b/pkgs/development/compilers/gcc/12/default.nix @@ -121,7 +121,9 @@ let majorVersion = "12"; ++ optional (stdenv.isDarwin && langAda) ../gnat-darwin-dylib-install-name.patch # Obtain latest patch with ../update-mcfgthread-patches.sh - ++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch; + ++ optional (!crossStageStatic && targetPlatform.isMinGW && threadsCross.model == "mcf") ./Added-mcf-thread-model-support-from-mcfgthread.patch + + ++ optional (langFortran && crossMingw) ../mingw-gfortran-no-pthread_t-alias.patch; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; diff --git a/pkgs/development/compilers/gcc/mingw-gfortran-no-pthread_t-alias.patch b/pkgs/development/compilers/gcc/mingw-gfortran-no-pthread_t-alias.patch new file mode 100644 index 0000000000000..20037c21bc4c2 --- /dev/null +++ b/pkgs/development/compilers/gcc/mingw-gfortran-no-pthread_t-alias.patch @@ -0,0 +1,13 @@ +diff --git a/libgfortran/io/async.h b/libgfortran/io/async.h +index efd542a..d57722a 100644 +--- a/libgfortran/io/async.h ++++ b/libgfortran/io/async.h +@@ -351,7 +351,7 @@ typedef struct async_unit + struct adv_cond work; + struct adv_cond emptysignal; + struct st_parameter_dt *pdt; +- pthread_t thread; ++ __gthread_t thread; + struct transfer_queue *head; + struct transfer_queue *tail; +