X-Original-To: alpine-devel@mail.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 288EADC0687 for ; Thu, 18 Jun 2015 04:41:41 +0000 (UTC) Received: from mail-ig0-f175.google.com (mail-ig0-f175.google.com [209.85.213.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id F0B43DC00F8 for ; Thu, 18 Jun 2015 04:41:35 +0000 (UTC) Received: by igbzc4 with SMTP id zc4so118900860igb.0 for ; Wed, 17 Jun 2015 21:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=y2GoaDYECc/5HaXGNR9MHG9vVlljj71XTAOlKYvk0DE=; b=q2oB8nfXCq7fr6DOTazVA07g8lvjjnTvxrb8wwkVD/G8EQ+rWST6wIzJiVjbSCytCW xbX5qoBDByUHcyXAyr3KCJoy9WTplIVpEKabfYeTw4D20aijzomI19jcZzcD2Q2ZjpoM 9s66AJz2GmH4sDeCNMukRGXCzomyLWwGMDdDVRPWuG6Ha3Y9Jh4EVzp3c77ZzsPtsAL4 69HKrgI5hwL1OxQGgaawgGNdKMulF1XCj+5llvONODX9/7q7kVzehkZSQUz2b4IjpF4F 09HlzJ0Zl8pyIOgqRifDFrpHpkp+wSy65VRPgzaHR+2DgvBxKOAskhppSvaKPDSBvnwW 4roQ== X-Received: by 10.107.137.228 with SMTP id t97mr160572ioi.16.1434602495104; Wed, 17 Jun 2015 21:41:35 -0700 (PDT) Received: from ?IPv6:2601:448:8200:41e7:b470:2c1e:b786:5059? ([2601:448:8200:41e7:b470:2c1e:b786:5059]) by mx.google.com with ESMTPSA id y124sm4143933iod.13.2015.06.17.21.41.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Jun 2015 21:41:34 -0700 (PDT) From: Mitch Tishmack Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: [alpine-devel] Questions regarding a ghc port to alpine linux Message-Id: Date: Wed, 17 Jun 2015 23:41:33 -0500 To: alpine-devel@lists.alpinelinux.org X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) X-Mailer: Apple Mail (2.2098) X-Virus-Scanned: ClamAV using ClamSMTP Hi, Recently a reddit haskell user cross compiled ghc in gentoo linux using = musl libc, which convinced me to get a port of ghc functional for alpine = linux. I did a quick query on irc and was directed to this mailing list = to ask my questions and get a better review on the process. My preliminary port is here under bootstrap and alpine directories. https://github.com/mitchty/alpine-linux-ghc-bootstrap Note, ghc itself needs to self host to build its own source. So this is = a little more difficult to do than it normally might need be. The = bootstrap directory contains the docker file used to generate the ghc = cross compiler for use with the alpine docker image to generate a native = compiler from within alpine linux. The alpine directory right now only contains a docker file that can get = you to generating an apk that one could use to build another apk that = depends on ghc itself. Note, ghc requires itself to build itself from = source. So I=E2=80=99m not entirely sure how one submits an APKBUILD in = this circumstance, the wiki is mostly focused on non self hosting = binaries. This produces a functional, for some definition of the term, ghc = compiler though I will admit I=E2=80=99m not 100% satisfied with how it = is currently built. But it seems to function for the moment and could = use more testing outside of my own use and abuse as well as use a bit = better review of how I went about it to fix any glaring or obvious = errors in approach. Just to address a few things quick from a quick initial review from irc: - I=E2=80=99m not a huge fan of disabling position independent code to = build ghc, but I cannot get ghc to build reliably without it on alpine = linux. It builds fine on non hardened gentoo linux which leads me to = think its some side effect of PaX or grsecurity. I can build *really* = simple programs without disabling PIE code by disabling pax via paxctl = -cm /path/to/ghc/binary. But that apparently is the wrong tool to use so = input here is appreciated. A note, if one does not force code compiled = to have -nopie, the following happens: = https://gist.github.com/mitchty/29125de21ade1a04364f=20 - I used docker for this port mostly due to wanting to try it out and it = was nice not to have to wait 3 hours for ghc to compile its first stages = with caching, I=E2=80=99m not wedded to the tool its more a convenience = really since compile times for things can be rather long even on a fast = system. - I=E2=80=99ve talked a bit with the ghc developers regarding the -nopie = component and either this is something new that ghc itself needs to = detect in how linking on musl libc works, or I=E2=80=99m compiling this = wrong in some fashion, or my understanding of how alpine is hardened is = wrong. My knowledge of the grsecurity patches and PaX in general is low = so I=E2=80=99m fully willing to accept that I did this preliminary port = wrong or don=E2=80=99t understand huge portions of how alpine linux is = built. I=E2=80=99ve mostly been a user really. Any help or guidance on what I messed up or did wrong would be helpful. = I=E2=80=99m just looking to get a working port of ghc onto alpine linux = so input appreciated. Apologies for the giant wall of text as well, thank you all for your = time! cheers, mitch= --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---