From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Willy Tarreau <w@1wt.eu>
Cc: Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/nolibc: only run constructor tests on nolibc
Date: Sun, 2 Mar 2025 22:56:01 +0100 [thread overview]
Message-ID: <8dde4be5-0b37-4e45-bea3-8cdadeb23e7a@t-8ch.de> (raw)
In-Reply-To: <20250301110735.GA18621@1wt.eu>
Hi Willy!
On 2025-03-01 12:07:35+0100, Willy Tarreau wrote:
> [..]
> OK so I've tested the patch below which does what we want, except that
> it reveals that the order is still not granted. Actually I haven't found
> what dictates it. On one machine (gcc-9.5, ld-2.26) I'm getting:
>
> $ ./nolibc-test|grep cst
> 17 linkage_cst = 0 [FAIL]
> 18 linkage_cst_ord = 0 [FAIL]
Apparently no constructors are executed at all.
Can you show the default linkerscript used?
gcc -static -o /dev/null /dev/null -Wl,--verbose
> On this same machine, using another toolchain relying on ld-2.27 gives me
> this:
>
> $ ./nolibc-test|grep cst
> 17 linkage_cst = 1 [OK]
> 18 linkage_cst_ord = 33 [FAIL]
>
> And I'm getting this as well on another machine with various toolchains
> such as gcc-9.5+ld-2.34. The nolibc toolchains fail similarly on gcc-5.5
> (ld-2.27) and gcc-6.5 (ld-2.32), but work for gcc-7.5 with ld-2.32, while
> other combinations do work:
>
> $ ./nolibc-test|grep -i cst
> 17 linkage_cst = 1 [OK]
> 18 linkage_cst_ord = 18 [OK]
>
> All of this is a bit confusing.
>
> I continue not to understand what could guarantee an implicit execution
> order since for me it solely depends on how things are linked, so the
> purpose of the test remains uncertain to me and I think we'd rather not
> try to enforce any ordering that might work only by pure luck.
I don't think anything guarantees the order.
It is just what happened to work in my tests so far.
> What do you think ?
Let's get rid of the validation.
Thomas
prev parent reply other threads:[~2025-03-02 22:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 18:01 [PATCH] selftests/nolibc: only run constructor tests on nolibc Thomas Weißschuh
2025-02-16 9:39 ` Willy Tarreau
2025-02-17 21:24 ` Thomas Weißschuh
2025-02-22 9:38 ` Willy Tarreau
2025-02-25 9:37 ` Thomas Weißschuh
2025-03-01 11:07 ` Willy Tarreau
2025-03-02 21:56 ` Thomas Weißschuh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8dde4be5-0b37-4e45-bea3-8cdadeb23e7a@t-8ch.de \
--to=linux@weissschuh.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=w@1wt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox