[klibc] [PATCH v2 4/5] Kbuild: Add "-fcommon" for clang builds
Ben Hutchings
ben at decadent.org.uk
Sat Mar 28 08:47:45 PDT 2020
On Fri, 2020-03-27 at 15:29 -0700, Bill Wendling wrote:
> Clang defaults to "-fno-common" which causes linking errors because of
> duplicate symbols in the BSS section.
>
> Signed-off-by: Bill Wendling <morbo at google.com>
> ---
> usr/klibc/arch/x86_64/MCONFIG | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/usr/klibc/arch/x86_64/MCONFIG b/usr/klibc/arch/x86_64/MCONFIG
> index a6ba7c85c68b..46d29985bfd6 100644
> --- a/usr/klibc/arch/x86_64/MCONFIG
> +++ b/usr/klibc/arch/x86_64/MCONFIG
> @@ -27,7 +27,7 @@ ifneq ($(cc-name),clang)
> # so we can't use a cc-option test to filter them.
> KLIBCOPTFLAGS += -falign-functions=1 -falign-jumps=1 -falign-loops=1
> else
> -KLIBCOPTFLAGS += -fno-builtin-bcmp
> +KLIBCOPTFLAGS += -fno-builtin-bcmp -fcommon
This definitely belongs in KLIBCREQFLAGS in scripts/Kbuild.klibc.
Ben.
> endif
>
> KLIBCBITSIZE = 64
--
Ben Hutchings
This sentence contradicts itself - no actually it doesn't.
-------------- 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/20200328/af3be712/attachment.sig>
More information about the klibc
mailing list