Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 28348782BBC for <~alpine/users@lists.alpinelinux.org>; Mon, 30 Mar 2020 09:43:39 +0000 (UTC) Received: by mail-lf1-f49.google.com with SMTP id z23so13589122lfh.8 for <~alpine/users@lists.alpinelinux.org>; Mon, 30 Mar 2020 02:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=YZSn8ubISg8ZSO8UsBodP3WM2Fyj4JiNRNaD8gsWDn0=; b=q0YT3/E4M8P+VcgZlsQRgQ9LgxnjS4b3BxTqc6hf7UExIPd0vx/4xkPFobWvfzZjfq Uz1XuXWWJW4a1sicK0IOl7xTX3EcCsIBmRcq466/dyRXwYhDlWiuipxMfCisTti8i5/s XqJGJXmjnqwMA61sevLZAWSsbBwlR7qy3nABoxxluAYg4NkWrVUvozOQjJr/YuKXi7Un h5jCm75sqAYk7gak/DA2I5fTDUiQuhDYgdxLxhmMWKDlKovj6ZHUjrBgLlSIOEghm+yR 3xm0pQ5eXDtSmfaYY2R1J/tR+l36AB9oTMaZ7QT6K2BLTnYI/IB8QmTdwgbyucZdkxmt pFfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YZSn8ubISg8ZSO8UsBodP3WM2Fyj4JiNRNaD8gsWDn0=; b=dEMQ+Ov9uY58utP8CKOg8/RNv0fMbgq9OHNq8fv4G8R9YnjsF9FSDEpP3/0YU5Qp6J GBKfmR8gNIc/nvAgVf1CirAR4RaWIanVVCRd9esqPGIMk/SRsDyjAxUq2NUSQE0WFtEE ebmaSB0u4cAiT0Yhp16pOqQjitz/0ilyZQNiIvfycJIXXCwfYZxAP0zfs1wahxJJ/Yxz /BUbLgAFefDAGw8vAt4iy7l4N7yf+rOTjF/jMvtnE22VoIgB89xQLaLFj4C0srfYG/cA c0QcBGcZLWj+kCrstSFAIE6jCee4gz7ViOme6p3pcVujyB9iwD6/M29LqYBGnTO22cKR ysqw== X-Gm-Message-State: AGi0PuZR1P0O9J9Z3pg24UFCQR8JAZBavq2DQvO+iVPzqIlyQBn20lwB Yz067vTE51EQibtW/a4nyI6NfGi0 X-Google-Smtp-Source: APiQypLtOGFwQaHFIzJpu2PkTTPFBSyECziIFW0DwIhjUdbdq7teu+ye2upfI2za5AtOG99tIy5Hng== X-Received: by 2002:a19:be11:: with SMTP id o17mr7508779lff.168.1585561417331; Mon, 30 Mar 2020 02:43:37 -0700 (PDT) Received: from kpc.kaey.ru ([91.123.18.165]) by smtp.gmail.com with ESMTPSA id 203sm6574465ljf.65.2020.03.30.02.43.36 for <~alpine/users@lists.alpinelinux.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 02:43:36 -0700 (PDT) Date: Mon, 30 Mar 2020 12:43:36 +0300 From: gmail To: ~alpine/users@lists.alpinelinux.org Subject: Re: tini-static dynamically linked Message-Id: <20200330124336.e6a23e33bc9f0601292446c6@gmail.com> In-Reply-To: <20200329134313.avejs4adn2r7eh35@wolfsden.cz> References: <20200327161918.4aedc0ca@ncopa-desktop.copa.dup.pw> <20200329134313.avejs4adn2r7eh35@wolfsden.cz> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > but at the same time, since it "links" against the ld-musl > > /a # gcc -static -pie -o test test.c > /a # ldd test > /lib/ld-musl-x86_64.so.1 (0x7f63e4bc1000) > > such binary is not portable to non-musl systems correct? And if I want > to achieve that, I need to compile with -no-pie flag? > > Is my understanding correct? /lib/ld-musl-x86_64.so.1 is an executable, programs do not link against it. I was able to compile go binary on glibc system and run on musl in the past, using "-ldflags=-I /path/to/ld.so" I have no idea how binutils linker works though. There is also --static-pie flag in gcc, I think it bundles dynamic linker in your binary, but I'm not sure exactly.