From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id YLcVMi95bGfVcAAAqHPOHw:P1 (envelope-from ) for ; Wed, 25 Dec 2024 21:29:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id YLcVMi95bGfVcAAAqHPOHw (envelope-from ) for ; Wed, 25 Dec 2024 22:29:19 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=Z0IvELo6; dkim=fail ("headers rsa verify failed") header.d=disroot.org header.s=mail header.b=iJtaq7Mn; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735162159; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=PtBPTP90bjb1WAtdyXUNGqhdRHUtCla7+aMenT8Fnzw=; b=KaB6KgCGp0vxFOCS0Dxr3BXVLm9jvUR6pXrM/+s5e1cc/4huMVUXtxn6cynB8oHWP5aBG9 ZQJZTP0qe3mJzUOdDGYvjEr9RV/qw+MZv0JKQO9lco8YAO1eYQfSfYR73b9RJBLaRUfO/t 9QLtlEy0fHJ8rTunx25RQ5XYXN7msULx3d8Mj9ZvSpJCNxdic6K8KRvWGHYaeuN3Cskv4x TpFh4fDhXwGHv47oFxwuXAlDI4cHiYEgiXreJjEgZE4x70f+Gfm4QdoAn1+xzcSFqOoRUO LiLa/kNkMA5tQW5vBLpvzCJs5M2e+CbX1KqBb+qCO8YXb65+bAnIyt/eGZLH7g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=Z0IvELo6; dkim=fail ("headers rsa verify failed") header.d=disroot.org header.s=mail header.b=iJtaq7Mn; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735162159; a=rsa-sha256; cv=none; b=h7FSmGL39nN/IzOwJJK5oCM3B6ot9jOMRWNf4aX1F/pmDUi3NoMwIvzrebrs0JPtn0D6Hd b6uBTiilPuYJeiRwXY55Wajl3NSqLE3xwTmrroFQBvgeAtsg65KAhe/RsGEsS90tuqMy7S vodBmBmTBBT6Ugr9kQ1rnMQvJLhplaArNY/wrYMZJFazwsPoA14VBfQgrld0pkBrC8HYSs 5uWRY/VGHohqo6zwfk8FMYZsveJVIm1G7SU/0v51RSP8/l1Awg2SDgE1/yxNFGaLHyXQ12 k/wbf8FMPxEL6oWVe+ttCDSq/xrV3rCKdcfr63ji+28xh3zdrpN4wvzIfJZtHA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 09B4143A9E for ; Wed, 25 Dec 2024 22:29:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQYwC-0002Ua-Ty; Wed, 25 Dec 2024 16:29:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQYwA-0002U5-5J for guix-patches@gnu.org; Wed, 25 Dec 2024 16:29:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQYw9-0003cH-Sk for guix-patches@gnu.org; Wed, 25 Dec 2024 16:29:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=PtBPTP90bjb1WAtdyXUNGqhdRHUtCla7+aMenT8Fnzw=; b=Z0IvELo6ME+OLJuy/yTd90QV1GN0V53teAMDTo+gHR0FCWKWTsxE2Sj3ehN4aZYgLCEV6mtUvozyDTLYGuzMcDsPUb+1kB9+tteyd82gwCZreWM0ybMGR+KV9kJDUAqqOZ0dCfwmq5CyToUDW5FwWkde1PT4Hdp2HWdGPLD+GJPsdsJX8bu91XDaHM6+BoqfOKn9kdLCUaDl4jBJ9zBViIPgLg20E16Dx6obipIuvL2SsLL5cFr/dMC5XZC/37guKOit5hqIi36MK41XXl7hcAsOAfcAzdFbngJOV8Jj0FO6X3AJCB+9u6DplMV/5P7Ct6NayBEoIGYwQWczUJBkvg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQYw9-0001dT-Nx for guix-patches@gnu.org; Wed, 25 Dec 2024 16:29:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74734] [PATCH v3] gnu: Add inferno. References: <20241208002411.20796-1-gay@disroot.org> In-Reply-To: <20241208002411.20796-1-gay@disroot.org> Resent-From: Homo Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 25 Dec 2024 21:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74734 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74734@debbugs.gnu.org Cc: Homo Received: via spool by 74734-submit@debbugs.gnu.org id=B74734.17351621096241 (code B ref 74734); Wed, 25 Dec 2024 21:29:01 +0000 Received: (at 74734) by debbugs.gnu.org; 25 Dec 2024 21:28:29 +0000 Received: from localhost ([127.0.0.1]:39105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQYvc-0001ca-4k for submit@debbugs.gnu.org; Wed, 25 Dec 2024 16:28:29 -0500 Received: from layka.disroot.org ([178.21.23.139]:51670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQYvY-0001cL-P2 for 74734@debbugs.gnu.org; Wed, 25 Dec 2024 16:28:26 -0500 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 63DD725B68; Wed, 25 Dec 2024 22:28:23 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 2b7l21d5IXts; Wed, 25 Dec 2024 22:28:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1735162099; bh=CtDlDe6DjDiBCadVyxP2dfbwvWDN3JYl9FYbq4QE84s=; h=From:To:Cc:Subject:Date; b=iJtaq7MnCAokAxdBIUZrBIYk3OFwuts5yxTHF1zfbvTO4+f4VzQAzCq82+MSr+UQG QT0flsHUUmnw8HPVLq2PN3iRyrWor5puoKTQ5fc45f+3BfXzl8PPKByg+ibetR29fO KNYues+Q36/lL2ZfPuLDuTKh4ZUQH6GzibeeWgKuecp6l3kN5x/NbplyUHfoLZDvKR 5chbV5Gq7/2eVnJRJe8oqtbqxdYZVfa5DCpW0U2oEGf1yFhUJi0JtBWkulYaBwWWZK 19hz4POsSP2glwKiNXyGsoi8C0UPtxCmRKbbBDc208RJDtBdOCBrYXfdAI1t7vQiLV tyx7hn5EVexpg== Date: Wed, 25 Dec 2024 23:23:30 +0200 Message-ID: <20241225212804.26266-1-gay@disroot.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Homo X-ACL-Warn: , Homo via Guix-patches From: Homo via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -3.71 X-Spam-Score: -3.71 X-Migadu-Queue-Id: 09B4143A9E X-TUID: F0h51ftFOPQ9 Based on earlier work rejected for licensing reasons, code has been relicensed from LPL to Expat. Just in case remove all fonts from distribution, instead fonts from plan9port are used. * gnu/packages/inferno.scm: New file. * gnu/packages/patches/inferno-fix-crash.patch: New file. * gnu/local.mk (GNU_SYSTEM_MODULES, dist_patch_DATA): Register new files. Change-Id: Ie655f97fec5e249b8bbc92c66c5f13afabbc0552 --- Cleaned up mess caused by invoking guix style. Now builds with mk from plan9port. Some refactoring to improve readability and maintainability. gnu/local.mk | 2 + gnu/packages/inferno.scm | 311 +++++++++++++++++++ gnu/packages/patches/inferno-fix-crash.patch | 16 + 3 files changed, 329 insertions(+) create mode 100644 gnu/packages/inferno.scm create mode 100644 gnu/packages/patches/inferno-fix-crash.patch diff --git a/gnu/local.mk b/gnu/local.mk index 84160f407a..cc15134036 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -377,6 +377,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/image-processing.scm \ %D%/packages/image-viewers.scm \ %D%/packages/imagemagick.scm \ + %D%/packages/inferno.scm \ %D%/packages/inklingreader.scm \ %D%/packages/inkscape.scm \ %D%/packages/installers.scm \ @@ -1591,6 +1592,7 @@ dist_patch_DATA = \ %D%/packages/patches/igraph-fix-varargs-integer-size.patch \ %D%/packages/patches/ilmbase-fix-tests.patch \ %D%/packages/patches/indent-CVE-2024-0911.patch \ + %D%/packages/patches/inferno-fix-crash.patch \ %D%/packages/patches/instead-use-games-path.patch \ %D%/packages/patches/intltool-perl-compatibility.patch \ %D%/packages/patches/inetutils-hurd64.patch \ diff --git a/gnu/packages/inferno.scm b/gnu/packages/inferno.scm new file mode 100644 index 0000000000..1fa90a5d63 --- /dev/null +++ b/gnu/packages/inferno.scm @@ -0,0 +1,311 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2018 Diego Nicola Barbato +;;; Copyright © 2024 Homo +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages inferno) + #:use-module (guix build-system gnu) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module ((guix licenses) + #:prefix license:) + #:use-module (gnu packages) + #:use-module (gnu packages plan9) + #:use-module (gnu packages xorg) + #:use-module (ice-9 match)) + +(define-public inferno + (let ((commit "67e70befb2ad0058fd7894be34c492ddb6d09988") + (revision "0")) + (package + (name "inferno") + (version (git-version "4" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/inferno-os/inferno-os") + (commit commit) + ;; Inferno uses customized Freetype library with #include "lib9.h" + ;; TODO: use packaged Freetype library. + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0g3fzb991hbwa7r3vsnybw7m1v13nins5ajmygnvz4vmx5rzl405")) + (patches (search-patches "inferno-fix-crash.patch")) + (modules '((guix build utils))) + ;; Remove bundled non-free and potentially non-free fonts. + (snippet '(begin + (delete-file-recursively "fonts") #t)))) + (build-system gnu-build-system) + (inputs (list libx11 libxext plan9port xorgproto)) + (arguments + (list + ;; Force a 32-bit build targeting a similar architecture, i.e.: + ;; armhf for armhf/aarch64, i686 for i686/x86_64. + #:system (match (%current-system) + ((or "armhf-linux" "aarch64-linux") + "armhf-linux") + (_ "i686-linux")) + ;; No tests. + #:tests? #f + #:phases + #~(let* + ((bash (assoc-ref %build-inputs "bash")) + (bindir (string-append #$output "/bin")) + (emu-script (string-append bindir "/emu")) + (infwm-script (string-append bindir "/infwm")) + (objtype #$@(match (%current-system) + ((or "armhf-linux" "aarch64-linux") + `("arm")) + (_ `("386")))) + (root (string-append #$output "/share/inferno")) + (root/bindir (string-append root "/Linux/" objtype "/bin")) + (root/fontdir (string-append root "/fonts")) + (simulate-fonts + (lambda (size targets) + (string-concatenate + (map (lambda (file) + (string-append + "ramfile /fonts/" file ".font; " + "bind /fonts/fixed/unicode." size ".font" + " /fonts/" file ".font; ")) + targets)))) + (write-script + (lambda (file cmds) + (with-output-to-file file + (lambda () + (display + (string-concatenate + (cons* "#!" bash "/bin/sh\n" + cmds))))) + (chmod file #o755)))) + (modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key source #:allow-other-keys) + ;; Copy directly to 'root' since the source + ;; tree doubles as Inferno's root directory + ;; and its path is baked into the emu binary. + (mkdir-p root) + (copy-recursively source root) + ;; Delete pre-built binaries. + (delete-file-recursively root/bindir) + (chdir root))) + (add-after 'unpack 'patch-src-files + (lambda _ + ;; Substitute ocurrences of /bin/sh. + (for-each (lambda (file) + (substitute* file + (("/bin/sh") + (string-append bash + "/bin/sh")))) + '("makemk.sh" + "mkfiles/mkhost-Linux" + "emu/Linux/mk-wrt" + "utils/mk/Posix.c")) + ;; Do not pass '-m32' unconditionally + ;; when building mk. + (substitute* "makemk.sh" (("-m32") "")) + ;; Use the correct name for gcc. + (substitute* "mkfiles/mkfile-Linux-386" + (("cc -") + ;; Don't match yacc. + "gcc -")) + (substitute* "mkfiles/mkfile-Linux-arm" + (("arm-gcc") + "gcc")) + ;; Conflicting occurence of fsub. + (for-each (lambda (file) + (substitute* file + (("fsub") + "_fsub"))) + '("utils/libmach/vcodas.c" + "utils/libmach/vdb.c")) + ;; Fix build. + (for-each (lambda (file) + (substitute* file + (("^CFLAGS=") + "CFLAGS=-D_GNU_SOURCE -fcommon"))) + '("mkfiles/mkfile-Linux-386" + "mkfiles/mkfile-Linux-arm" + "mkfiles/mkfile-Linux-power" + "mkfiles/mkfile-Linux-spim")) + ;; Make build reproducible by + ;; ensuring timestamps embedded into + ;; binaries are set to 0. + (substitute* "emu/Linux/mkfile" + (("^KERNDATE=.*$") + "KERNDATE=0\n")))) + (replace 'configure + (lambda _ + (substitute* "mkconfig" + (("ROOT=/usr/inferno") + (string-append "ROOT=" root)) + (("SYSHOST=Plan9") + "SYSHOST=Linux") + (("OBJTYPE=\\$objtype") + (string-append "OBJTYPE=" objtype))))) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + ;; Add mk's and future utilities' locations to PATH. + (setenv "PATH" + (string-append + root/bindir ":" + (getenv "PATH") ":" + (search-input-directory inputs "/plan9/bin"))) + ;; Build emu, utilities and .dis files using mk. + (mkdir-p root/bindir) + (invoke "mk" "-s" "nuke" "mkdirs" "install"))) + (replace 'install + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p bindir) + (mkdir-p root/fontdir) + ;; Install emu script. + (write-script emu-script (list + "exec " root/bindir "/emu sh -c \"" + ;; Use plan9port's fonts. + "bind '#U*" + (search-input-directory inputs "/plan9/font") + "' /fonts; " + ;; Pretend fonts were not removed. + ;; TODO: de-hardcode fonts from apps. + ;; TODO: use fonts available in the host system, + ;; plan9port's fontsrv is a good way to start. + ;; TODO: find fix for minitel fonts. + "memfs -b /fonts; " + (string-concatenate + (map (lambda (dir) + (string-append + "mkdir /fonts/" dir "; " + "bind /fonts/fixed /fonts/" dir "; ")) + '("charon" "lucida" "lucidasans" "lucm" "pelm"))) + (simulate-fonts "6x9" + '("charon/cw.tiny" + "charon/plain.tiny" + "lucida/unicode.6" + "lucidasans/latin1.6" + "lucidasans/typelatin1.6" + "lucidasans/unicode.6")) + (simulate-fonts "7x13" + '("charon/cw.small" + "charon/plain.small" + "lucida/unicode.7" + "lucidasans/latin1.7" + "lucidasans/typelatin1.7" + "lucidasans/unicode.7")) + (simulate-fonts "8x13" + '("charon/cw.normal" + "charon/plain.normal" + "lucida/unicode.8" + "lucidasans/euro.8" + "lucidasans/latin1.8" + "lucidasans/typelatin1.8" + "lucidasans/unicode.8" + "pelm/unicode.8")) + (simulate-fonts "9x15" + '("charon/cw.large" + "charon/plain.large" + "lucida/unicode.10" + "lucidasans/latin1.10" + "lucidasans/typelatin1.10" + "lucidasans/unicode.10" + "lucm/unicode.9" + "pelm/ascii.12" + "pelm/latin1.9" + "pelm/unicode.9")) + (simulate-fonts "10x20" + '("charon/cw.vlarge" + "charon/plain.vlarge" + "lucida/moo.16" + "lucida/unicode.13" + "lucidasans/latin1.13" + "lucidasans/typelatin1.13" + "lucidasans/unicode.13" + "pelm/ascii.16")) + (simulate-fonts "6x13O" + '("charon/italic.tiny" + "charon/italic.small" + "lucidasans/italiclatin1.6" + "lucidasans/italiclatin1.7")) + (simulate-fonts "7x13O" + '("charon/italic.normal" + "lucidasans/italiclatin1.8")) + (simulate-fonts "8x13O" + '("charon/italic.large" + "charon/italic.vlarge" + "lucidasans/italiclatin1.10" + "lucidasans/italiclatin1.13")) + (simulate-fonts "6x13B" + '("charon/bold.tiny" + "lucidasans/boldlatin1.6")) + (simulate-fonts "7x13B" + '("charon/bold.small" + "lucidasans/boldlatin1.7")) + (simulate-fonts "8x13B" + '("charon/bold.normal" + "lucidasans/boldlatin1.8")) + (simulate-fonts "9x15B" + '("charon/bold.large" + "lucidasans/boldlatin1.10")) + (simulate-fonts "9x18B" + '("charon/bold.vlarge" + "lucidasans/boldlatin1.13")) + ;; Bind the host's /tmp to Inferno's + ;; /tmp to make it writable. + "bind -bc '#U*/tmp' /tmp; " + ;; Bind the host's /home to Inferno's + ;; /usr. + "bind '#U*/home' /usr; " + "$*\"\n")) + ;; Install infwm script. + (write-script infwm-script (list + "exec " bindir "/emu $* wm/wm wm/logon -u $USER\n")) + ;; Install a symlink to the Limbo compiler. + (symlink (string-append root/bindir "/limbo") + (string-append bindir "/limbo")))))))) + (home-page "https://www.inferno-os.org") + (synopsis + "Compact operating system for building cross-platform distributed systems") + (description + ;; Except for the last sentence this is taken verbatim from the + ;; intro(1) man page (man/1/0intro in the source tree). + "Inferno is a virtualised operating system that can run natively across +a wide range of processor architectures or hosted on a wide range of +operating systems. The principal components of the system are: +@itemize +@item The Inferno kernel which can run both native and hosted on a +range of platforms and which presents the same interface to programs +in both cases. +@item The Dis virtual machine. +@item Styx - the tiny broad-spectrum file service protocol. +@item Limbo - a new simple, modular, concurrent programming language. +@item Tk and Prefab - graphical user interface (GUI) primitives +without a lot of goo. +@item The portable cross-development suites that allow any native +Inferno platform to be cross-compiled on any hosted system. +@end itemize +This package provides hosted Inferno. +") + (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux" + "aarch64-linux")) + (license (list license:expat ;MIT license + license:freetype + ;; According to NOTICE the combined work is effectively + ;; GPLv2+. + license:gpl2+ + license:lgpl2.0+))))) diff --git a/gnu/packages/patches/inferno-fix-crash.patch b/gnu/packages/patches/inferno-fix-crash.patch new file mode 100644 index 0000000000..b9cde87f21 --- /dev/null +++ b/gnu/packages/patches/inferno-fix-crash.patch @@ -0,0 +1,16 @@ +Fixes crash. + +diff --git a/emu/Linux/os.c b/emu/Linux/os.c +index 08b039d6..0d8a0cf3 100644 +--- a/emu/Linux/os.c ++++ b/emu/Linux/os.c +@@ -18,6 +18,9 @@ + + #include + ++/* For dynamic linking init/fini code that needs malloc */ ++void (*coherence)(void) = nofence; ++ + /* glibc 2.3.3-NTPL messes up getpid() by trying to cache the result, so we'll do it ourselves */ + #include + #define getpid() syscall(SYS_getpid) -- 2.47.1