[PATCH v2 00/11] multi-target: prefix helpers with target prefix

Pierrick Bouvier posted 11 patches 4 weeks, 1 day ago
Failed in applying to current master (apply log)
include/exec/helper-gen-common.h   |  7 ++++
include/exec/helper-gen.h.inc      | 48 ++++++++++++------------
include/exec/helper-head.h.inc     |  8 +++-
include/exec/helper-info.c.inc     | 16 ++++----
include/exec/helper-proto-common.h |  7 ++++
meson.build                        |  2 +
target/alpha/fpu_helper.c          |  2 +-
target/alpha/helper.h              |  2 +-
target/alpha/translate.c           |  4 +-
target/hexagon/gen_tcg.h           |  2 +-
target/hexagon/gen_tcg_sys.h       |  2 +-
target/hexagon/helper.h            |  4 +-
target/hexagon/op_helper.c         |  4 +-
target/hexagon/translate.c         |  4 +-
target/hppa/helper.h               |  6 +--
target/hppa/op_helper.c            |  4 +-
target/hppa/sys_helper.c           |  8 ++--
target/hppa/translate.c            |  6 +--
target/microblaze/helper.h         | 10 ++---
target/microblaze/op_helper.c      | 10 ++---
target/microblaze/translate.c      | 10 ++---
target/or1k/helper.h               |  2 +-
target/or1k/interrupt_helper.c     |  2 +-
target/or1k/translate.c            |  2 +-
target/rx/helper.h                 | 12 +++---
target/rx/op_helper.c              | 60 +++++++++++++++---------------
target/rx/translate.c              | 14 +++----
target/sparc/crypto_helper.c       | 30 +++++++--------
target/tricore/fpu_helper.c        | 12 +++---
target/tricore/helper.h            | 14 +++----
target/tricore/translate.c         | 14 +++----
31 files changed, 175 insertions(+), 153 deletions(-)
[PATCH v2 00/11] multi-target: prefix helpers with target prefix
Posted by Pierrick Bouvier 4 weeks, 1 day ago
When linking multiple targets together, we usually have conflicts with helper
names. So far, it was solved using ad-hoc renaming, but multiple people pointed it
would be better to have a general mechanism for it, so here it is.

A previous series attempted that:
https://lore.kernel.org/qemu-devel/20260930073935.712-1-luoyonggang@gmail.com/,
but it was relying on (binary) symbol renaming, which is not a portable solution.
Instead, this series approaches the problem from source code directly.
It requires more change, but it's cleaner IMHO.

Series follows these steps:

First, we make sure all helpers and definition are using HELPER() macro. A lot
of helpers were already defined this way, we just make sure it's exhaustive.
After that we don't have any 'helper_' left on any target code. This is a big
change touching the whole codebase, but it's a simple mechanical change. As long
as it compiles and links, we know it's correct.

Then, we introduce the prefix for target helpers. For this , we add a new define
(from meson) that applies to all target related code. It could later be used to
prefix other symbols also, that's why it's not named "TCG".

Finally, we cleanup the previous manual helpers prefix that were added in
codebase.

v2
--

- rebase on master (series partially merged + solved conflicts)
- new sparc helpers not using HELPER macro

Pierrick Bouvier (11):
  target/rx: define and call helpers using HELPER macro
  tcg: introduce HELPER_INFO macro
  target/sparc: define crypto helpers using HELPER macro
  tcg: prefix helpers with target base architecture
  target/alpha: remove explicit target specific prefix
  target/hexagon: remove explicit target specific prefix
  target/hppa: remove explicit target specific prefix
  target/microblaze: remove explicit target specific prefix
  target/or1k: remove explicit target specific prefix
  target/rx: remove explicit target specific prefix
  target/tricore: remove explicit target specific prefix

 include/exec/helper-gen-common.h   |  7 ++++
 include/exec/helper-gen.h.inc      | 48 ++++++++++++------------
 include/exec/helper-head.h.inc     |  8 +++-
 include/exec/helper-info.c.inc     | 16 ++++----
 include/exec/helper-proto-common.h |  7 ++++
 meson.build                        |  2 +
 target/alpha/fpu_helper.c          |  2 +-
 target/alpha/helper.h              |  2 +-
 target/alpha/translate.c           |  4 +-
 target/hexagon/gen_tcg.h           |  2 +-
 target/hexagon/gen_tcg_sys.h       |  2 +-
 target/hexagon/helper.h            |  4 +-
 target/hexagon/op_helper.c         |  4 +-
 target/hexagon/translate.c         |  4 +-
 target/hppa/helper.h               |  6 +--
 target/hppa/op_helper.c            |  4 +-
 target/hppa/sys_helper.c           |  8 ++--
 target/hppa/translate.c            |  6 +--
 target/microblaze/helper.h         | 10 ++---
 target/microblaze/op_helper.c      | 10 ++---
 target/microblaze/translate.c      | 10 ++---
 target/or1k/helper.h               |  2 +-
 target/or1k/interrupt_helper.c     |  2 +-
 target/or1k/translate.c            |  2 +-
 target/rx/helper.h                 | 12 +++---
 target/rx/op_helper.c              | 60 +++++++++++++++---------------
 target/rx/translate.c              | 14 +++----
 target/sparc/crypto_helper.c       | 30 +++++++--------
 target/tricore/fpu_helper.c        | 12 +++---
 target/tricore/helper.h            | 14 +++----
 target/tricore/translate.c         | 14 +++----
 31 files changed, 175 insertions(+), 153 deletions(-)

