All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Paul Menzel <pmenzel@molgen.mpg.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>
Cc: Derek Parker <parkerderek86@gmail.com>,
	Dmitrii Okunev <xaionaro@gmail.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: clang/ld.lld build fails with `can't create dynamic relocation R_PPC64_ADDR64 against local symbol in readonly segment`
Date: Thu, 12 Aug 2021 15:46:12 +1000	[thread overview]
Message-ID: <87r1ezmd0b.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <77a69755-5291-285c-45be-c1e42423fddc@molgen.mpg.de>

Paul Menzel <pmenzel@molgen.mpg.de> writes:
> Am 29.07.21 um 10:23 schrieb Paul Menzel:
>
>> I just wanted to make you aware that building Linux for ppc64le with 
>> clang/lld.ld fails with [1]:
>> 
>>      ld.lld: error: can't create dynamic relocation R_PPC64_ADDR64 
>> against symbol: empty_zero_page in readonly segment; recompile object 
>> files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in 
>> the output
>>      >>> defined in arch/powerpc/kernel/head_64.o
>>      >>> referenced by 
>> arch/powerpc/kernel/head_64.o:(___ksymtab+empty_zero_page+0x0)
>> 
>> The patch below from one of the comments [2] fixes it.
>> 
>> --- i/arch/powerpc/Makefile
>> +++ w/arch/powerpc/Makefile
>> @@ -122,7 +122,7 @@ cflags-$(CONFIG_STACKPROTECTOR)     += 
>> -mstack-protector-guard-reg=r2
>>   endif
>> 
>>   LDFLAGS_vmlinux-y := -Bstatic
>> -LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie
>> +LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie -z notext
>>   LDFLAGS_vmlinux        := $(LDFLAGS_vmlinux-y)
>>   LDFLAGS_vmlinux += $(call ld-option,--orphan-handling=warn)
>
> Any comments, if this is the right fix? Current Linux master branch 
> still fails to build with `LLVM=1` on Ubuntu 21.04 without this change.

Sorry but I have no idea if it's the right fix. What I need is the
author (or someone else) to send a patch with a change log explaining
the change, what it does, why it's right for llvm, and why it's right
for binutils.

cheers

      parent reply	other threads:[~2021-08-12  5:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29  8:23 clang/ld.lld build fails with `can't create dynamic relocation R_PPC64_ADDR64 against local symbol in readonly segment` Paul Menzel
2021-08-10 18:38 ` Paul Menzel
2021-08-11 14:10   ` Christophe Leroy
2021-08-11 23:09     ` Paul Menzel
2021-08-12  5:46   ` Michael Ellerman [this message]

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=87r1ezmd0b.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=parkerderek86@gmail.com \
    --cc=paulus@samba.org \
    --cc=pmenzel@molgen.mpg.de \
    --cc=xaionaro@gmail.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.