public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390/decompresser: fix misaligned symbol build error
Date: Thu, 22 Jun 2023 14:35:38 +0000	[thread overview]
Message-ID: <20230622143538.GA1138962@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20230622125508.1068457-1-hca@linux.ibm.com>

On Thu, Jun 22, 2023 at 02:55:08PM +0200, Heiko Carstens wrote:
> Nathan Chancellor reported a kernel build error on Fedora 39:
> 
> $ clang --version | head -1
> clang version 16.0.5 (Fedora 16.0.5-1.fc39)
> 
> $ s390x-linux-gnu-ld --version | head -1
> GNU ld version 2.40-1.fc39
> 
> $ make -skj"$(nproc)" ARCH=s390 CC=clang CROSS_COMPILE=s390x-linux-gnu- olddefconfig all
> s390x-linux-gnu-ld: arch/s390/boot/startup.o(.text+0x5b4): misaligned symbol `_decompressor_end' (0x35b0f) for relocation R_390_PC32DBL
> make[3]: *** [.../arch/s390/boot/Makefile:78: arch/s390/boot/vmlinux] Error 1
> 
> It turned out that the problem with misaligned symbols on s390 was fixed
> with commit 80ddf5ce1c92 ("s390: always build relocatable kernel") for the
> kernel image, but did not take into account that the decompressor uses its
> own set of CFLAGS, which come without -fPIE.
> 
> Add the -fPIE flag also to the decompresser CFLAGS to fix this.
> 

I think this should also have:

Reported-by: CKI <cki-project@redhat.com>
Link: https://lore.kernel.org/32935.123062114500601371@us-mta-9.us.mimecast.lan/

I technically just forwarded the report and did a little extra testing.

> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Suggested-by: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1747
> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

Thanks for the quick patch, this fixes the error and I did a simple boot
test in QEMU with the resulting kernel, which showed no issues.

Tested-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  arch/s390/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/s390/Makefile b/arch/s390/Makefile
> index ed646c583e4f..5ed242897b0d 100644
> --- a/arch/s390/Makefile
> +++ b/arch/s390/Makefile
> @@ -27,6 +27,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbac
>  KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
>  KBUILD_CFLAGS_DECOMPRESSOR += -ffreestanding
>  KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector
> +KBUILD_CFLAGS_DECOMPRESSOR += -fPIE
>  KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member)
>  KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
>  KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
> -- 
> 2.39.2
> 

  reply	other threads:[~2023-06-22 14:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22 12:55 [PATCH] s390/decompresser: fix misaligned symbol build error Heiko Carstens
2023-06-22 14:35 ` Nathan Chancellor [this message]
2023-06-22 16:56   ` Heiko Carstens

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=20230622143538.GA1138962@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=svens@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox