u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: "kleines Filmröllchen" <malu.bertsch@gmail.com>
Cc: u-boot@lists.denx.de,
	"kleines Filmröllchen" <filmroellchen@serenityos.org>,
	"Bin Meng" <bmeng@tinylab.org>, Leo <ycliang@andestech.com>,
	"Rick Chen" <rick@andestech.com>,
	"Samuel Holland" <samuel@sholland.org>
Subject: Re: [PATCH 1/1] riscv: Support building with Clang
Date: Fri, 19 Jan 2024 19:20:49 -0500	[thread overview]
Message-ID: <20240120002049.GO12635@bill-the-cat> (raw)
In-Reply-To: <20240120001405.29294-2-filmroellchen@serenityos.org>

[-- Attachment #1: Type: text/plain, Size: 1481 bytes --]

On Sat, Jan 20, 2024 at 01:14:04AM +0100, kleines Filmröllchen wrote:

> The -ffixed-gp option of GCC has an exact equivalent of -ffixed-x3 in
> Clang.
> 
> Signed-off-by: kleines Filmröllchen <filmroellchen@serenityos.org>
> ---
> 
>  arch/riscv/config.mk | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/config.mk b/arch/riscv/config.mk
> index 9cf2aef0a4..dc4f30d673 100644
> --- a/arch/riscv/config.mk
> +++ b/arch/riscv/config.mk
> @@ -9,6 +9,9 @@
>  # Copyright (C) 2017 Andes Technology Corporation
>  # Rick Chen, Andes Technology Corporation <rick@andestech.com>
>  #
> +# Copyright (C) 2024 the SerenityOS project
> +# kleines Filmröllchen <filmroellchen@serenityos.org>
> +#
>  
>  32bit-emul		:= elf32lriscv
>  64bit-emul		:= elf64lriscv

We don't have hard and fast rules about adding copyright lines, but this
seems a bit excessive.

> @@ -25,7 +28,12 @@ EFI_LDS			:= elf_riscv64_efi.lds
>  PLATFORM_ELFFLAGS	+= -B riscv -O elf64-littleriscv
>  endif
>  
> -PLATFORM_CPPFLAGS	+= -ffixed-gp -fpic
> +PLATFORM_CPPFLAGS	+= -fpic
> +ifeq ($(cc-name),clang)
> +PLATFORM_CPPFLAGS   += -ffixed-x3
> +else
> +PLATFORM_CPPFLAGS   += -ffixed-gp
> +endif
>  PLATFORM_RELFLAGS	+= -fno-common -ffunction-sections -fdata-sections
>  LDFLAGS_u-boot		+= --gc-sections -static -pie

A quick check shows that GCC support -ffixed-x3 as well, so we should
just use that in all cases.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2024-01-20  0:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-20  0:14 [PATCH 0/1] riscv: Support building with Clang kleines Filmröllchen
2024-01-20  0:14 ` [PATCH 1/1] " kleines Filmröllchen
2024-01-20  0:20   ` Tom Rini [this message]
2024-01-25 14:06     ` [PATCH v2 0/1] " kleines Filmröllchen
2024-01-25 14:06       ` [PATCH v2 1/1] " kleines Filmröllchen
2024-01-25 14:16         ` Tom Rini

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=20240120002049.GO12635@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=bmeng@tinylab.org \
    --cc=filmroellchen@serenityos.org \
    --cc=malu.bertsch@gmail.com \
    --cc=rick@andestech.com \
    --cc=samuel@sholland.org \
    --cc=u-boot@lists.denx.de \
    --cc=ycliang@andestech.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;
as well as URLs for NNTP newsgroup(s).