mbox series

[0/6] single-binary: build target common libraries with dependencies

Message ID 20250516052708.930928-1-pierrick.bouvier@linaro.org
Headers show
Series single-binary: build target common libraries with dependencies | expand

Message

Pierrick Bouvier May 16, 2025, 5:27 a.m. UTC
Recently, common libraries per target base architecture were introduced in order
to compile those files only once. However, it was missing common dependencies
(which include external libraries), so it failed to build on some hosts.

This series fixes this, inspired by Thomas fix [1], and applied to other
libraries introduced very recently with [2].

As well, we do further cleanup by removing lib{system, user} source sets that
were recently introduced, by merging them in system/user libraries, thus
simplifying the work on single-binary.

This series was built on {linux, macos, windows} x {x86_64, aarch64} and
freebsd on x86_64. Fully tested on linux x {x86_64, aarch64}.
In addition to that, it was checked that compilation units compiled per binary
stayed the same, and that their size was identical.

[1] https://lore.kernel.org/qemu-devel/20250513115637.184940-1-thuth@redhat.com/
[2] https://gitlab.com/qemu-project/qemu/-/commit/b2bb3f3576e5dc99218607dde09e25ac0e55693c

Pierrick Bouvier (6):
  meson: build target libraries with common dependencies
  hw/arm: remove explicit dependencies listed
  target/arm: remove explicit dependencies listed
  meson: apply target config for picking files from lib{system, user}
  meson: merge lib{system, user}_ss with {system, user}_ss.
  meson: remove lib{system, user}_ss aliases

 meson.build            | 65 +++++++++++++++++++++++++++---------------
 accel/tcg/meson.build  |  8 +++---
 gdbstub/meson.build    |  4 +--
 hw/arm/meson.build     |  4 +--
 hw/core/meson.build    |  4 +--
 plugins/meson.build    |  4 +--
 system/meson.build     |  2 +-
 target/arm/meson.build |  2 +-
 tcg/meson.build        |  4 +--
 9 files changed, 58 insertions(+), 39 deletions(-)

Comments

Pierrick Bouvier May 16, 2025, 5:40 a.m. UTC | #1
On 5/15/25 10:27 PM, Pierrick Bouvier wrote:
> Recently, common libraries per target base architecture were introduced in order
> to compile those files only once. However, it was missing common dependencies
> (which include external libraries), so it failed to build on some hosts.
> 
> This series fixes this, inspired by Thomas fix [1], and applied to other
> libraries introduced very recently with [2].
> 
> As well, we do further cleanup by removing lib{system, user} source sets that
> were recently introduced, by merging them in system/user libraries, thus
> simplifying the work on single-binary.
> 
> This series was built on {linux, macos, windows} x {x86_64, aarch64} and
> freebsd on x86_64. Fully tested on linux x {x86_64, aarch64}.
> In addition to that, it was checked that compilation units compiled per binary
> stayed the same, and that their size was identical.
> 
> [1] https://lore.kernel.org/qemu-devel/20250513115637.184940-1-thuth@redhat.com/
> [2] https://gitlab.com/qemu-project/qemu/-/commit/b2bb3f3576e5dc99218607dde09e25ac0e55693c
> 
> Pierrick Bouvier (6):
>    meson: build target libraries with common dependencies
>    hw/arm: remove explicit dependencies listed
>    target/arm: remove explicit dependencies listed
>    meson: apply target config for picking files from lib{system, user}
>    meson: merge lib{system, user}_ss with {system, user}_ss.
>    meson: remove lib{system, user}_ss aliases
> 
>   meson.build            | 65 +++++++++++++++++++++++++++---------------
>   accel/tcg/meson.build  |  8 +++---
>   gdbstub/meson.build    |  4 +--
>   hw/arm/meson.build     |  4 +--
>   hw/core/meson.build    |  4 +--
>   plugins/meson.build    |  4 +--
>   system/meson.build     |  2 +-
>   target/arm/meson.build |  2 +-
>   tcg/meson.build        |  4 +--
>   9 files changed, 58 insertions(+), 39 deletions(-)
> 

As well, openbsd build works with:

make vm-build-openbsd J=4 TARGET_LIST=aarch64-softmmu

(thanks for the command Thomas)
Thomas Huth May 16, 2025, 7:24 a.m. UTC | #2
On 16/05/2025 07.27, Pierrick Bouvier wrote:
> Recently, common libraries per target base architecture were introduced in order
> to compile those files only once. However, it was missing common dependencies
> (which include external libraries), so it failed to build on some hosts.
> 
> This series fixes this, inspired by Thomas fix [1],

Actually, credits should go to Paolo who came up with the meson magic :-)

> and applied to other
> libraries introduced very recently with [2].
> 
> As well, we do further cleanup by removing lib{system, user} source sets that
> were recently introduced, by merging them in system/user libraries, thus
> simplifying the work on single-binary.
> 
> This series was built on {linux, macos, windows} x {x86_64, aarch64} and
> freebsd on x86_64. Fully tested on linux x {x86_64, aarch64}.
> In addition to that, it was checked that compilation units compiled per binary
> stayed the same, and that their size was identical.

Thanks, works for me, on both, Linux and OpenBSD:

Tested-by: Thomas Huth <thuth@redhat.com>