All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Joel Stanley <joel@jms.id.au>, linuxppc-dev@lists.ozlabs.org
Cc: Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [v2,3/5] powerpc/boot: Ensure _zimage_start is a weak symbol
Date: Thu, 20 Sep 2018 14:21:04 +1000 (AEST)	[thread overview]
Message-ID: <42G3Sc3W8Dz9sCm@ozlabs.org> (raw)
In-Reply-To: <20180914040649.1794-4-joel@jms.id.au>

On Fri, 2018-09-14 at 04:06:47 UTC, Joel Stanley wrote:
> When building with clang crt0's _zimage_start is not marked weak, which
> breaks the build when linking the kernel image:
> 
>  $ objdump -t arch/powerpc/boot/crt0.o |grep _zimage_start$
>  0000000000000058 g       .text  0000000000000000 _zimage_start
> 
>  ld: arch/powerpc/boot/wrapper.a(crt0.o): in function '_zimage_start':
>  (.text+0x58): multiple definition of '_zimage_start';
>  arch/powerpc/boot/pseries-head.o:(.text+0x0): first defined here
> 
> Clang requires the .weak directive to appear after the symbol is
> declared. The binutils manual says:
> 
>  This directive sets the weak attribute on the comma separated list of
>  symbol names. If the symbols do not already exist, they will be
>  created.
> 
> So it appears this is different with clang. The only reference I could
> see for this was an OpenBSD mailing list post[1].
> 
> Changing it to be after the declaration fixes building with Clang, and
> still works with GCC.
> 
>  $ objdump -t arch/powerpc/boot/crt0.o |grep _zimage_start$
>  0000000000000058  w      .text	0000000000000000 _zimage_start
> 
> Reported to clang as https://bugs.llvm.org/show_bug.cgi?id=38921
> 
> [1] https://groups.google.com/forum/#!topic/fa.openbsd.tech/PAgKKen2YCY
> 
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/ee9d21b3b3583712029a0db65a4b7c

cheers

  parent reply	other threads:[~2018-09-20  4:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-14  4:06 [PATCH v2 0/5] powerpc: Clang build fixes Joel Stanley
2018-09-14  4:06 ` [PATCH v2 1/5] powerpc/Makefiles: Fix clang/llvm build Joel Stanley
2018-09-14 17:41   ` Nick Desaulniers
2018-09-20  7:04     ` Joel Stanley
2018-09-14  4:06 ` [PATCH v2 2/5] powerpc/boot: Fix crt0.S syntax for clang Joel Stanley
2018-09-14 17:47   ` Nick Desaulniers
2018-09-14 21:08     ` Segher Boessenkool
2018-09-17 20:41       ` Nick Desaulniers
2018-09-18  1:08         ` Joel Stanley
2018-09-18 10:53           ` Michael Ellerman
2018-09-14  4:06 ` [PATCH v2 3/5] powerpc/boot: Ensure _zimage_start is a weak symbol Joel Stanley
2018-09-14 17:50   ` Nick Desaulniers
2018-09-20  4:21   ` Michael Ellerman [this message]
2018-09-14  4:06 ` [PATCH v2 4/5] powerpc: Fix duplicate const clang warning in user access code Joel Stanley
2018-09-14 17:57   ` Nick Desaulniers
2018-09-19  7:45     ` Joel Stanley
2018-09-20  4:54       ` Christophe LEROY
2018-09-20 12:35         ` Michael Ellerman
2018-09-20  4:21   ` [v2, " Michael Ellerman
2018-09-14  4:06 ` [PATCH v2 5/5] powerpc: Remove -mno-sched-epilog Joel Stanley
2018-09-14  5:06   ` Nicholas Piggin
2018-09-14 18:03     ` Nick Desaulniers
2018-09-14 20:43       ` Nicholas Piggin
2018-09-14 21:18         ` Segher Boessenkool
2018-09-14 22:20           ` Nick Desaulniers
2018-09-15  1:04             ` Segher Boessenkool

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=42G3Sc3W8Dz9sCm@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=joel@jms.id.au \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ndesaulniers@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.