From: Yao Zi <me@ziyao.cc>
To: Daniel Palmer <daniel@thingy.jp>,
visitorckw@gmail.com, angelo@kernel-space.org
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH] m68k: Add LTO support
Date: Thu, 12 Mar 2026 07:40:22 +0000 [thread overview]
Message-ID: <abJtug8itcufvkNk@pie> (raw)
In-Reply-To: <20260311093048.1773382-1-daniel@thingy.jp>
On Wed, Mar 11, 2026 at 06:30:48PM +0900, Daniel Palmer wrote:
> Most m68k retro/homebrew machines will have limited flash/RAM
> so having LTO working would be nice.
>
> Not many changes are need really. Most of this is copy/paste
> from the ARM32 version.
>
> The major change is that the direct register usage of d7 for gd
> needs to be hidden so that when LTO passes over everything it
> doesn't see multiple instances of d7.
>
> Signed-off-by: Daniel Palmer <daniel@thingy.jp>
> ---
>
> This is another patch from my vault that I have been using
> on various classic m68k machines for ages. I haven't tested
> it with coldfire though.
>
> arch/Kconfig | 1 +
> arch/m68k/config.mk | 11 +++++++++--
> arch/m68k/cpu/m680x0/cpu.c | 2 +-
> arch/m68k/include/asm/global_data.h | 19 +++++++++++++++++++
> arch/m68k/lib/ashldi3.c | 1 +
> arch/m68k/lib/lshrdi3.c | 1 +
> arch/m68k/lib/muldi3.c | 1 +
> common/board_r.c | 4 ++--
> common/init/board_init.c | 2 +-
> 9 files changed, 36 insertions(+), 6 deletions(-)
...
> diff --git a/common/init/board_init.c b/common/init/board_init.c
> index 2a6f39f51adb..c56b33e7be7c 100644
> --- a/common/init/board_init.c
> +++ b/common/init/board_init.c
> @@ -17,7 +17,7 @@ DECLARE_GLOBAL_DATA_PTR;
> * Unfortunately x86, ARM and RISC-V can't compile this code as gd is defined
> * as macro and cannot be assigned.
This comment should probably be updated as well to reflect the code
behavior :)
> */
> -#if !defined(CONFIG_X86) && !defined(CONFIG_ARM) && !defined(CONFIG_RISCV)
> +#if !defined(CONFIG_X86) && !defined(CONFIG_ARM) && !defined(CONFIG_RISCV) && !defined(CONFIG_M68K)
> __weak void arch_setup_gd(struct global_data *gd_ptr)
> {
> gd = gd_ptr;
> --
> 2.51.0
>
Regards,
Yao Zi
next prev parent reply other threads:[~2026-03-12 7:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 9:30 [PATCH] m68k: Add LTO support Daniel Palmer
2026-03-12 7:40 ` Yao Zi [this message]
2026-03-13 16:56 ` Kuan-Wei Chiu
2026-03-15 8:36 ` Daniel Palmer
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=abJtug8itcufvkNk@pie \
--to=me@ziyao.cc \
--cc=angelo@kernel-space.org \
--cc=daniel@thingy.jp \
--cc=u-boot@lists.denx.de \
--cc=visitorckw@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.