mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: "liuyuntao (F)" <liuyuntao12@huawei.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	 Russell King <linux@armlinux.org.uk>, Andrew Davis <afd@ti.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	 "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	 Geert Uytterhoeven <geert+renesas@glider.be>,
	Jonathan Corbet <corbet@lwn.net>,
	 Mike Rapoport <rppt@kernel.org>, Rob Herring <robh@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	 Linus Walleij <linus.walleij@linaro.org>,
	Fangrui Song <maskray@google.com>
Subject: Re: [PATCH-next v3] arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION
Date: Fri, 15 Mar 2024 13:13:29 +0100	[thread overview]
Message-ID: <CAMj1kXG5dHsdGn0_hSv2vPyMJbe1zOf4HLprLUSKJ+Dy2e_DzQ@mail.gmail.com> (raw)
In-Reply-To: <baed1e49-d854-4517-8219-2a5bb0b3cd1b@huawei.com>

On Fri, 15 Mar 2024 at 13:10, liuyuntao (F) <liuyuntao12@huawei.com> wrote:
>
>
>
> On 2024/3/15 19:51, Arnd Bergmann wrote:
> > On Fri, Mar 15, 2024, at 12:48, liuyuntao (F) wrote:
> >> On 2024/3/15 18:46, Ard Biesheuvel wrote:
> >>> @@ -28,6 +28,7 @@
> >>>                                      -DEFI_HAVE_MEMCHR -DEFI_HAVE_STRRCHR \
> >>>                                      -DEFI_HAVE_STRCMP -fno-builtin -fpic \
> >>>                                      $(call cc-option,-mno-single-pic-base)
> >>> +cflags-$(CONFIG_ARM)           := $(filter-out -fdata-sections, $(CFLAGS-y))
> >>>    cflags-$(CONFIG_RISCV)         += -fpic -DNO_ALTERNATIVE -mno-relax
> >>>    cflags-$(CONFIG_LOONGARCH)     += -fpie
> >>
> >> Another error:
> >> cannot initialize array of ‘short unsigned int’ from a string literal
> >> with type array of ‘unsigned int’
> >>    17 | static const efi_char16_t shim_MokSBState_name[] = L"MokSBStateRT";
> >
> > The line sets cflags-y to an empty string.
> >
> > It probably should have been
> >
> > cflags-$(CONFIG_ARM)           := $(filter-out -fdata-sections, $(cflags-y))
> >
> > (small cflags instead of CFLAGS).
> >

Oops indeed.

> Oh, my mistake, after fixed this bug, still this error:
> > arm-linux-gnueabi-ld: warning: orphan section `.data.efi_loglevel' from `drivers/firmware/efi/libstub/printk.stub.o' being placed in section `.data.efi_loglevel'
> > arm-linux-gnueabi-ld: warning: orphan section `.data.screen_info_guid' from `drivers/firmware/efi/libstub/screen_info.stub.o' being placed in section `.data.screen_info_guid'
> > arm-linux-gnueabi-ld: warning: orphan section `.data.cpu_state_guid' from `drivers/firmware/efi/libstub/arm32-stub.stub.o' being placed in section `.data.cpu_state_guid'
> > arm-linux-gnueabi-ld: warning: orphan section `.data.efi_nokaslr' from `drivers/firmware/efi/libstub/efi-stub-helper.stub.o' being placed in section `.data.efi_nokaslr'
>
> The -fdata-sections option is present in the KBUILD_CFLAGS_KERNEL
> variable; altering cflags-y only affect the KBUILD_CFLAGS variable.
> It seems that the -fdata-sections option needs to be removed from the
> KBUILD_CFLAGS_KERNEL variable.

Indeed.

So

KBUILD_CFLAGS_KERNEL := $(filter-out -fdata-sections,$(KBUILD_CFLAGS_KERNEL))

(assuming I got it right this time without build testing)

  reply	other threads:[~2024-03-15 12:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15  6:31 Yuntao Liu
2024-03-15  8:06 ` Ard Biesheuvel
2024-03-15 10:23   ` liuyuntao (F)
2024-03-15 10:46     ` Ard Biesheuvel
2024-03-15 11:48       ` liuyuntao (F)
2024-03-15 11:51         ` Arnd Bergmann
2024-03-15 12:10           ` liuyuntao (F)
2024-03-15 12:13             ` Ard Biesheuvel [this message]
2024-03-15 12:21               ` liuyuntao (F)
2024-03-15 12:46                 ` Ard Biesheuvel
2024-03-15 12:51                   ` liuyuntao (F)
2024-03-15 12:58                     ` Ard Biesheuvel

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=CAMj1kXG5dHsdGn0_hSv2vPyMJbe1zOf4HLprLUSKJ+Dy2e_DzQ@mail.gmail.com \
    --to=ardb@kernel.org \
    --cc=afd@ti.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=corbet@lwn.net \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=liuyuntao12@huawei.com \
    --cc=maskray@google.com \
    --cc=robh@kernel.org \
    --cc=rppt@kernel.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®