Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 886472

Summary: >=x11-libs/cairo-1.17.6[X] cross-compile fails: ERROR: Can not run test applications in this cross environment
Product: Gentoo Linux Reporter: tt_1 <herrtimson>
Component: Current packagesAssignee: Gentoo X packagers <x11>
Status: UNCONFIRMED ---    
Severity: normal CC: cross, gentoo, jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://gitlab.freedesktop.org/cairo/cairo/-/issues/613
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build log from aarch64-cross
meson log
emerge --info from host
output from emerge --info (aarch64)
simple patch to fix cross-compile

Description tt_1 2022-12-17 09:16:26 UTC
Created attachment 843201 [details]
build log from aarch64-cross

attempting to cross-compile x11-libs/cairo-1.17.6: 

Run-time dependency zlib found: YES 1.2.13
Run-time dependency libpng found: YES 1.6.38
Run-time dependency fontconfig found: YES 2.14.0
Run-time dependency freetype2 found: YES 24.3.18
Checking if "FT has color" with dependency freetype2: links: YES 
Run-time dependency x11 found: YES 1.8.1
Run-time dependency xext found: YES 1.3.5

../cairo-1.17.6/meson.build:375:4: ERROR: Can not run test applications in this cross environment.

system is running meson-0.63.3

build log is attached
Comment 1 tt_1 2022-12-17 09:16:54 UTC
Created attachment 843202 [details]
meson log
Comment 2 tt_1 2022-12-17 09:17:12 UTC
Created attachment 843209 [details]
emerge --info from host
Comment 3 tt_1 2022-12-17 09:17:46 UTC
Created attachment 843210 [details]
output from emerge --info (aarch64)
Comment 4 tt_1 2022-12-17 09:18:45 UTC
I see this error in the meson log: 

Compiler stderr:
 /var/tmp/portage/portage/x11-libs/cairo-1.17.6/work/cairo-1.17.6-.arm64/meson-private/tmpnwsy540f/testfile.cpp: In function 'int main()':
/var/tmp/portage/portage/x11-libs/cairo-1.17.6/work/cairo-1.17.6-.arm64/meson-private/tmpnwsy540f/testfile.cpp:3:65: error: narrowing conversion of '-1' from 'int' to 'long unsigned int' [-Wnarrowing]
    3 |         int main(void) { static int a[1-2*!(sizeof(void *) > 15)]; a[0]=0; return 0; }
      |                                                                 ^
/var/tmp/portage/portage/x11-libs/cairo-1.17.6/work/cairo-1.17.6-.arm64/meson-private/tmpnwsy540f/testfile.cpp:3:40: error: size '-1' of array 'a' is negative
    3 |         int main(void) { static int a[1-2*!(sizeof(void *) > 15)]; a[0]=0; return 0; }
Comment 5 tt_1 2022-12-22 12:29:54 UTC
I forgot to provide the output of emerge -pv x11-libs/cairo

[ebuild     U  ] x11-libs/cairo-1.17.6::gentoo [1.16.0-r6::gentoo] to /usr/armv7a-unknown-linux-gnueabihf/ USE="X glib (-aqua) (-debug) (-gles2-only) -gles3% -gtk-doc% -opengl -test% (-static-libs%) (-svg%*) (-utils%) (-valgrind%)" 0 KiB


the configure is broken with using X, if USE="-X" is provided, it passes
Comment 6 tt_1 2022-12-22 15:46:16 UTC
Created attachment 844749 [details, diff]
simple patch to fix cross-compile

simple hack to workaround, it does compile now

I've opened an upstream patch, maybe there will be a proper solution soon.