From: Eric Sandeen <sandeen@sandeen.net>
To: Lukas Czerner <lczerner@redhat.com>, linux-ext4@vger.kernel.org
Cc: tytso@mit.edu
Subject: Re: [PATCH] tst_libext2fs: Avoid multiple definition of global variables
Date: Thu, 6 Feb 2020 11:52:17 -0600 [thread overview]
Message-ID: <acd954b1-b92f-8cd7-0ff7-8d38f449df2f@sandeen.net> (raw)
In-Reply-To: <20200130132122.21150-1-lczerner@redhat.com>
On 1/30/20 7:21 AM, Lukas Czerner wrote:
> gcc version 10 changed the default from -fcommon to -fno-common and as a
> result e2fsprogs unit tests fail because tst_libext2fs.c end up with a
> build error.
>
> This is because it defines two global variables debug_prog_name and
> extra_cmds that are already defined in debugfs/debugfs.c. With -fcommon
> linker was able to resolve those into the same object, however with
> -fno-common it's no longer able to do it and we end up with
> multiple definition errors.
>
> Fix the problem by creating an extern declaration of said variables in
> debugfs.h and just setting them in tst_libext2fs.c without additional
> declaration.
>
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
This looks fine to me.
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Is there any need to fix the one in lib/ext2fs/extent.c ? It's only there
under #ifdef DEBUG though.
Thanks,
-Eric
next prev parent reply other threads:[~2020-02-06 17:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-30 13:21 [PATCH] tst_libext2fs: Avoid multiple definition of global variables Lukas Czerner
2020-02-06 17:52 ` Eric Sandeen [this message]
2020-02-06 19:20 ` Lukas Czerner
2020-02-10 15:24 ` [PATCH v2] " Lukas Czerner
2020-02-11 20:22 ` Eric Sandeen
2020-02-11 21:08 ` Eric Sandeen
2020-02-13 23:08 ` Eric Sandeen
2020-02-28 3:34 ` Theodore Y. Ts'o
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=acd954b1-b92f-8cd7-0ff7-8d38f449df2f@sandeen.net \
--to=sandeen@sandeen.net \
--cc=lczerner@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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 NNTP newsgroup(s).