From 7470efb0d391cb8f5d4a7800c3f63e63f410cf31 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 19 May 2022 15:56:05 +0100 Subject: [PATCH] ccl: pull upstream fix for -fno-common Without the change build fails on upstream gcc-10 as: ld: x86_print.o:/build/ccl/lisp-kernel/linuxx8664/../area.h:111: multiple definition of `tcr_area_lock'; pmcl-kernel.o:/build/ccl/lisp-kernel/linuxx8664/../area.h:111: first defined here --- pkgs/development/compilers/ccl/default.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/ccl/default.nix b/pkgs/development/compilers/ccl/default.nix index 79e7d324ec9..761ae5ba019 100644 --- a/pkgs/development/compilers/ccl/default.nix +++ b/pkgs/development/compilers/ccl/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, runCommand, bootstrap_cmds, coreutils, glibc, m4, runtimeShell }: +{ lib, stdenv, fetchurl, fetchpatch, runCommand, bootstrap_cmds, coreutils, glibc, m4, runtimeShell }: let options = rec { @@ -59,6 +59,21 @@ stdenv.mkDerivation rec { sha256 = cfg.sha256; }; + patches = [ + # Pull upstream fiux for -fno-common toolchains: + # https://github.com/Clozure/ccl/pull/316 + (fetchpatch { + name = "fno-common-p1.patch"; + url = "https://github.com/Clozure/ccl/commit/185dc1a00e7492f8be98e5f93b561758423595f1.patch"; + sha256 = "0wqfds7346qdwdsxz3bl2p601ib94rdp9nknj7igj01q8lqfpajw"; + }) + (fetchpatch { + name = "fno-common-p2.patch"; + url = "https://github.com/Clozure/ccl/commit/997de91062d1f152d0c3b322a1e3694243e4a403.patch"; + sha256 = "10w6zw8wgalkdyya4m48lgca4p9wgcp1h44hy9wqr94dzlllq0f6"; + }) + ]; + buildInputs = if stdenv.isDarwin then [ bootstrap_cmds m4 ] else [ glibc m4 ]; CCL_RUNTIME = cfg.runtime;