[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ce5dc171-5142-d43d-4675-14f045271515@sandeen.net>
Date: Thu, 13 Feb 2020 17:08:53 -0600
From: Eric Sandeen <sandeen@...deen.net>
To: Lukas Czerner <lczerner@...hat.com>, linux-ext4@...r.kernel.org
Cc: tytso@....edu, sandeen@...hat.com
Subject: Re: [PATCH v2] tst_libext2fs: Avoid multiple definition of global
variables
On 2/10/20 9:24 AM, Lukas Czerner wrote:
> gcc version 10 changed the default from -fcommon to -fno-common and as a
> result e2fsprogs make check 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 using SKIP_GLOBDEFS macro to skip the variables
> definition in debugfs.c. Note that debug_prog_name is also defined in
> lib/ext2fs/extent.c when DEBUG macro is used, but this does not work even
> with older gcc versions and is never used regardless so I am not going to
> bother with it.
>
> Signed-off-by: Lukas Czerner <lczerner@...hat.com>
> ---
> v2: Previous fix wasn't really working properly
Lukas explained the problem to me - wow the test binaries are tricky. ;)
Reviewed-by: Eric Sandeen <sandeen@...hat.com>
Powered by blists - more mailing lists