From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/18157 Path: news.gmane.org!.POSTED!not-for-mail From: John MACFARLANE Newsgroups: gmane.text.pandoc Subject: help wanted producing a statically linked executable Date: Thu, 7 Sep 2017 17:28:25 -0700 Message-ID: <20170908002825.GA15447@protagoras.berkeley.edu> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed X-Trace: blaine.gmane.org 1504830536 27625 195.159.176.226 (8 Sep 2017 00:28:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 8 Sep 2017 00:28:56 +0000 (UTC) User-Agent: Mutt/1.5.24 (2015-08-30) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBNWIY7GQKGQE23ODR4Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Sep 08 02:28:41 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-it0-f64.google.com ([209.85.214.64]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dq79r-00065I-Ty for gtp-pandoc-discuss@m.gmane.org; Fri, 08 Sep 2017 02:28:32 +0200 Original-Received: by mail-it0-f64.google.com with SMTP id r15sf891599itb.8 for ; Thu, 07 Sep 2017 17:28:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1504830519; cv=pass; d=google.com; s=arc-20160816; b=ribPLAW0IVWW5tWUK0aAheoXuoa7OSGiPJ5u4gC6J3y8hB3EtTN2GnrwQqprMph+7P DbE5rwWFFp1AMcivFVA6pXzODv1mPMXRuX50VPp8MX+xbdnbHCzY3BKKyBziwW0g53Fx fannhW2AMLEL7S9VuFxM4PH17CDJYs4wcvP72VKx5tU12je0W1SzLycNsnvqxQ/8qbFL ongjNVJ6lq67ub5Lp6OtgrvCmvQtOn8gJSAaenhZOZazTgTOhhJO+tkkjpMPB/44fC7p S+IvbIcaWyFci1522NJDVxDeq6TqZ7AKDVuHI7F1f2L1dEZlj3TWe9kO240h4IlLdiW5 AKGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:user-agent :content-disposition:mime-version:message-id:subject:to:date:from :arc-authentication-results:arc-message-signature:sender :dkim-signature:arc-authentication-results; bh=UaE8hlkACpEXQBL7bGLegCKChfFjj4JzXRk96OCdcSU=; b=shGsxQZwWknO9It/1I62wXNBYj+toHrDjCu391KwGNeqFMDRNN4EMIC/DWFLEbeXRV SVKVRSLKO9ecpRNra2O0R8bldbsG521aDo1jwU6NyVC70/5KqzTTEmJEp2kOZSBrFHnE 8cK1VefInSg41ZSw6cLkJPFl+lNKshTPvhp4ELuhfq0U/vAtmNueWpCfGckOBZS+7pqg caLfHuHZqWYjTNhgAGu3zH1lumJEbT30Gg4P7CFmaMkraB5gFRyBs9Y+db7Mw/0aaDxq Dp5m+LYBBQdnuYrFr/Xo07zygcFnNyd883qeCfACPLsbzBMADE2OnoX1OI6lEc84+cyq Q8lw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=HjkWxov0; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c05::229 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:date:to:subject:message-id:mime-version :content-disposition:user-agent:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=UaE8hlkACpEXQBL7bGLegCKChfFjj4JzXRk96OCdcSU=; b=MbIrK2LrVdqxqkiKaHklk1qfgQSNExHvLwzuAumcCteBeoka8KnbiH9K1Vq7aCrrV3 2SfcXOGlByzW3R6LRWtIblX+D0/JXYehtjnaIdXWctbWdnEfTTOsY9s/7cKd00F+1uqA hc+ls8ib7mB225/Vd3ITp2VUQeRDaOPu9BOKZIZBB5e0Zd5L4h/Lk4fvApLeWEXfcQCd RkAulSp4rc4AJveVVZ1UmcnW5ECD/c3Pcv7Vp4HSYKoEvQIKzE1RhoSzXY8C307YtInd CtMr4dUoyMhHD2b4Epgq+Xz7vcCWz/8CBgw0FUjjqpPeCVbPdW/NvcE/3D6mDpnG4F3+ ApSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:date:to:subject:message-id :mime-version:content-disposition:user-agent:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=UaE8hlkACpEXQBL7bGLegCKChfFjj4JzXRk96OCdcSU=; b=A7aV1n4lg3CA1X/2UCZfT9/g/ITRMmywwPB8mwUGg4kvj6DWfZoZ+fUKJK73t6uvCM zqSN/xY/fOntK3xtyZtGnb90luTe7qz00acjXKSJCsqmLZKc02x6xzzTrvZFvooOHVgF OYv6+9iLFcu8OMrtf7gXzqf/wz2gJ6Vp2gJKdY8KbMrkGhCtgLOh1I/QTSTddyoacw8O HSQHOLgFnuVW1WRWo8ukQf6TdNc3QkwLo/o1U/cEUuq6E208zuDh8Wz5h/3pKvZSwYUz 4NCT3axWlc2YOFrrfxSbVZqOFpPEAOUEsr/Mt5etNpU0l2Hw40nA6riQndGvFHYsCpT1 boTQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AHPjjUj43M6WgVBGQoNjvompFHv2xYTVlXRnjDNIOI9jedFVpAs/LPZt g6Pm7KR64AWeNA== X-Google-Smtp-Source: AOwi7QBvxPHfE0gna/g/6dvvHYYxs1ffWB5A8SCJXY9xVYuB/fJ0BZn4JzYJYzn98KRV5lnPcVIZew== X-Received: by 10.36.43.210 with SMTP id h201mr34023ita.5.1504830518980; Thu, 07 Sep 2017 17:28:38 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.107.59.79 with SMTP id i76ls2317866ioa.47.gmail; Thu, 07 Sep 2017 17:28:38 -0700 (PDT) X-Received: by 10.36.90.199 with SMTP id v190mr470754ita.12.1504830518208; Thu, 07 Sep 2017 17:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504830518; cv=none; d=google.com; s=arc-20160816; b=vNGtqh5lesu7W9oxuqcLTyQSblNyILoQVIzAwhfAJv5kLxcfrTj163fM2YX6G5+EL4 uPCk/cJRwIdZIm8HCemuZ3B1lnrc/DOSb8SYUUpiAbKqTc5VBklZV+U4x6fhAT7FXKfq TEn7MK+MsRiF/lsItbBjCJHJbZNpdD+CU1XjlNIqNxsgqGxTwY0oJAexADlVkNghCRTz kmjyJ0KFh83JMD7WbheZFPfyP5kJgW9YNrVAw2whNr0eHK4oe517aWA9LxwqY2g3TiLJ StQYXfb74YebZReRzLaoK9xcGt9zjcOQw89XtrrJy9gepSbFGjMs0QwRpl3HxU44B3N4 Sfbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:content-disposition:mime-version:message-id:subject:to :date:from:dkim-signature:arc-authentication-results; bh=lDc+u0SXnP34d+T/XD+ZXhrRYWJyKj2OqKnyOLMN9xI=; b=vZE65ywLJgNFISdDBDYQQKlSgbsQwLBBS0PVLRjtLO5xTgLi7f/QDJZnYuASOPipbZ K5RU8+1eWUlWrTP//bV2xs3EuwHqNcvdGG9PGB50WDGy4sHmeQujy76v1zvj9/PHRcf5 kMZCaQmczgy4OWFmNIWAidLmYAt3neXxDNinFOEO/5zTUhIwV5LeW88ijxziqTRcaTwN lWjcqGak4Nv0pulGfdOeHM/sADCZ8e6ZNkpjPY/TUOdEdEUhnYcSwDxwXcolRpuR2NfK SgJmlyTrSH5246vkLUQBhnDRD6JH4/kl5THhgqOr8BFBOKCrxtpF8IM6ZIyXPd16LSlo 8QtQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=HjkWxov0; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c05::229 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pg0-x229.google.com (mail-pg0-x229.google.com. [2607:f8b0:400e:c05::229]) by gmr-mx.google.com with ESMTPS id u19si107449pfl.4.2017.09.07.17.28.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Sep 2017 17:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c05::229 as permitted sender) client-ip=2607:f8b0:400e:c05::229; Original-Received: by mail-pg0-x229.google.com with SMTP id m9so2166260pgd.3 for ; Thu, 07 Sep 2017 17:28:38 -0700 (PDT) X-Received: by 10.98.80.139 with SMTP id g11mr1185975pfj.279.1504830517574; Thu, 07 Sep 2017 17:28:37 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id w134sm913292pfd.186.2017.09.07.17.28.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2017 17:28:36 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id B62C9A1C5; Thu, 7 Sep 2017 20:28:25 -0400 (EDT) Content-Disposition: inline X-PGP-Key: http://johnmacfarlane.net/jgm.asc X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=HjkWxov0; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c05::229 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:18157 Archived-At: I had a build process in place to produce a fully static linux executable, but it no longer works. And I'm a bit baffled at what I'm seeing, so I'm hoping someone can help. Easiest way to reproduce is with Docker. Dockerfile: ``` FROM alpine:edge RUN apk update RUN apk add alpine-sdk git ca-certificates ghc cabal zlib-dev \ dpkg fakeroot sed gawk grep bash linux-headers RUN cabal update RUN mkdir -p /usr/src/ WORKDIR /usr/src/ RUN git clone https://github.com/jgm/pandoc WORKDIR /usr/src/pandoc ``` Now, get an interactive session in the docker image: docker run -it alpine-pandoc:latest /bin/bash You'll find yourself in /usr/src/pandoc. Let's try a static build: cabal new-build --disable-executable-dynamic \ --ghc-options='-optl=-static -optl=-pthread -fPIC' \ -fembed_data_files When that's done, we can see what we have: bash-4.3# ldd dist-newstyle/build/pandoc-2.0/build/pandoc/pandoc /lib/ld64.so.1 (0x7ff84a618000) Not a static executable. When I transfer it outside the container and examine it with OSX's 'file', I see: artifacts/pandoc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), stripped When I try to run it, I get: bash-4.3# dist-newstyle/build/pandoc-2.0/build/pandoc/pandoc --version bash: dist-newstyle/build/pandoc-2.0/build/pandoc/pandoc: No such file or directory because /lib/ld64.so.1 doesn't exist. Does anyone know why I'm not getting a fully statically linked executable?