From: "Paul E. McKenney" <paulmck@kernel.org>
To: Akira Yokosawa <akiyks@gmail.com>
Cc: Elad Lahav <e2lahav@gmail.com>, perfbook@vger.kernel.org
Subject: Re: [PATCH v2 -perfbook] CodeSamples: Add -fcommon to GCC_ARGS
Date: Wed, 16 Nov 2022 08:29:03 -0800 [thread overview]
Message-ID: <20221116162903.GO4001@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <b636c9f8-31ad-599e-d75b-d23d2e1fdb4b@gmail.com>
On Tue, Nov 15, 2022 at 06:43:59AM +0900, Akira Yokosawa wrote:
> An item on GCC 10 changes [1] reads:
>
> - GCC now defaults to -fno-common. As a result, global variable
> accesses are more efficient on various targets. In C, global
> variables with multiple tentative definitions now result in
> linker errors. With -fcommon such definitions are silently
> merged during linking.
>
> This change affects builds under CodeSamples/ as reported by Elad [2].
>
> As a band-aide fix, add -fcommon to GCC_ARGS where necessary.
>
> Reported-by: Elad Lahav <e2lahav@gmail.com>
> Link: [1] https://gcc.gnu.org/gcc-10/changes.html
> Link: [2] https://www.spinics.net/lists/perfbook/msg03690.html
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Queued, thank you both!
Thanx, Paul
> ---
> v2:
> - Fix mismatch of From: and S-o-b.
>
> Thanks, Akira
>
> --
> CodeSamples/datastruct/Issaquah/Makefile | 2 ++
> CodeSamples/datastruct/hash/Makefile | 2 ++
> CodeSamples/defer/Makefile | 2 ++
> 3 files changed, 6 insertions(+)
>
> diff --git a/CodeSamples/datastruct/Issaquah/Makefile b/CodeSamples/datastruct/Issaquah/Makefile
> index 51b91fd8dafa..c3b724d750b2 100644
> --- a/CodeSamples/datastruct/Issaquah/Makefile
> +++ b/CodeSamples/datastruct/Issaquah/Makefile
> @@ -32,6 +32,8 @@ endif
>
> include $(top)/recipes.mk
>
> +GCC_ARGS += -fcommon
> +
> # NOTE: For decent scalability on update-side tests as of early 2015,
> # use something like jemalloc() instead of glibc malloc().
> # If you install jemalloc at /home/paulmck/jemalloc, you will
> diff --git a/CodeSamples/datastruct/hash/Makefile b/CodeSamples/datastruct/hash/Makefile
> index 80568cd11981..a56255a272eb 100644
> --- a/CodeSamples/datastruct/hash/Makefile
> +++ b/CodeSamples/datastruct/hash/Makefile
> @@ -32,6 +32,8 @@ endif
>
> include $(top)/recipes.mk
>
> +GCC_ARGS += -fcommon
> +
> hash_bkt: hash_bkt.c ../../api.h hashtorture.h
> cc $(GCC_ARGS) -DTEST_HASH -o hash_bkt hash_bkt.c $(LIB)/random.c -lpthread
>
> diff --git a/CodeSamples/defer/Makefile b/CodeSamples/defer/Makefile
> index 46cb87a1c9dc..3cf3e5a5f134 100644
> --- a/CodeSamples/defer/Makefile
> +++ b/CodeSamples/defer/Makefile
> @@ -61,6 +61,8 @@ endif
>
> include $(top)/recipes.mk
>
> +GCC_ARGS += -fcommon
> +
> # Note that bug_srcu_a is disabled until completed.
> bug_srcu_a: bug_srcu_a.c srcu.c ../api.h
> cc $(GCC_ARGS) -o bug_srcu_a -DTEST bug_srcu_a.c -lurcu -lpthread
>
> base-commit: 7f7a2c25e3d2e87412d10bdb355b369eca524b1a
> --
> 2.25.1
>
>
prev parent reply other threads:[~2022-11-16 16:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 11:31 [PATCH -perfbook] CodeSamples: Add -fcommon to GCC_ARGS Akira Yokosawa
2022-11-14 21:43 ` [PATCH v2 " Akira Yokosawa
2022-11-16 16:29 ` Paul E. McKenney [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=20221116162903.GO4001@paulmck-ThinkPad-P17-Gen-1 \
--to=paulmck@kernel.org \
--cc=akiyks@gmail.com \
--cc=e2lahav@gmail.com \
--cc=perfbook@vger.kernel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).