Linux-kselftest Archive mirror
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Kees Cook <keescook@chromium.org>
Cc: Shuah Khan <shuah@kernel.org>,
	Eric Biederman <ebiederm@xmission.com>,
	Muhammad Usama Anjum <usama.anjum@collabora.com>,
	Mark Brown <broonie@kernel.org>,
	linux-mm@kvack.org, Valentin Obst <kernel@valentinobst.de>,
	linux-kselftest@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	llvm@lists.linux.dev
Subject: Re: [PATCH] selftests/exec: build with -fPIE instead of -pie, to make clang happy
Date: Mon, 6 May 2024 12:08:41 -0700	[thread overview]
Message-ID: <1ff60e91-ac20-476b-a83e-8f9f2f797eb4@nvidia.com> (raw)
In-Reply-To: <202405061007.F1A46E89@keescook>

On 5/6/24 10:09 AM, Kees Cook wrote:
> On Fri, May 03, 2024 at 07:23:01PM -0700, John Hubbard wrote:
>> clang doesn't deal well with "-pie -static": it warns that -pie is an
>> unused option here. Changing to "-fPIE -static" solves this problem for
>> clang, while keeping the gcc results identical.
>>
>> The problem is visible when building via:
>>
>>      make LLVM=1 -C tools/testing/selftests
>>
>> Again: gcc 13 produces identical binaries for all of these programs,
>> both before and after this commit (using "-pie"), and after (using
>> "-fPIE").
>>
>> Also, the runtime results are the same for both clang and gcc builds.
> 
> Thanks for this! It got solved differently here:
> https://lkml.kernel.org/r/20240416152831.3199999-1-usama.anjum@collabora.com
> 
> Does that work for you as well?
> 

Yes it does. Please drop my patch and let's use yours instead, thanks!

(As an aside, outside of the compiler sources themselves, it has
proven quite difficult to find any in-depth documentation of linking
options and behavior--now, and in the past.)

thanks,
-- 
John Hubbard
NVIDIA


      reply	other threads:[~2024-05-06 19:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-04  2:23 [PATCH] selftests/exec: build with -fPIE instead of -pie, to make clang happy John Hubbard
2024-05-06 17:09 ` Kees Cook
2024-05-06 19:08   ` John Hubbard [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=1ff60e91-ac20-476b-a83e-8f9f2f797eb4@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=keescook@chromium.org \
    --cc=kernel@valentinobst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=shuah@kernel.org \
    --cc=usama.anjum@collabora.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).