-- 
2.43.0
Re: [PATCH v2 00/11] multi-target: prefix helpers with target prefix
Posted by Pierrick Bouvier 3 weeks, 5 days ago
On 10/24/2026 8:32 AM, Pierrick Bouvier wrote:
> When linking multiple targets together, we usually have conflicts with helper
> names. So far, it was solved using ad-hoc renaming, but multiple people pointed it
> would be better to have a general mechanism for it, so here it is.
> 
> A previous series attempted that:
> https://lore.kernel.org/qemu-devel/20260930073935.712-1-luoyonggang@gmail.com/,
> but it was relying on (binary) symbol renaming, which is not a portable solution.
> Instead, this series approaches the problem from source code directly.
> It requires more change, but it's cleaner IMHO.
> 
> Series follows these steps:
> 
> First, we make sure all helpers and definition are using HELPER() macro. A lot
> of helpers were already defined this way, we just make sure it's exhaustive.
> After that we don't have any 'helper_' left on any target code. This is a big
> change touching the whole codebase, but it's a simple mechanical change. As long
> as it compiles and links, we know it's correct.
> 
> Then, we introduce the prefix for target helpers. For this , we add a new define
> (from meson) that applies to all target related code. It could later be used to
> prefix other symbols also, that's why it's not named "TCG".
> 
> Finally, we cleanup the previous manual helpers prefix that were added in
> codebase.
> 
> v2
> --
> 
> - rebase on master (series partially merged + solved conflicts)
> - new sparc helpers not using HELPER macro
> 
> Pierrick Bouvier (11):
>   target/rx: define and call helpers using HELPER macro
>   tcg: introduce HELPER_INFO macro
>   target/sparc: define crypto helpers using HELPER macro
>   tcg: prefix helpers with target base architecture
>   target/alpha: remove explicit target specific prefix
>   target/hexagon: remove explicit target specific prefix
>   target/hppa: remove explicit target specific prefix
>   target/microblaze: remove explicit target specific prefix
>   target/or1k: remove explicit target specific prefix
>   target/rx: remove explicit target specific prefix
>   target/tricore: remove explicit target specific prefix
> 
>  include/exec/helper-gen-common.h   |  7 ++++
>  include/exec/helper-gen.h.inc      | 48 ++++++++++++------------
>  include/exec/helper-head.h.inc     |  8 +++-
>  include/exec/helper-info.c.inc     | 16 ++++----
>  include/exec/helper-proto-common.h |  7 ++++
>  meson.build                        |  2 +
>  target/alpha/fpu_helper.c          |  2 +-
>  target/alpha/helper.h              |  2 +-
>  target/alpha/translate.c           |  4 +-
>  target/hexagon/gen_tcg.h           |  2 +-
>  target/hexagon/gen_tcg_sys.h       |  2 +-
>  target/hexagon/helper.h            |  4 +-
>  target/hexagon/op_helper.c         |  4 +-
>  target/hexagon/translate.c         |  4 +-
>  target/hppa/helper.h               |  6 +--
>  target/hppa/op_helper.c            |  4 +-
>  target/hppa/sys_helper.c           |  8 ++--
>  target/hppa/translate.c            |  6 +--
>  target/microblaze/helper.h         | 10 ++---
>  target/microblaze/op_helper.c      | 10 ++---
>  target/microblaze/translate.c      | 10 ++---
>  target/or1k/helper.h               |  2 +-
>  target/or1k/interrupt_helper.c     |  2 +-
>  target/or1k/translate.c            |  2 +-
>  target/rx/helper.h                 | 12 +++---
>  target/rx/op_helper.c              | 60 +++++++++++++++---------------
>  target/rx/translate.c              | 14 +++----
>  target/sparc/crypto_helper.c       | 30 +++++++--------
>  target/tricore/fpu_helper.c        | 12 +++---
>  target/tricore/helper.h            | 14 +++----
>  target/tricore/translate.c         | 14 +++----
>  31 files changed, 175 insertions(+), 153 deletions(-)
> 

This was merged into master (2c0584588c9fedc2a8abc087c01a498ce80997d0).

Regards,
Pierrick