Skip to content

build: add gcc <9.1 and clang <9.0 compatibility#132

Merged
spnda merged 1 commit intospnda:mainfrom
AndreCostaaa:build-gcc8-compatibility
Jan 5, 2026
Merged

build: add gcc <9.1 and clang <9.0 compatibility#132
spnda merged 1 commit intospnda:mainfrom
AndreCostaaa:build-gcc8-compatibility

Conversation

@AndreCostaaa
Copy link
Contributor

Encountered a linking issue when using an old GCC version:

/home/andre/dev/lvgl/lv_port_linux/build/_deps/fastgltf-src/src/io.cpp:442: undefined reference to `std::filesystem::file_size(std::filesystem::__cxx11::path const&, std::error_code&)'
/opt/poky/3.1.33/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/8.3.0/real-ld: _deps/fastgltf-build/libfastgltf.a(io.cpp.o): in function `fastgltf::Parser::loadFileFromUri(fastgltf::URIView&) const':
/opt/poky/3.1.33/sysroots/aarch64-poky-linux/usr/include/c++/8.3.0/bits/fs_path.h:257: undefined reference to `std::filesystem::__cxx11::path::has_filename() const'
/opt/poky/3.1.33/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/8.3.0/real-ld: /opt/poky/3.1.33/sysroots/aarch64-poky-linux/usr/include/c++/8.3.0/bits/fs_path.h:260: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/poky/3.1.33/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/8.3.0/real-ld: /opt/poky/3.1.33/sysroots/aarch64-poky-linux/usr/include/c++/8.3.0/bits/fs_path.h:260: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/poky/3.1.33/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/8.3.0/real-ld: lvgl/lib/liblvgl.a(lv_gltf_data_injest.cpp.o): in function `create_data_from_bytes(unsigned char const*, unsigned long)':
/opt/poky/3.1.33/sysroots/aarch64-poky-linux/usr/include/c++/8.3.0/bits/fs_path.h:184: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
collect2: error: ld returned 1 exit status

cppreference mentions having to link with stdc++fs for GCC and c++fs for clang: https://en.cppreference.com/w/cpp/filesystem.html#Notes

@AndreCostaaa AndreCostaaa changed the title build: add gcc <9.0 compatibility build: add gcc <9.1 and clang <9.0 compatibility Jan 5, 2026
Copy link
Owner

@spnda spnda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is fair, however be mindful that #116 will break compatibility with anything below GCC 10 and LLVM 10.

This was one of the concerns I had with lvgl using fastgltf, since embedded has a major problem with outdated toolchains in my opinion and I don't want that dragging this library behind. I want to merge #116 for 0.10 which means that this change will only live in 0.9.x and will be removed again for the next version.

@spnda spnda merged commit f04052e into spnda:main Jan 5, 2026
23 checks passed
@AndreCostaaa AndreCostaaa deleted the build-gcc8-compatibility branch February 12, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants