From patchwork Sun May 5 14:33:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Dong X-Patchwork-Id: 13904 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2A86D16FA0; Sun, 5 May 2019 15:34:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 56FBC16F26 for ; Sun, 5 May 2019 15:34:08 +0100 (BST) Received: from localhost ([127.0.0.1]:41915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNIDP-0004bC-Kl for patchwork@mira.cbaines.net; Sun, 05 May 2019 10:34:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNIDM-0004aq-SP for guix-patches@gnu.org; Sun, 05 May 2019 10:34:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNIDL-0006VV-A2 for guix-patches@gnu.org; Sun, 05 May 2019 10:34:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41078) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNIDK-0006VA-Vt for guix-patches@gnu.org; Sun, 05 May 2019 10:34:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hNIDK-00069J-Se for guix-patches@gnu.org; Sun, 05 May 2019 10:34:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35568] [PATCH v2 2/3] gnu: cross-base: Apply gcc 8 patch to gcc >= 8. References: In-Reply-To: Resent-From: Carl Dong Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 05 May 2019 14:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35568 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "35568@debbugs.gnu.org" <35568@debbugs.gnu.org> Received: via spool by 35568-submit@debbugs.gnu.org id=B35568.155706683823620 (code B ref 35568); Sun, 05 May 2019 14:34:02 +0000 Received: (at 35568) by debbugs.gnu.org; 5 May 2019 14:33:58 +0000 Received: from localhost ([127.0.0.1]:54621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNIDF-00068t-J6 for submit@debbugs.gnu.org; Sun, 05 May 2019 10:33:57 -0400 Received: from mail2.protonmail.ch ([185.70.40.22]:10612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNIDC-00068f-QB for 35568@debbugs.gnu.org; Sun, 05 May 2019 10:33:55 -0400 Date: Sun, 05 May 2019 14:33:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=carldong.me; s=protonmail; t=1557066828; bh=pfuoUIH6Udfw09nv+G3925XERI6yxMq5Zapq5q6HrHQ=; h=Date:To:From:Reply-To:Subject:Feedback-ID:From; b=FSEVSmPtaLDmtxZgLhKAFnCk5qWHLF/osL4re86BRMUNe45whaaV0Qc45kiUjMLTe k1AkpLamD55sy6yJlRCKcbsjiic/YKFQMYcOzTugz1Fm0vM9OFiDDsGCwBkAQpGe6k LFF8IUPatXkDiw4BdpH7CwzvAM+a7SL5gmYkGXls= From: Carl Dong Message-ID: <8Pt5zdrxwg_AqFCKLXGQuW0e7ZIJiK1s_2rSJQPTCrbrvZ83d-9WTpYqWs1UAFeB6Gm3JfH9y-qqxbCx2oe4xYKFlZACVvgrrP_LZYn9dyQ=@carldong.me> Feedback-ID: a8j8tDUaJ4AYuDVBywMTwsJebN4w8TVXadJLsJb8td3t3dZi9RdXFlPaQvoFKnI9KgXySsPXcRkajVyY0cGTcA==:Ext:ProtonMail MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Carl Dong Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/cross-base.scm (cross-gcc): Apply gcc 8 patch to gcc >= 8. * gnu/packages/patches/gcc-8-cross-environment-variables.patch: New file. * gnu/local.mk (dist_patch_DATA): Add the patch. --- gnu/local.mk | 1 + gnu/packages/cross-base.scm | 7 +- .../gcc-8-cross-environment-variables.patch | 67 +++++++++++++++++++ 3 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/gcc-8-cross-environment-variables.patch -- 2.21.0 diff --git a/gnu/local.mk b/gnu/local.mk index 7363655f38..847ebf677c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -813,6 +813,7 @@ dist_patch_DATA = \ %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-8-cross-environment-variables.patch \ %D%/packages/patches/gcc-8-strmov-store-file-names.patch \ %D%/packages/patches/gcc-9-strmov-store-file-names.patch \ %D%/packages/patches/gd-CVE-2018-5711.patch \ diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index bb3d6d916a..25caacb723 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -205,9 +205,10 @@ target that libc." (patches (append (origin-patches (package-source xgcc)) - (cons (if (version>=? (package-version xgcc) "6.0") - (search-patch "gcc-6-cross-environment-variables.patch") - (search-patch "gcc-cross-environment-variables.patch")) + (cons (cond + ((version>=? (package-version xgcc) "8.0") (search-patch "gcc-8-cross-environment-variables.patch")) + ((version>=? (package-version xgcc) "6.0") (search-patch "gcc-6-cross-environment-variables.patch")) + (else (search-patch "gcc-cross-environment-variables.patch"))) (cross-gcc-patches target)))) (modules '((guix build utils))) (snippet diff --git a/gnu/packages/patches/gcc-8-cross-environment-variables.patch b/gnu/packages/patches/gcc-8-cross-environment-variables.patch new file mode 100644 index 0000000000..06309bdf9d --- /dev/null +++ b/gnu/packages/patches/gcc-8-cross-environment-variables.patch @@ -0,0 +1,67 @@ +Search path environment variables for cross-compilers. See the discussion +at . + +Note: Touch 'C_INCLUDE_PATH' et al. rather than 'CPATH', as discussed +at . + +diff --git a/gcc/gcc.c b/gcc/gcc.c +index a716f708259..dc7862f413a 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -4342,7 +4342,7 @@ process_command (unsigned int decoded_options_count, + } + + temp = env.get (LIBRARY_PATH_ENV); +- if (temp && *cross_compile == '0') ++ if (temp) + { + const char *startp, *endp; + char *nstore = (char *) alloca (strlen (temp) + 3); +diff --git a/gcc/incpath.c b/gcc/incpath.c +index b11c6a57939..a66a94a04e5 100644 +--- a/gcc/incpath.c ++++ b/gcc/incpath.c +@@ -472,8 +472,8 @@ register_include_chains (cpp_reader *pfile, const char *sysroot, + int stdinc, int cxx_stdinc, int verbose) + { + static const char *const lang_env_vars[] = +- { "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH", +- "OBJC_INCLUDE_PATH", "OBJCPLUS_INCLUDE_PATH" }; ++ { "CROSS_C_INCLUDE_PATH", "CROSS_CPLUS_INCLUDE_PATH", ++ "CROSS_OBJC_INCLUDE_PATH", "CROSS_OBJCPLUS_INCLUDE_PATH" }; + cpp_options *cpp_opts = cpp_get_options (pfile); + size_t idx = (cpp_opts->objc ? 2: 0); + +@@ -484,7 +484,7 @@ register_include_chains (cpp_reader *pfile, const char *sysroot, + + /* CPATH and language-dependent environment variables may add to the + include chain. */ +- add_env_var_paths ("CPATH", INC_BRACKET); ++ add_env_var_paths ("CROSS_CPATH", INC_BRACKET); + add_env_var_paths (lang_env_vars[idx], INC_SYSTEM); + + target_c_incpath.extra_pre_includes (sysroot, iprefix, stdinc); +diff --git a/gcc/system.h b/gcc/system.h +index 4abc321c71d..d6186476024 100644 +--- a/gcc/system.h ++++ b/gcc/system.h +@@ -1209,4 +1209,6 @@ helper_const_non_const_cast (const char *p) + void qsort_chk (void *, size_t, size_t, int (*)(const void *, const void *)); + #endif + ++#define LIBRARY_PATH_ENV "CROSS_LIBRARY_PATH" ++ + #endif /* ! GCC_SYSTEM_H */ +diff --git a/gcc/tlink.c b/gcc/tlink.c +index ec20bd2fa0f..cd17bdce004 100644 +--- a/gcc/tlink.c ++++ b/gcc/tlink.c +@@ -456,7 +456,7 @@ recompile_files (void) + file *f; + + putenv (xstrdup ("COMPILER_PATH=")); +- putenv (xstrdup ("LIBRARY_PATH=")); ++ putenv (xstrdup (LIBRARY_PATH_ENV "=")); + + while ((f = file_pop ()) != NULL) + {