From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Nieuwenhuizen Subject: bug#37509: [core-updates] [PATCH] gnu: gcc: Fix mingw cross compiler. Date: Wed, 25 Sep 2019 07:06:06 +0200 Message-ID: <871rw5m0ch.fsf@gnu.org> References: <87blv9pmq0.fsf@verum.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:55020) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCzW7-0001Ul-Nb for bug-guix@gnu.org; Wed, 25 Sep 2019 01:07:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCzW6-0000Ie-05 for bug-guix@gnu.org; Wed, 25 Sep 2019 01:07:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iCzW3-0000HB-Vi for bug-guix@gnu.org; Wed, 25 Sep 2019 01:07:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iCzW3-0000oD-QU for bug-guix@gnu.org; Wed, 25 Sep 2019 01:07:03 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87blv9pmq0.fsf@verum.com> (Jan Nieuwenhuizen's message of "Tue, 24 Sep 2019 20:34:31 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 37509@debbugs.gnu.org --=-=-= Content-Type: text/plain Jan Nieuwenhuizen writes: I sent it as when it worked and then found it could be cleaned up; attached. janneke --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-gcc-Fix-mingw-cross-compiler.patch Content-Transfer-Encoding: quoted-printable >From 051e4a62cbc6d48015f0f2f807141ad92ac73cf2 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 24 Sep 2019 20:23:31 +0200 Subject: [PATCH] gnu: gcc: Fix mingw cross compiler. * gnu/packages/patches/gcc-7-cross-mingw.patch: New file. * gnu/packages/cross-base.scm (cross-gcc-patches): Add XGCC parameter; upda= te caller. Use it for target mingw and gcc >=3D 7. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/cross-base.scm | 13 +++++++---- gnu/packages/patches/gcc-7-cross-mingw.patch | 24 ++++++++++++++++++++ 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 gnu/packages/patches/gcc-7-cross-mingw.patch diff --git a/gnu/local.mk b/gnu/local.mk index 5705494090..a7b1c65e82 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -851,6 +851,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/gcc-6-cross-environment-variables.patch \ %D%/packages/patches/gcc-6-source-date-epoch-1.patch \ %D%/packages/patches/gcc-6-source-date-epoch-2.patch \ + %D%/packages/patches/gcc-7-cross-mingw.patch \ %D%/packages/patches/gcc-8-cross-environment-variables.patch \ %D%/packages/patches/gcc-8-strmov-store-file-names.patch \ %D%/packages/patches/gcc-9-asan-fix-limits-include.patch \ diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 78dae7431a..6b27c3cff7 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Court=C3= =A8s ;;; Copyright =C2=A9 2014, 2015, 2018 Mark H Weaver -;;; Copyright =C2=A9 2016 Jan Nieuwenhuizen +;;; Copyright =C2=A9 2016, 2019 Jan Nieuwenhuizen ;;; Copyright =C2=A9 2016 Manolis Fragkiskos Ragkousis ;;; Copyright =C2=A9 2018 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2019 Marius Bakke @@ -190,13 +190,16 @@ base compiler and using LIBC (which may be either a l= ibc package or #f.)" '("CROSS_C_INCLUDE_PATH" "CROSS_CPLUS_INCLUD= E_PATH"))) #t)))))))))) =20 -(define (cross-gcc-patches target) - "Return GCC patches needed for TARGET." +(define (cross-gcc-patches xgcc target) + "Return GCC patches needed for XGCC and TARGET." (cond ((string-prefix? "xtensa-" target) ;; Patch by Qualcomm needed to build the ath9k-htc firmware. (search-patches "ath9k-htc-firmware-gcc.patch")) ((target-mingw? target) - (search-patches "gcc-4.9.3-mingw-gthr-default.patch")) + (append (search-patches "gcc-4.9.3-mingw-gthr-default.patch") + (if (version>=3D? (package-version xgcc) "7.0") + (search-patches "gcc-7-cross-mingw.patch") + '()))) (else '()))) =20 (define (cross-gcc-snippet target) @@ -229,7 +232,7 @@ target that libc." ((version>=3D? (package-version xgcc) "8.0") (searc= h-patch "gcc-8-cross-environment-variables.patch")) ((version>=3D? (package-version xgcc) "6.0") (searc= h-patch "gcc-6-cross-environment-variables.patch")) (else (search-patch "gcc-cross-environment-variabl= es.patch"))) - (cross-gcc-patches target)))) + (cross-gcc-patches xgcc target)))) (modules '((guix build utils))) (snippet (cross-gcc-snippet target)))) diff --git a/gnu/packages/patches/gcc-7-cross-mingw.patch b/gnu/packages/pa= tches/gcc-7-cross-mingw.patch new file mode 100644 index 0000000000..eec6f88953 --- /dev/null +++ b/gnu/packages/patches/gcc-7-cross-mingw.patch @@ -0,0 +1,24 @@ +This fixes + +../../../../gcc-7.4.0/libstdc++-v3/libsupc++/new_opa.cc: In function =E2= =80=98void* __gnu_cxx::aligned_alloc(std::size_t, std::size_t)=E2=80=99: +../../../../gcc-7.4.0/libstdc++-v3/libsupc++/new_opa.cc:78:10: error: =E2= =80=98memalign=E2=80=99 was not declared in this scope + return memalign (al, sz); + ^~~~~~~~ +../../../../gcc-7.4.0/libstdc++-v3/libsupc++/new_opa.cc:78:10: note: sugge= sted alternative: =E2=80=98max_align_t=E2=80=99 + return memalign (al, sz); + ^~~~~~~~ + max_align_t + +diff --git a/libstdc++-v3/libsupc++/new_opa.cc b/libstdc++-v3/libsupc++/ne= w_opa.cc +index 94e79cadb0e..084900e0daf 100644 +--- a/libstdc++-v3/libsupc++/new_opa.cc ++++ b/libstdc++-v3/libsupc++/new_opa.cc +@@ -39,6 +39,8 @@ extern "C" void *memalign(std::size_t boundary, std::siz= e_t size); + # endif + #endif +=20 ++#define memalign _aligned_malloc ++ + using std::new_handler; + using std::bad_alloc; +=20 --=20 2.23.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com --=-=-=--