Linux Perf Users
 help / color / mirror / Atom feed
From: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: "peterz@infradead.org" <peterz@infradead.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"namhyung@kernel.org" <namhyung@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"alexander.shishkin@linux.intel.com"
	<alexander.shishkin@linux.intel.com>,
	"jolsa@kernel.org" <jolsa@kernel.org>,
	"irogers@google.com" <irogers@google.com>,
	"adrian.hunter@intel.com" <adrian.hunter@intel.com>,
	"kan.liang@linux.intel.com" <kan.liang@linux.intel.com>,
	"james.clark@linaro.org" <james.clark@linaro.org>,
	"linux-perf-users@vger.kernel.org"
	<linux-perf-users@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf test: Use -Wp,-U_FORTIFY_SOURCE for tests built with -O0
Date: Tue, 27 Aug 2024 02:45:46 +0000	[thread overview]
Message-ID: <CB550CF8-B45D-44D8-BDFC-3633DD99AFB0@nutanix.com> (raw)
In-Reply-To: <ZsyUVWXtzBmm-U_q@x1>



> On Aug 26, 2024, at 23:42, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> On Mon, Aug 26, 2024 at 03:04:12AM +0000, Eiichi Tsukata wrote:
>> Ping
> 
> Tried, didn't work, can you please check on the tmp.perf-tools-next?
> 

It failed because "perf-test-y += landlock.o” line was added recently.
I’ll rebase the patch on tmp.perf-tools-next in v2.

Thanks
Eiichi


