Re: [PATCH] tst_libext2fs: Avoid multiple definition of global variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

This looks fine to me.

Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>

Is there any need to fix the one in lib/ext2fs/extent.c ?  It's only there
under #ifdef DEBUG though.

Thanks,
-Eric



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux