From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1801 invoked from network); 22 May 2020 16:50:37 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 22 May 2020 16:50:37 -0000 Received: (qmail 8026 invoked by uid 550); 22 May 2020 16:50:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 8005 invoked from network); 22 May 2020 16:50:31 -0000 Date: Fri, 22 May 2020 18:50:06 +0200 From: Harald Welte To: Rich Felker Cc: musl@lists.openwall.com Message-ID: <20200522165006.GR2993937@nataraja> References: <20200521202253.GC601762@nataraja> <20200521204048.GJ1079@brightrain.aerifal.cx> <20200521211927.GE601762@nataraja> <20200521214948.GL1079@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521214948.GL1079@brightrain.aerifal.cx> Subject: Re: [musl] MUSL ignores__attribute__((constructor(priority))) ? Hi Rich, On Thu, May 21, 2020 at 05:49:48PM -0400, Rich Felker wrote: > > According to the OpenWRT build I have been provided by a 3rd party, it's > > using musl-1-1.23. > > Can you confirm this to make sure we're not debugging an issue that's > long since fixed? Run /lib/ld-musl-armhf.so.1 as a command and it will > print its version. *sigh*. It was 1.1.20. This specific (vendor) OpenWRT tree was broken in that it used the 1.1.20 source code but called the generated packages and path names 1.1.23 :/ After updating the sources to actual 1.1.23, the constructor order is correct and I can run the unmodified libraries + application just like on glibc. Sorry for the noise then. Normally if something is named 1.1.23 you assume it also is 1.1.23 inside... > FWIW the only standards that musl purports to actually adhere to are > C, POSIX, and IEEE 754 (as referenced by C Annex F). While ELF is the > binary format used and we aim to use it in compatible ways so as not > to be gratuitously breaking, there are a lot of details that do not > match historical SysV behavior (this is also true on glibc to a lesser > extent), e.g. historical RPATH vs RUNPATH difference, LD_* vars, etc. Does that explain why trying to LD_PRELOAD libtalloc didn't fix the ordering either? It was one humble attempt at manually overriding the order (on 1.1.20). > I only bring this up because "historical SysV documents say you have > to do things this way" is not *automatically* a compelling argument > for what musl should do, just one ingredient for consideration. I would argue the compelling argument is to ensure applications (of which probably 99% or at least 90% are written and tested with glibc) will work ideally without porting, or without significant porting effort and/or without subtle or not-so-subtle bugs [not claiming you did so, just arguing hypothetically]. But then, this is just the library user perspective of course, and everyone can run their project the way they want. Thanks again. Regards, Harald -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)