Received: from mail-yw1-f42.google.com (mail-yw1-f42.google.com [209.85.161.42]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id AE1E8781D3A for <~alpine/devel@lists.alpinelinux.org>; Sat, 30 Nov 2019 01:46:14 +0000 (UTC) Received: by mail-yw1-f42.google.com with SMTP id h126so1804392ywc.6 for <~alpine/devel@lists.alpinelinux.org>; Fri, 29 Nov 2019 17:46:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=L+Jw1lpTDD64Zh9iiQSW7kn7naLd5G//2u70brT3uB8=; b=Qdm5OvSP7KxjxK9j4K8VIQE1mRooKBTnjME7l6CB2L1Dd5uwLNls6y80MsYugZa9W5 BazLmoihJB9ZqmInppjcxm1Fg8z31mvLmub+g5BZ4LsCoiwxsdoZC9HcZ4uQiQ1BEYUw q+SOAW4jhSxzEVJSLc8RhpW4ubXZB3OoAyWCz0XfBaRf5FkEmMVGod8uc7dRZXnoMfqN spc7pc3QwOel1y81ooAwtW49GmTb9kb9GcWH64pldG1Jhxb3JyDwSMx7UnpbyZsI7TeC SqJiSw2NeilGXHNM2ia+C6E5gDWZRWYAOsBW6o19VQd8bU20iuFvmgrolG1YT2KAFPr6 iv1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=L+Jw1lpTDD64Zh9iiQSW7kn7naLd5G//2u70brT3uB8=; b=hcqmDnDVJ7jdPJhAtW/KLoxioLb83GxGz0CuFJEJSMK6V5x45YIlncgZ/PFX2GwA9W tu37EJ+oQxiXguRCCh9zMH1OR/mExvuPNUWY6SmPNOGL1BJJDx1q1qISo6kRqlP2F4WA liQD3QgJ2q7xctdZj5Fu4sLkEnA32ghrE/nfde+fw013Sg+G/4oWY9hdVD3cMUYBJWXG Ya+UiwDk9SDPTgo6JfZ7KKcKIubx3TGOlHE8To0dQkmchmR7ndtudS3MmWkLD40alJTZ fWyN0eBsiH/GmSn5X2nJ+uOx0HaH4LEIWi7OUAbBEUkoipihFH6JMyUNcBTgAMu97TT5 9yOg== X-Gm-Message-State: APjAAAV4LZlwZuHdNiEvx4VLkiAbD9A/V5JgLC2BvqY6bxs8gCvrwjqE FSzbrD91xPgf/tZlLoabaK1JAAlnMLEAbNA+4nvEHA== X-Google-Smtp-Source: APXvYqyhSH09FIFRG2SmSxr3Dn6+FRfFgzbhAdUVStxO2myIoFsQJk8rwNtUjfc/ISAAVWX/lTdL0vIJEJVO8jG7rqg= X-Received: by 2002:a0d:e5c3:: with SMTP id o186mr14439534ywe.123.1575078373238; Fri, 29 Nov 2019 17:46:13 -0800 (PST) MIME-Version: 1.0 References: <20191129221308.hy6ybayxu2nsu5dy@wolfsden.cz> In-Reply-To: <20191129221308.hy6ybayxu2nsu5dy@wolfsden.cz> From: Konstantin Kulikov Date: Sat, 30 Nov 2019 04:46:02 +0300 Message-ID: Subject: Re: community/go and buildmode pie To: Wolf Cc: ~alpine/devel@lists.alpinelinux.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable This warning is harmless https://github.com/golang/go/issues/31544. Will probably be fixed with linker updates in go1.15. If you don't want to build pie binary use -buildmode=3Dexe. On Sat, Nov 30, 2019 at 1:13 AM Wolf wrote: > > Hello, > when trying to complie something using the community/go package I'm > always getting this warning: > > # foo > loadinternal: cannot find runtime/cgo > > go package in community uses buildmode pie by default due to this patch: > > https://gitlab.alpinelinux.org/alpine/aports/blob/master/community/go/def= ault-buildmode-pie.patch > > When looking into why I traced it down to > > https://gitlab.alpinelinux.org/alpine/aports/commit/9515100a5f4a9ad7b6b1d= 44a5fb9a7b1a6083aa7 > > which sadly has no explanation *why* this was commited. Due to this > patch there is warning while compiling any go source without any flags. > Example project: > > /tmp/repro # tree . > . > =E2=94=9C=E2=94=80=E2=94=80 go.mod > =E2=94=94=E2=94=80=E2=94=80 test.go > > 0 directories, 2 files > /tmp/repro # cat go.mod > module foo > > go 1.12 > /tmp/repro # cat test.go > package main > > func main() { > } > > when one starts clean alpine container and tries to compile it > > + $ docker run --rm --init -it --mount type=3Dbind,src=3D/tmp/r= epro,dst=3D/tmp/repro alpine > Unable to find image 'alpine:latest' locally > latest: Pulling from library/alpine > 89d9c30c1d48: Pull complete > Digest: sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8= 121ce95cf2bd5a > Status: Downloaded newer image for alpine:latest > / # apk update > fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKI= NDEX.tar.gz > fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64= /APKINDEX.tar.gz > v3.10.3-66-g967440f6a7 [http://dl-cdn.alpinelinux.org/alpine/v3.1= 0/main] > v3.10.3-64-g77cd149615 [http://dl-cdn.alpinelinux.org/alpine/v3.1= 0/community] > OK: 10341 distinct packages available > / # apk add go musl-dev > (1/12) Installing binutils (2.32-r0) > (2/12) Installing gmp (6.1.2-r1) > (3/12) Installing isl (0.18-r0) > (4/12) Installing libgomp (8.3.0-r0) > (5/12) Installing libatomic (8.3.0-r0) > (6/12) Installing libgcc (8.3.0-r0) > (7/12) Installing mpfr3 (3.1.5-r1) > (8/12) Installing mpc1 (1.1.0-r0) > (9/12) Installing libstdc++ (8.3.0-r0) > (10/12) Installing gcc (8.3.0-r0) > (11/12) Installing go (1.12.12-r0) > (12/12) Installing musl-dev (1.1.22-r3) > Executing busybox-1.30.1-r2.trigger > OK: 391 MiB in 26 packages > / # cd /tmp/repro > /tmp/repro # go build ./... > # foo > loadinternal: cannot find runtime/cgo > > Those last two lines are the issue. > > I guess my question is how to proceed. Should I just post patch dropping > the default pie to aports mailing list? Or is this something that you > want to keep? If so, how to proceed about the warning? > > Thanks for your time, > W. > > -- > There are only two hard things in Computer Science: > cache invalidation, naming things and off-by-one errors.