[klibc] [PATCH] Kbuild for klibc and nfsmount: fix multiple definitions

Ben Hutchings ben at decadent.org.uk
Sat Jul 25 14:16:43 PDT 2020

On Thu, 2020-06-18 at 17:05 +0000, Christophe Leroy wrote:
> -fcommon is not default anymore, with GCC 10 you get the following
> failure without it:

I just applied another patch that adds -fcommon, to make Clang happy,
and that should also work for gcc.

However, I'd be happy to apply this with a couple of changes:

> diff --git a/usr/kinit/kinit.c b/usr/kinit/kinit.c
> index 28d29534896f..e2a2439c53ac 100644
> --- a/usr/kinit/kinit.c
> +++ b/usr/kinit/kinit.c
> @@ -15,7 +15,6 @@
>  #include "run-init.h"
>  #include "resume.h"
> -const char *progname = "kinit";
>  int mnt_procfs;
>  int mnt_sysfs;

No, this is the definition we want to keep.  Delete the other
definition in usr/kinit/nfsmount/main.c.

Please also change the -fcommon option to -fno-common, so that if a
developer re-introductes multiple definitions they'll get a compiler
error immediately, whichever compiler version they are using.


Ben Hutchings
Anthony's Law of Force: Don't force it, get a larger hammer.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.zytor.com/archives/klibc/attachments/20200725/45e593a1/attachment.sig>

More information about the klibc mailing list