From: Conor Dooley <conor@kernel.org>
To: Palmer Dabbelt <palmer@rivosinc.com>
Cc: linux-riscv@lists.infradead.org
Subject: Re: [PATCH] RISC-V: Stop emitting attributes
Date: Thu, 23 Feb 2023 21:18:01 +0000 [thread overview]
Message-ID: <Y/fYCbcHByowuhD1@spud> (raw)
In-Reply-To: <20230223195112.10489-1-palmer@rivosinc.com>
[-- Attachment #1.1: Type: text/plain, Size: 5632 bytes --]
On Thu, Feb 23, 2023 at 11:51:12AM -0800, Palmer Dabbelt wrote:
> The RISC-V ELF attributes don't contain any useful information. New
> toolchains ignore them, but they frequently trip up various older/mixed
> toolchains. So just turn them off.
>
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
> ---
> arch/riscv/Makefile | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
> index 76989561566b..1fc504e2b85e 100644
> --- a/arch/riscv/Makefile
> +++ b/arch/riscv/Makefile
> @@ -81,6 +81,11 @@ ifeq ($(CONFIG_PERF_EVENTS),y)
> KBUILD_CFLAGS += -fno-omit-frame-pointer
> endif
>
> +# The RISC-V attributes frequently cause compatibility issues and provide no
> +# information, so just turn them off.
> +KBUILD_CFLAGS += $(call cc-option,-mno-riscv-attribute)
> +KBUILD_CFLAGS += $(call as-option,-Wa$(comma)-mno-arch-attr)
> +
> KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax)
> KBUILD_AFLAGS_MODULE += $(call as-option,-Wa$(comma)-mno-relax)
As requested, the build issues I see w/ this patch applied & ld 2.35:
LD arch/riscv/purgatory/purgatory.ro
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0_zmmul1p0: Invalid or unknown z ISA extension: 'zmmul'
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: failed to merge target specific data of file arch/riscv/purgatory/memcpy.o
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0_zmmul1p0: Invalid or unknown z ISA extension: 'zmmul'
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: failed to merge target specific data of file arch/riscv/purgatory/memset.o
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0_zmmul1p0: Invalid or unknown z ISA extension: 'zmmul'
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: failed to merge target specific data of file arch/riscv/purgatory/strcmp.o
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0_zmmul1p0: Invalid or unknown z ISA extension: 'zmmul'
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: failed to merge target specific data of file arch/riscv/purgatory/strlen.o
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0_zmmul1p0: Invalid or unknown z ISA extension: 'zmmul'
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: failed to merge target specific data of file arch/riscv/purgatory/strncmp.o
CHECK /stuff/linux/ipc/ipc_sysctl.c
make[6]: *** [/stuff/linux/arch/riscv/purgatory/Makefile:95: arch/riscv/purgatory/purgatory.ro] Error 1
make[6]: Target 'arch/riscv/purgatory/' not remade because of errors.
make[5]: *** [/stuff/linux/scripts/Makefile.build:504: arch/riscv/purgatory] Error 2
CC arch/riscv/mm/dma-noncoherent.o
AR arch/riscv/kernel/probes/built-in.a
CHECK /stuff/linux/lib/zlib_inflate/inffast.c
VDSOLD arch/riscv/kernel/vdso/vdso.so.dbg
VDSOLD arch/riscv/kernel/compat_vdso/compat_vdso.so.dbg
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0_zmmul1p0: Invalid or unknown z ISA extension: 'zmmul'
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: failed to merge target specific data of file arch/riscv/kernel/vdso/getcpu.o
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0_zmmul1p0: Invalid or unknown z ISA extension: 'zmmul'
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: failed to merge target specific data of file arch/riscv/kernel/vdso/flush_icache.o
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0_zmmul1p0: Invalid or unknown z ISA extension: 'zmmul'
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: failed to merge target specific data of file arch/riscv/kernel/vdso/note.o
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: -march=rv32i2p0_m2p0_a2p0_f2p0_d2p0_zmmul1p0: Invalid or unknown z ISA extension: 'zmmul'
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: failed to merge target specific data of file arch/riscv/kernel/compat_vdso/getcpu.o
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: -march=rv32i2p0_m2p0_a2p0_f2p0_d2p0_zmmul1p0: Invalid or unknown z ISA extension: 'zmmul'
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: failed to merge target specific data of file arch/riscv/kernel/compat_vdso/flush_icache.o
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: -march=rv32i2p0_m2p0_a2p0_f2p0_d2p0_zmmul1p0: Invalid or unknown z ISA extension: 'zmmul'
/stuff/toolchains/binutils-2.35/bin/riscv64-linux-gnu-ld: failed to merge target specific data of file arch/riscv/kernel/compat_vdso/note.o
OBJCOPY arch/riscv/kernel/compat_vdso/compat_vdso.so
OBJCOPY arch/riscv/kernel/vdso/vdso.so
riscv64-unknown-linux-gnu-objcopy: 'arch/riscv/kernel/compat_vdso/compat_vdso.so.dbg': No such file
riscv64-unknown-linux-gnu-objcopy: 'arch/riscv/kernel/vdso/vdso.so.dbg': No such file
make[7]: *** [/stuff/linux/arch/riscv/kernel/compat_vdso/Makefile:48: arch/riscv/kernel/compat_vdso/compat_vdso.so] Error 1
Specifically this is what I am running:
CONFIG_CC_VERSION_TEXT="riscv64-unknown-linux-gnu-gcc (ge4703bd0e15-dirty) 13.0.1 20230122 (experimental)"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=130001
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24050
CONFIG_LD_IS_BFD=y
CONFIG_LD_VERSION=23500
Cheers,
Conor.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2023-02-23 21:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-23 19:51 [PATCH] RISC-V: Stop emitting attributes Palmer Dabbelt
2023-02-23 21:18 ` Conor Dooley [this message]
2023-02-23 22:13 ` Palmer Dabbelt
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=Y/fYCbcHByowuhD1@spud \
--to=conor@kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@rivosinc.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.