From 61718793a4c04c768ecc829372b9d4de3c6c463b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 17 Sep 2022 09:53:46 -0700 Subject: imx-dpu-g2d,imx-gpu-viv,imx-sw-pdm: Use gcompat with musl These recipes contain pre-built binaries and libraries which are built against glibc, we have a way to run such binaries on musl systems via gcompat stubs, however, we have to fool the system to ignore the missing rdeps on libc.so.6, since we know they will be available via gcompat being in rdep. Signed-off-by: Khem Raj --- recipes-graphics/imx-g2d/imx-dpu-g2d_2.1.0.bb | 3 +++ recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p4.2-aarch64.bb | 7 ++++--- recipes-multimedia/imx-sw-pdm/imx-sw-pdm_1.0.2.bb | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/recipes-graphics/imx-g2d/imx-dpu-g2d_2.1.0.bb b/recipes-graphics/imx-g2d/imx-dpu-g2d_2.1.0.bb index ad8de74c1..e2f5912b5 100644 --- a/recipes-graphics/imx-g2d/imx-dpu-g2d_2.1.0.bb +++ b/recipes-graphics/imx-g2d/imx-dpu-g2d_2.1.0.bb @@ -23,5 +23,8 @@ do_install () { } INSANE_SKIP:${PN} += "ldflags" +INSANE_SKIP:append:libc-musl = " file-rdeps" COMPATIBLE_MACHINE = "(imxdpu)" + +RDEPENDS:${PN}:append:libc-musl = " gcompat" diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p4.2-aarch64.bb b/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p4.2-aarch64.bb index bd584dbea..4136631b0 100644 --- a/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p4.2-aarch64.bb +++ b/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p4.2-aarch64.bb @@ -1,9 +1,10 @@ require imx-gpu-viv-6.inc -DEPENDS:append:libc-musl = " gcompat" -INSANE_SKIP:append:libc-musl = " file-rdeps" - SRC_URI[md5sum] = "22de8a5f59a56a7ef499f590d1659b6f" SRC_URI[sha256sum] = "52921c0b59529f1598084e991eda1863100754f28a7744ba958158dff8074b3b" +INSANE_SKIP:append:libc-musl = " file-rdeps" + COMPATIBLE_MACHINE = "(mx8-nxp-bsp)" + +RDEPENDS:${PN}:append:libc-musl = " gcompat" diff --git a/recipes-multimedia/imx-sw-pdm/imx-sw-pdm_1.0.2.bb b/recipes-multimedia/imx-sw-pdm/imx-sw-pdm_1.0.2.bb index 3d5572076..957d6ddf9 100644 --- a/recipes-multimedia/imx-sw-pdm/imx-sw-pdm_1.0.2.bb +++ b/recipes-multimedia/imx-sw-pdm/imx-sw-pdm_1.0.2.bb @@ -16,3 +16,7 @@ INSANE_SKIP:${PN} = "already-stripped" FILES:${PN} += "${datadir}/imx-mm" COMPATIBLE_MACHINE = "(mx8-nxp-bsp)" + +INSANE_SKIP:append:libc-musl = " file-rdeps" + +RDEPENDS:${PN}:append:libc-musl = " gcompat" -- cgit v1.2.3-54-g00ecf From fa4112e43fc4edc4a8521eddd459606328be647e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 17 Sep 2022 10:01:30 -0700 Subject: cairo,xwayland: Fix compiling with musl with vivante gpu driver libs This ensures that the symbols from the prebuilt libs are not flagged during build, we are betting on gcompat to provide the missing glibc API stubs at runtime. Depend on gcompat on musl needed for imxgpu machines its needed since graphics driver is precompiled for glibc. Signed-off-by: Khem Raj --- recipes-graphics/cairo/cairo_%.bbappend | 2 +- recipes-graphics/xwayland/xwayland_%.bbappend | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/recipes-graphics/cairo/cairo_%.bbappend b/recipes-graphics/cairo/cairo_%.bbappend index 245adb591..c61e9a589 100644 --- a/recipes-graphics/cairo/cairo_%.bbappend +++ b/recipes-graphics/cairo/cairo_%.bbappend @@ -3,6 +3,6 @@ PACKAGECONFIG:remove:imxgpu3d = "opengl" # links with imx-gpu libs which are pre-built for glibc # gcompat will address it during runtime -LDFLAGS:append:imxgpu3d:libc-musl = " -Wl,--allow-shlib-undefined" LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" +RDEPENDS:${PN}:append:imxgpu:libc-musl = " gcompat" diff --git a/recipes-graphics/xwayland/xwayland_%.bbappend b/recipes-graphics/xwayland/xwayland_%.bbappend index 690631215..f2141f4f9 100644 --- a/recipes-graphics/xwayland/xwayland_%.bbappend +++ b/recipes-graphics/xwayland/xwayland_%.bbappend @@ -10,3 +10,10 @@ OPENGL_PKGCONFIGS_REMOVE_IMXGPU = "" OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx6-nxp-bsp = "glamor glx" OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx7-nxp-bsp = "glamor glx" OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx8-nxp-bsp = "glx" + + +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + +RDEPENDS:${PN}:append:imxgpu:libc-musl = " gcompat" -- cgit v1.2.3-54-g00ecf From 3159282461d2b251ad5d3f09d1ca0196d2b548c1 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 17 Sep 2022 10:09:49 -0700 Subject: harfbuzz: Fix build with musl on imxgpu machines Signed-off-by: Khem Raj --- recipes-graphics/harfbuzz/harfbuzz_%.bbappend | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 recipes-graphics/harfbuzz/harfbuzz_%.bbappend diff --git a/recipes-graphics/harfbuzz/harfbuzz_%.bbappend b/recipes-graphics/harfbuzz/harfbuzz_%.bbappend new file mode 100644 index 000000000..bf8c38fc3 --- /dev/null +++ b/recipes-graphics/harfbuzz/harfbuzz_%.bbappend @@ -0,0 +1,5 @@ +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + +RDEPENDS:${PN}:append:imxgpu:libc-musl = " gcompat" -- cgit v1.2.3-54-g00ecf From b193283531d05b436839cf66b0b5dca51c345d6d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 17 Sep 2022 11:26:23 -0700 Subject: pango: Fix build on musl on socs with imxgpu Signed-off-by: Khem Raj --- recipes-graphics/pango/pango_%.bbappend | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 recipes-graphics/pango/pango_%.bbappend diff --git a/recipes-graphics/pango/pango_%.bbappend b/recipes-graphics/pango/pango_%.bbappend new file mode 100644 index 000000000..bf8c38fc3 --- /dev/null +++ b/recipes-graphics/pango/pango_%.bbappend @@ -0,0 +1,5 @@ +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + +RDEPENDS:${PN}:append:imxgpu:libc-musl = " gcompat" -- cgit v1.2.3-54-g00ecf From 6a882207bccfad31d78b912006138bda79667615 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 17 Sep 2022 15:54:02 -0700 Subject: weston: Allow undefined symbols with musl These are glibc specific symbols which gcompat should be able to handle at runtime Signed-off-by: Khem Raj --- recipes-graphics/wayland/weston_10.0.0.imx.bb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes-graphics/wayland/weston_10.0.0.imx.bb b/recipes-graphics/wayland/weston_10.0.0.imx.bb index a9f6ec139..b9e8fca5b 100644 --- a/recipes-graphics/wayland/weston_10.0.0.imx.bb +++ b/recipes-graphics/wayland/weston_10.0.0.imx.bb @@ -202,6 +202,10 @@ EXTRA_OEMESON:append:imxfbdev = " -Dbackend-default=fbdev" EXTRA_OEMESON += "-Ddeprecated-wl-shell=true" +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + PACKAGE_ARCH = "${MACHINE_SOCARCH}" COMPATIBLE_MACHINE = "(imxfbdev|imxgpu)" -- cgit v1.2.3-54-g00ecf From 5eb46c66701552d66cfb16445a4d40244c97c96f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 17 Sep 2022 15:54:52 -0700 Subject: gstreamer1.0-plugins-base: Allow undefined symbols with musl These are glibc specific symbols which gcompat should be able to handle at runtime Signed-off-by: Khem Raj --- recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.20.0.imx.bb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.20.0.imx.bb b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.20.0.imx.bb index ba1b97872..3cbd21799 100644 --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.20.0.imx.bb +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.20.0.imx.bb @@ -137,6 +137,10 @@ PACKAGECONFIG[viv-fb] = ",,virtual/libgles2" EXTRA_OEMESON += "-Dc_args="${CFLAGS} -I${STAGING_INCDIR_IMX}"" +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + COMPATIBLE_MACHINE = "(imx-nxp-bsp)" ########### End of i.MX overrides ######### -- cgit v1.2.3-54-g00ecf From d91b6dac7dd7c0879b3a4a5f8f3abd82c33780b7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 17 Sep 2022 15:38:12 -0700 Subject: imx-gpu-viv: Insert libgcompat.so to DT_NEEDED section of libs These libs are pre-compiled for glibc therefore, on musl they will need redirecting via the gcompat stub to work at runtime. Signed-off-by: Khem Raj --- recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc b/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc index 4abab088a..48d3ad2bf 100644 --- a/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc +++ b/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc @@ -25,6 +25,8 @@ DEPENDS:append:mx8-nxp-bsp = " patchelf-native" # We depend on mesa to fill in what is missing. DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'mesa', '', d)}" +DEPENDS:append:libc-musl = " gcompat" + PROVIDES += " \ imx-gpu-viv \ libgal-imx \ @@ -244,6 +246,24 @@ do_install () { chown -R root:root "${D}" } +do_install:append:libc-musl() { + # libs + for f in `find ${D}${libdir} -name '*.so*' -type f` + do + patchelf --add-needed libgcompat.so.0 $f + done + # binaries + for f in `find ${D}/opt ${D}${bindir} -name '*' -type f -executable` + do + # prune scripts + if `patchelf --print-interpreter $f 2>&1 > /dev/null` + then + patchelf --set-interpreter ${root_prefix}`patchelf --print-interpreter $f` $f + patchelf --add-needed libgcompat.so.0 $f + fi + done +} + ALLOW_EMPTY:${PN} = "1" FILES:libclc-imx = "${libdir}/libCLC${SOLIBS} ${includedir}/CL/cl_viv_vx_ext.h" -- cgit v1.2.3-54-g00ecf