Skip to content

Conversation

@FredeHoey
Copy link

GCC 15.2 doens't have uint8_t defined by default, so all files using it should include cstdint in C++ files or stdint.h in C files.

@martinetd
Copy link

GCC 15.2 doens't have uint8_t defined by default, so all files using it should include cstdint in C++ files or stdint.h in C files.

Hmm, this builds fine for me on fedora 43's gcc 15.2.1 -- what exactly are you building with, and what are you building?

(I do get deprecated warnings on std::wstring_convert that we'll need to look into sooner or later, but it does build all the way for me)

@FredeHoey
Copy link
Author

Hi @martinetd,

I'm building this for a yocto project on aarch64. I haven't tried building it for x86_64 though.

I've tested this patch using the following bitbake command in a project where meta-flutter is included.

bitbake flutter-x11-client flutter-drm-gbm-backend flutter-drm-eglstream-backend flutter-external-texture-plugin flutter-video-player-plugin flutter-wayland-so

There might be some of the includes that aren't necessary because cstdint is included indirectly, I just added the include to all source files that included uint8_t and didn't include #include <cstdint> or #include <stdint.h>.

Do you see any issues with merging this? I can check the code for redundant includes if you want.

I've also submitted this patch as a patch to the meta-flutter layer meta-flutter/meta-flutter#741.

@martinetd
Copy link

martinetd commented Feb 5, 2026

It's just that I don't like merging what I don't understand, I was about to ask if you already had 95f56d9 applied... but that's your patch, so I assume it wasn't enough 😅

In general extra includes add up to build time so I'd rather be precise about it if it's not too much effort, otherwise I guess this is fine, I'll try to reproduce without bitbake...

By the way, note by default flutter-embedded-linux builds with clang, not gcc, but I also have the latest 21.1.8 here, and I also tried cross compiling to aarch64, so I'm not quite sure what it could be.. (EDIT: and I did try kludging the CMakeLists.txt to build with gcc successfully as well :|)

@FredeHoey
Copy link
Author

FredeHoey commented Feb 5, 2026 via email

@martinetd
Copy link

True. Given that you cannot reproduce it, I'm actually more inclined to
include all of the additions, as someone making changes would probably
be able to compile successfully, and having this patch makes it
probably-less-likely-tm to break for others

While I'd tend to agree in general, I'm honestly not familiar enough with the project yet, so I really want to understand even if it's a bit slower -- thanks for putting up with me!

So yesterday I had "only" tried building all the backends and examples in the repo, so from the list of targets you gave it should have been the same.. but I went one step further and tried to just compile each file individually in a brute-force approach:

git ls-files | grep '\.[ch]$' | while read f; do echo $f; echo "#include <$f>" | clang++ -DDISPLAY_BACKEND_TYPE_X11 -DENABLE_EGL_ALPHA_COMPONENT_OF_COLOR_BUFFER -DENABLE_ELINUX_EMBEDDER_LOG -DFLUTTER_TARGET_BACKEND_X11 -DRAPIDJSON_HAS_CXX11_NOEXCEPT -DRAPIDJSON_HAS_CXX11_RANGE_FOR -DRAPIDJSON_HAS_CXX11_RVALUE_REFS -DRAPIDJSON_HAS_CXX11_TYPETRAITS -DRAPIDJSON_HAS_STDSTRING -DUSE_X11 -Isrc -Isrc/third_party -Isrc/third_party/rapidjson/include -I/usr/include/libdrm -Isrc/client_wrapper/include -Isrc/flutter/shell/platform/common/client_wrapper -Isrc/flutter/shell/platform/common/client_wrapper/include -Isrc/flutter/shell/platform/common/client_wrapper/include/flutter -Isrc/flutter/shell/platform/common/public -Isrc/flutter/shell/platform/linux_embedded/public -Iexamples/flutter-x11-client -std=gnu++17 -I/usr/include -xc++ -c -o /dev/null -I src/flutter/shell/platform/common/client_wrapper/include/ -I/usr/include/gstreamer-1.0  -Iexamples/flutter-external-texture-plugin/flutter/plugins/external_texture_test/elinux/include/ -Iexamples/flutter-video-player-plugin/flutter/plugins/video_player/elinux/include/ -Isrc/client_wrapper/include/ -Isrc/flutter/shell/platform/common/client_wrapper/include/ -Isrc/third_party/rapidjson/include/ -I src/client_wrapper/include/ -I ${f%*/} -I . -I /usr/include/glib-2.0/ -I/usr/lib64/glib-2.0/include/ -std=gnu++17 - || echo $f >> badlist; done

And this did turn half a dozen of errors, so I've pushed in your branch something that fixed them -- what do you think?

So I still don't understand your errors, but my guess is that meta-flutter either has patches or uses a slightly different tree that has includes in a different order or something? But either way it should no longer fail on our headers 😅

@martinetd martinetd force-pushed the master branch 2 times, most recently from 3f54966 to 0b256e4 Compare February 6, 2026 00:11
This allows compiling each individual file manually, so should fix any
problem with newer compilers.

Reported-by: Frede Hoey Braendstrup <frede@vokalo.io>
@FredeHoey
Copy link
Author

FredeHoey commented Feb 6, 2026 via email

@FredeHoey FredeHoey closed this Feb 6, 2026
@martinetd
Copy link

I should have investigated further before submitting a PR. Sorry for the noise.

No worry, glad this was figured out

I do think that your patch might be worthwhile to commit regardless as.

Yes, let's move forward with it -- I've reopened it as #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants