Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 779871 - >=x11-libs/gtk+-3.24.24-r1 fails to cross compile with error: /usr/aarch64-unknown-linux-gnu/usr/bin/glib-compile-resources: cannot execute binary file
Summary: >=x11-libs/gtk+-3.24.24-r1 fails to cross compile with error: /usr/aarch64-un...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Cross compilation support
URL: https://gitlab.gnome.org/GNOME/gtk/-/...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-04-03 12:00 UTC by tt_1
Modified: 2023-02-22 06:54 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
compressed build log (gtk+-3.24.26-failed-cross.log,29.11 KB, text/x-log)
2021-04-03 12:00 UTC, tt_1
Details
build.log for aarch64 target and x86_64 host (aarch-gtk-build.log,28.24 KB, text/plain)
2023-01-01 00:19 UTC, tgyt
Details
aarch64-unknown-linux-gnu-emerge --info (aarch.txt,6.56 KB, text/plain)
2023-01-01 00:20 UTC, tgyt
Details
gtk and gnome2-utils patch (gtk+-3.patch,1.10 KB, patch)
2023-02-02 15:16 UTC, tgyt
Details | Diff
gtk and gnome2-utils patch r2 (gtk+-3.patch,1.48 KB, patch)
2023-02-02 15:41 UTC, tgyt
Details | Diff
gtk+.patch (gtk+.patch,879 bytes, patch)
2023-02-15 10:51 UTC, tgyt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2021-04-03 12:00:30 UTC
Created attachment 697011 [details]
compressed build log

x11-libs/gtk+:3 fails to cross compile to with amd64 host and arm64 target as follows:

&& echo timestamp > gdk/stamp-gc-h
/usr/aarch64-unknown-linux-gnu/usr/bin/glib-compile-resources gdk.gresource.xml --target=gdkresources.h \
	--sourcedir=/var/tmp/portage/portage/x11-libs/gtk+-3.24.26/work/gtk+-3.24.26/gdk --c-name _gdk --generate-header --manual-register --internal
/usr/aarch64-unknown-linux-gnu/usr/bin/glib-compile-resources gdk.gresource.xml --target=gdkresources.c \
	--sourcedir=/var/tmp/portage/portage/x11-libs/gtk+-3.24.26/work/gtk+-3.24.26/gdk --c-name _gdk --generate-source --manual-register --internal
/usr/aarch64-unknown-linux-gnu/usr/bin/glib-compile-resources: /usr/aarch64-unknown-linux-gnu/usr/bin/glib-compile-resources: cannot execute binary file
make[2]: *** [Makefile:2243: gdkresources.h] Error 126
make[2]: *** Waiting for unfinished jobs....

it seems as if the build is confused about where the cross compile prefix is and where $EROOT is, since it tries to execute foreign binary on the host. 

this can be worked around with removing the binary from the prefix, and symlinking the hosts /usr/bin/glib-compile-resources instead into the prefix. 

maybe gtk+ should check for /usr/bin/glib-compile-resources as it already does for /usr/bin/glib-compile-schemas with success
Comment 1 tt_1 2021-08-07 15:16:57 UTC
I've hit this again today, when I rebootstraped my armv7a rootfs *after* swapping dev-util/pkgconfig for dev-util/pkgconf

the aarch64 rootfs always did have dev-util/pkgconf over the older dev-util/pkgconfig
Comment 2 tt_1 2021-11-09 10:40:40 UTC
it also seeks those from host:

/usr/bin/glib-genmarshal
/usr/bin/glib-mkenums
Comment 3 tgyt 2022-01-04 00:21:07 UTC
AARCH cross-compilation, x64 host, same
Comment 4 tt_1 2022-01-04 00:23:37 UTC
you can symlink to workaround
Comment 5 tgyt 2023-01-01 00:19:55 UTC
Created attachment 846318 [details]
build.log for aarch64 target and x86_64 host