> ⬢[acme@toolbox perf-tools-next]$ b4 am -ctsl --cc-trailers 20240806061749.143072-1-eiichi.tsukata@nutanix.com
> Grabbing thread from lore.kernel.org/all/20240806061749.143072-1-eiichi.tsukata@nutanix.com/t.mbox.gz
> Analyzing 3 messages in the thread
> Looking for additional code-review trailers on lore.kernel.org
> Checking attestation on all messages, may take a moment...
> ---
>  ✓ [PATCH] perf test: Use -Wp,-U_FORTIFY_SOURCE for tests built with -O0
>    + Link: https://urldefense.proofpoint.com/v2/url?u=https-3A__lore.kernel.org_r_20240806061749.143072-2D1-2Deiichi.tsukata-40nutanix.com&d=DwIDaQ&c=s883GpUCOChKOHiocYtGcg&r=dy01Dr4Ly8mhvnUdx1pZhhT1bkq4h9z5aVWu3paoZtk&m=_0OObZsmx6FjjueHZafPjJj8gKzbBsFc_De-z9V-NlDqBdP2JXkVHey4ZnvbC5et&s=Rw2ve-4V8ySCyy7B99P6fc1biLAeFkcjpcB2SjTAAc8&e= 
>    + Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>  ---
>  ✓ Signed: DKIM/nutanix.com
> ---
> Total patches: 1
> ---
> Link: https://urldefense.proofpoint.com/v2/url?u=https-3A__lore.kernel.org_r_20240806061749.143072-2D1-2Deiichi.tsukata-40nutanix.com&d=DwIDaQ&c=s883GpUCOChKOHiocYtGcg&r=dy01Dr4Ly8mhvnUdx1pZhhT1bkq4h9z5aVWu3paoZtk&m=_0OObZsmx6FjjueHZafPjJj8gKzbBsFc_De-z9V-NlDqBdP2JXkVHey4ZnvbC5et&s=Rw2ve-4V8ySCyy7B99P6fc1biLAeFkcjpcB2SjTAAc8&e= 
> Base: not specified
>       git am ./20240806_eiichi_tsukata_perf_test_use_wp_u_fortify_source_for_tests_built_with_o0.mbx
> ⬢[acme@toolbox perf-tools-next]$        git am ./20240806_eiichi_tsukata_perf_test_use_wp_u_fortify_source_for_tests_built_with_o0.mbx
> Applying: perf test: Use -Wp,-U_FORTIFY_SOURCE for tests built with -O0
> error: patch failed: tools/perf/tests/workloads/Build:7
> error: tools/perf/tests/workloads/Build: patch does not apply
> Patch failed at 0001 perf test: Use -Wp,-U_FORTIFY_SOURCE for tests built with -O0
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> hint: When you have resolved this problem, run "git am --continue".
> hint: If you prefer to skip this patch, run "git am --skip" instead.
> hint: To restore the original branch and stop patching, run "git am --abort".
> hint: Disable this message with "git config advice.mergeConflict false"
> ⬢[acme@toolbox perf-tools-next]$ git am --abort
> ⬢[acme@toolbox perf-tools-next]$
> 
>>> On Aug 6, 2024, at 15:27, Eiichi Tsukata <eiichi.tsukata@nutanix.com> wrote:
>>> 
>>> Hi,
>>> 
>>> FYI: Fedora uses “RPM_OPT_FLAGS”  as “EXTRA_CFLAGS” to build perf.
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__src.fedoraproject.org_rpms_kernel_blob_rawhide_f_kernel.spec-23-5F2908&d=DwIDaQ&c=s883GpUCOChKOHiocYtGcg&r=dy01Dr4Ly8mhvnUdx1pZhhT1bkq4h9z5aVWu3paoZtk&m=_0OObZsmx6FjjueHZafPjJj8gKzbBsFc_De-z9V-NlDqBdP2JXkVHey4ZnvbC5et&s=9EKEgobk4lamLGzFX9G0hfSjJmqvmU1cOeoJUGVXn_g&e= 
>>> 
>>> And on Fedora40,  it has “-Wp,-D_FORTIFY_SOURCE=3”.
>>> 
>>> [eiichi@t495 ~]$ rpm --showrc | grep RPM_OPT | head -n 1
>>> RPM_OPT_FLAGS="%{optflags}"
>>> [eiichi@t495 ~]$ rpm --eval '%{optflags}'
>>> -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mon-omit-leaf-frame-pointer
>>> 
>>> Best,
>>> Eiichi
>>> 
>>>> On Aug 6, 2024, at 15:17, Eiichi Tsukata <eiichi.tsukata@nutanix.com> wrote:
>>>> 
>>>> If EXTRA_CFLAGS has "-Wp,-D_FORTIFY_SOURCE=2", the build fails with:
>>>> 
>>>> error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
>>>> 
>>>> Use "-Wp,-U_FORTIFY_SOURCE" instead of "-U_FORTIFY_SOURCE" for tests
>>>> built with -O0.
>>>> 
>>>> Signed-off-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
>>>> ---
>>>> tools/perf/tests/workloads/Build | 8 ++++----
>>>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>>> 
>>>> diff --git a/tools/perf/tests/workloads/Build b/tools/perf/tests/workloads/Build
>>>> index 48bf0d3b0f3d..ec36c21e375e 100644
>>>> --- a/tools/perf/tests/workloads/Build
>>>> +++ b/tools/perf/tests/workloads/Build
>>>> @@ -7,7 +7,7 @@ perf-test-y += sqrtloop.o
>>>> perf-test-y += brstack.o
>>>> perf-test-y += datasym.o
>>>> 
>>>> -CFLAGS_sqrtloop.o         = -g -O0 -fno-inline -U_FORTIFY_SOURCE
>>>> -CFLAGS_leafloop.o         = -g -O0 -fno-inline -fno-omit-frame-pointer -U_FORTIFY_SOURCE
>>>> -CFLAGS_brstack.o          = -g -O0 -fno-inline -U_FORTIFY_SOURCE
>>>> -CFLAGS_datasym.o          = -g -O0 -fno-inline -U_FORTIFY_SOURCE
>>>> +CFLAGS_sqrtloop.o         = -g -O0 -fno-inline -Wp,-U_FORTIFY_SOURCE
>>>> +CFLAGS_leafloop.o         = -g -O0 -fno-inline -fno-omit-frame-pointer -Wp,-U_FORTIFY_SOURCE
>>>> +CFLAGS_brstack.o          = -g -O0 -fno-inline -Wp,-U_FORTIFY_SOURCE
>>>> +CFLAGS_datasym.o          = -g -O0 -fno-inline -Wp,-U_FORTIFY_SOURCE
>>>> -- 
>>>> 2.45.2
>>>> 
>>> 
>> 


      reply	other threads:[~2024-08-27  2:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-06  6:17 [PATCH] perf test: Use -Wp,-U_FORTIFY_SOURCE for tests built with -O0 Eiichi Tsukata
2024-08-06  6:27 ` Eiichi Tsukata
2024-08-26  3:04   ` Eiichi Tsukata
2024-08-26 14:42     ` Arnaldo Carvalho de Melo
2024-08-27  2:45       ` Eiichi Tsukata [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=CB550CF8-B45D-44D8-BDFC-3633DD99AFB0@nutanix.com \
    --to=eiichi.tsukata@nutanix.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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