-
I'm trying to cross-compile a Slint application using the Linux backend and the Skia renderer. error: failed to run custom build command for `skia-bindings v0.78.2`
[...]
[8/1528] compile ../../../../../../../../../../../../home/igiona/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.78.2/skia/src/ports/SkFontConfigInterface.cpp
FAILED: obj/src/ports/fontmgr_FontConfigInterface.SkFontConfigInterface.o
clang++ -MD -MF obj/src/ports/fontmgr_FontConfigInterface.SkFontConfigInterface.o.d -DNDEBUG -DSK_CODEC_DECODES_BMP -DSK_CODEC_DECODES_WBMP -DSK_R32_SHIFT=16 -DSK_ENABLE_PRECOMPILE -DSK_GANESH -DSK_DISABLE_TRACING -DSK_USE_PERFETTO -DSK_GAMMA_APPLY_TO_A8 -DSK_ENABLE_AVX512_OPTS -DSKIA_IMPLEMENTATION=1 -DSK_TYPEFACE_FACTORY_FREETYPE -I../../../../../../../../../../../../home/igiona/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.78.2/skia -Wno-attributes -ffp-contract=off -fstrict-aliasing -fPIC -fvisibility=hidden -march=armv7-a -mfpu=neon -mthumb -O3 -fdata-sections -ffunction-sections -I=/usr/include/freetype2 -I/usr/include/freetype2 -O3 -I/usr/armv7-linux-gnueabihf/include/c++/7/armv7-linux-gnueabihf -I/usr/armv7-linux-gnueabihf/include --target=armv7-unknown-linux-gnueabihf -std=c++17 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -c ../../../../../../../../../../../../home/igiona/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.78.2/skia/src/ports/SkFontConfigInterface.cpp -o obj/src/ports/fontmgr_FontConfigInterface.SkFontConfigInterface.o
In file included from ../../../../../../../../../../../../home/igiona/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.78.2/skia/src/ports/SkFontConfigInterface.cpp:7:
In file included from ../../../../../../../../../../../../home/igiona/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.78.2/skia/include/ports/SkFontConfigInterface.h:11:
In file included from ../../../../../../../../../../../../home/igiona/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.78.2/skia/include/core/SkFontStyle.h:11:
In file included from ../../../../../../../../../../../../home/igiona/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.78.2/skia/include/core/SkTypes.h:21:
In file included from ../../../../../../../../../../../../home/igiona/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.78.2/skia/include/private/base/SkAssert.h:15:
/usr/lib/gcc-cross/arm-linux-gnueabihf/11/../../../../include/c++/11/cstddef:49:10: fatal error: 'bits/c++config.h' file not found
49 | #include <bits/c++config.h>
| ^~~~~~~~~~~~~~~~~~
1 error generated.
[...] This seems to me related to some kind of issues with sysroot or so. error: failed to run custom build command for `skia-bindings v0.78.2`
[...]
[1/1521] compile ../../../../../../../../../../../../home/igiona/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.78.2/skia/src/ports/SkFontConfigInterface.cpp
FAILED: obj/src/ports/fontmgr_FontConfigInterface.SkFontConfigInterface.o
arm-org-linux-gnueabi-g++ -march=armv7ve -mthumb -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/igiona/sdks/lcd_sdk2/sysroots/armv7vet2hf-neon-org-linux-gnueabi -MD -MF obj/src/ports/fontmgr_FontConfigInterface.SkFontConfigInterface.o.d -DNDEBUG -DSK_CODEC_DECODES_BMP -DSK_CODEC_DECODES_WBMP -DSK_R32_SHIFT=16 -DSK_ENABLE_PRECOMPILE -DSK_GANESH -DSK_DISABLE_TRACING -DSK_USE_PERFETTO -DSK_GAMMA_APPLY_TO_A8 -DSK_ENABLE_AVX512_OPTS -DSKIA_IMPLEMENTATION=1 -DSK_TYPEFACE_FACTORY_FREETYPE -I../../../../../../../../../../../../home/igiona/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.78.2/skia -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -march=armv7-a -mfpu=neon -mthumb -O3 -fdata-sections -ffunction-sections -I=/usr/include/freetype2 -I/usr/include/freetype2 --sysroot=/home/igiona/sdks/lcd_sdk2/sysroots/armv7vet2hf-neon-org-linux-gnueabi -O3 -I/usr/armv7-linux-gnueabihf/include/c++/7/armv7-linux-gnueabihf -I/usr/armv7-linux-gnueabihf/include --target=armv7-unknown-linux-gnueabihf -std=c++17 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -c ../../../../../../../../../../../../home/igiona/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.78.2/skia/src/ports/SkFontConfigInterface.cpp -o obj/src/ports/fontmgr_FontConfigInterface.SkFontConfigInterface.o
arm-org-linux-gnueabi-g++: error: unrecognized command-line option '--target=armv7-unknown-linux-gnueabihf'
[...] Any idea what could be wrong here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
There is some documentation of some env variables to set here: https://github.com/rust-skia/rust-skia/tree/master/skia-bindings#cross-compiling-for-linux |
Beta Was this translation helpful? Give feedback.
Ah, I think I realize what you might be missing.
The Skia build requires clang, and that clang needs to be entirely aware of your yocto target config and gcc library paths. Sometimes it works to use the host clang, but it's better to use meta-clang. Try this:
meta-clang
to your layers.From the environment of the resulting SDK, you'll have
CLANGCC
andCLANGCXX
set, the Skia build will pick them up automatically, and it ... should compile.