gtk+-3.24.34 and bug is still here
Comment 6 tgyt 2023-01-01 00:20:22 UTC
Created attachment 846320 [details]
aarch64-unknown-linux-gnu-emerge --info
Comment 7 tgyt 2023-01-06 02:02:06 UTC
dev-libs/glib should be added to BDEPENDS because glib-compile-resources is used at build time.
Comment 8 tt_1 2023-01-07 08:32:47 UTC
true, but you still have to symlink, don't you?
Comment 9 tgyt 2023-02-02 15:16:33 UTC
Created attachment 849718 [details, diff]
gtk and gnome2-utils patch
Comment 10 tgyt 2023-02-02 15:41:29 UTC
Created attachment 849720 [details, diff]
gtk and gnome2-utils patch r2
Comment 11 tgyt 2023-02-02 15:43:12 UTC
Comment on attachment 849720 [details, diff]
gtk and gnome2-utils patch r2

>--- eclass/gnome2-utils.eclass	2022-03-24 07:26:01.000000000 +0300
>+++ eclass/gnome2-utils.eclass	2023-02-02 18:40:03.037286456 +0300
>@@ -43,8 +43,12 @@
> # Path to scrollkeeper-update
> : ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
> 
>+# @ECLASS_VARIABLE: GLIB_COMPILE_RESOURCES
>+# @DESCRIPTION:
>+# Path to glib-compile-resources
>+: ${GLIB_COMPILE_RESOURCES:="/usr/bin/glib-compile-resources"}
>+
> # @ECLASS_VARIABLE: GLIB_COMPILE_SCHEMAS
>-# @INTERNAL
> # @DESCRIPTION:
> # Path to glib-compile-schemas
> : ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"}
>--- x11-libs/gtk+/gtk+-3.24.35.ebuild	2022-12-22 14:40:40.000000000 +0300
>+++ x11-libs/gtk+/gtk+-3.24.35.ebuild	2023-02-02 18:38:24.408290811 +0300
>@@ -78,6 +78,7 @@
> 	vim-syntax? ( app-vim/gtk-syntax )
> "
> BDEPEND="
>+	dev-libs/glib:2
> 	app-text/docbook-xml-dtd:4.1.2
> 	app-text/docbook-xsl-stylesheets
> 	dev-libs/gobject-introspection-common
>@@ -173,7 +174,7 @@
> 		)
> 	fi;
> 
>-	ECONF_SOURCE=${S} gnome2_src_configure "${myconf[@]}"
>+	ECONF_SOURCE=${S} GLIB_COMPILE_RESOURCES="${BROOT}${GLIB_COMPILE_RESOURCES}" gnome2_src_configure "${myconf[@]}"
> 
> 	# work-around gtk-doc out-of-source brokedness
> 	if multilib_is_native_abi; then
>@@ -185,7 +186,7 @@
> }
> 
> multilib_src_test() {
>-	"${EROOT}${GLIB_COMPILE_SCHEMAS}" --allow-any-name "${S}/gtk" || die
>+	"${BROOT}${GLIB_COMPILE_SCHEMAS}" --allow-any-name "${S}/gtk" || die
> 	GSETTINGS_SCHEMA_DIR="${S}/gtk" virtx emake check
> }
>
Comment 12 Larry the Git Cow gentoo-dev 2023-02-13 14:01:28 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6022aa7ab8b1d4f20ecd67941f848e2505a0cf26

commit 6022aa7ab8b1d4f20ecd67941f848e2505a0cf26
Author:     uis <uis9936@gmail.com>
AuthorDate: 2023-02-13 13:59:48 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2023-02-13 14:01:20 +0000

    gnome2-utils.eclass: Document GLIB_COMPILE_RESOURCES
    
    Also removed @INTERNAL for GLIB_COMPILE_SCHEMAS because it is already
    used outside of gnome2-utils.
    
    Bug: https://bugs.gentoo.org/779871
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 eclass/gnome2-utils.eclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Comment 13 tgyt 2023-02-15 10:51:29 UTC
Created attachment 851244 [details, diff]
gtk+.patch

Signed-off-by: uis <uis9936@gmail.com>
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-22 06:54:29 UTC
(In reply to tgyt from comment #13)
> Created attachment 851244 [details, diff] [details, diff]
> gtk+.patch
> 
> Signed-off-by: uis <uis9936@gmail.com>

Can you rebase this on .36 please?