X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id C036ADC0B25 for ; Mon, 16 May 2016 13:31:38 +0000 (UTC) Received: from mail-ig0-f176.google.com (mail-ig0-f176.google.com [209.85.213.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 556ABDC08F3 for ; Mon, 16 May 2016 13:31:38 +0000 (UTC) Received: by mail-ig0-f176.google.com with SMTP id bi2so53706939igb.0 for ; Mon, 16 May 2016 06:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=RE2BUd1FewwZpf/sSdk9g+b9IKjOCccoaEewdT4zT7Y=; b=eLjIlB+hCmTpVfKWoukFNK4hGYYbZPCEWVzr2i6863QUwvSsufjNy0YLCoUsNCzHc7 zyh0tT1AqK9ssoQbhztpLuGaSNqW10JEZcCYi1/Ye4Ep8Ke8TNPwazg+Z7gYy8TH4+TS wKGV7AIhNOQErEwRX19f1/TilA9wFuLIohGudGKMUpGdEgZR4lllIrTIGKUwbJt3AbBl 11uetRC4QLJdYSxwaxma8HzZ5WAni1A5BDW8Zauiepv1ldS8lQYSnFQUW9X6dO+B1dtE NAHROzt8FYQQzZcTSde8fq6y/rIt/4CKIXc0+065eB49/f403rT2IrPvqVTHxGnd/rei BY0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=RE2BUd1FewwZpf/sSdk9g+b9IKjOCccoaEewdT4zT7Y=; b=Ph+oRg1AXsYUZJhxOOqRImZLnkS1QiAcBgGHQ962GX8vqCOXIeNuA+SGn6aze+0kaX UjAUaSnP/4PyTg3kaHH0ZEAp1HcigoDjIUVCijchDR4akzQwIPWv1gWFeKy42Nhl+BEf Pa9ClhzjE2DRO2XNCuO0ER/VL99QpMkzf6t3WKRI8O68xCqUMIdFuswj4RwO6B8BAgf0 UNtaqcPqcA73ImIG6rWGhSV91Qzomw1YqOw/TPGi8+NPpygOi5lBPsePHC8YBj/+aDrn Z5rpj2QYDlP2qTdeWDmorUR95PeILHhEpaAlt21FrXgngwpXbb2RmBOG2UOs0P4xbVm0 qdSg== X-Gm-Message-State: AOPr4FUm8PeiEDp4KCRiqliQZkVSJdqFmuXx6kpPpzYoV1waesomRDzSwVF9eTkX1I2aVQ== X-Received: by 10.50.67.113 with SMTP id m17mr9113989igt.62.1463405496484; Mon, 16 May 2016 06:31:36 -0700 (PDT) Received: from ?IPv6:2601:448:8200:2f:e50c:7607:2d6c:591f? ([2601:448:8200:2f:e50c:7607:2d6c:591f]) by smtp.gmail.com with ESMTPSA id d1sm5504360igv.5.2016.05.16.06.31.35 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 May 2016 06:31:36 -0700 (PDT) Content-Type: text/plain; charset=utf-8 X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [alpine-aports] [PATCH 1/4] testing/ghc-llvm new aport From: Mitch Tishmack In-Reply-To: <20160516111124.663becd2@ncopa-desktop.alpinelinux.org> Date: Mon, 16 May 2016 08:31:35 -0500 Cc: alpine-aports@lists.alpinelinux.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <1463369418-51523-1-git-send-email-mitch.tishmack@gmail.com> <1463369418-51523-2-git-send-email-mitch.tishmack@gmail.com> <20160516111124.663becd2@ncopa-desktop.alpinelinux.org> To: Natanael Copa X-Mailer: Apple Mail (2.3124) X-Virus-Scanned: ClamAV using ClamSMTP The shorter answer is: As of today it could if llvm were 3.7.1 (note 3.3 currently ships llvm = 3.6.2 which does not work with ghc 8.0.1 at all due to arm codegen = bugs), in the future it will likely break on arm when llvm itself is = upgraded to newer releases. The longer answer is a bit more complex and nuanced. Two useful links that I=E2=80=99ll expect are read/understood first one = more than the latter: https://ghc.haskell.org/trac/ghc/wiki/ImprovedLLVMBackend https://ghc.haskell.org/trac/ghc/wiki/Status/GHC-8.0.1 Lets back time up to my prior ghc 7.10.3 port which didn=E2=80=99t = support arm. Ghc 7.10 requires llvm 3.5.2, which last existed in alpine = linux 3.1. While I managed to get ghc 7.10.3 to work with llvm 3.6, it = was very much a frankenbuild and even after all the work, didn=E2=80=99t = work on arm anyway. I also ran into bugs in both llvm itself, and ghc = when trying to get the port working on arm. x86_64 worked fine, but = x86_64 has a legacy code generator it can use along with llvm so that is = more a case of happy accident. Needless to say there are three competing release and development = schedules that make system llvm a rather unappealing target: - ghc - llvm - alpine linux While today it may be fine to use the system llvm, when llvm is upgraded = to 3.8, or 3.9, or 3.9 + N, there is no guarantee that the llvm = optimizer may not change how it optimizes llvm ir. Indeed the ir format = may change as has happened as recently as the 3.4->3.5 transition. So all roads lead to Rome here in having bad choices all around. = Basically: - Try to hack ghc to support newer versions of llvm.=20 Pros: uses system llvm=20 Cons: likely to break, also likely to produce subtlely broken = executables as ghc version X is only ever used/tested with the llvm it = is released with. I=E2=80=99ve hit this exact case with llvm 3.5 and arm = codegen. - Don=E2=80=99t support arm for ghc very well or realistically at all = and just use system llvm Pros: Don=E2=80=99t need to worry about llvm version changes if we stick = to just x86_64 and consider arm a free for all. Cons: Well arm support in this case is basically a crapshoot. I note = this only for completeness. - Compile llvm 3.7.1 and have a versioned port that could be depended = upon in the future for when newer llvm releases are out. Pros: Ghc is freed from system llvm upgrades requiring patching ghc to = function on arm. (note, there is no guarantee that patching ghc to = support future llvm will be possible even) Cons: I have to basically support ghc and llvm for it. While I=E2=80=99m not hugely happy with the latter option, it is the = most reasonable given the constraints of 3 competing release schedules = and the reality of llvm ir not being forward or backward compatible. While I=E2=80=99m not a fan of having to support/maintain a port of = llvm, its the least horrible option of the above three. mitch > On May 16, 2016, at 4:11 AM, Natanael Copa = wrote: >=20 > On Sun, 15 May 2016 22:30:15 -0500 > Mitch Tishmack wrote: >=20 >> --- >> testing/ghc-llvm/APKBUILD | 169 = +++++++++++++++++++++++++++ >> testing/ghc-llvm/llvm-0002-musl-triple.patch | 90 ++++++++++++++ >> testing/ghc-llvm/llvm-0003-musl-hacks.patch | 114 ++++++++++++++++++ >> 3 files changed, 373 insertions(+) >> create mode 100755 testing/ghc-llvm/APKBUILD >> create mode 100644 testing/ghc-llvm/llvm-0002-musl-triple.patch >> create mode 100644 testing/ghc-llvm/llvm-0003-musl-hacks.patch >=20 > Why cannot we use the system llvm? >=20 > -nc --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---