New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing feature detection for glibc calls #17002
Comments
Same goes for htobe16, etc., which appeared in glibc 2.9. |
When building Android (which we have to do to get an Android WebView based on Dartium), things built for the host Linux machine rather than the Android device, like gen_snapshot, etc.) are built with a custom toolchain in the Android tree based on glibc 2.7. I'm not sure what the reasoning behind that is, or how difficult it would be to change, only that this causes the Dartium Android WebView build to fail. |
This sounds very odd to me. It works against the purpose of splitting out to *_linux and *_android. Things build for host should be build using the default host toolchain. Is this something I can help look into? |
I agree it is odd, and I agree that things built for host should use the host toolchain, but unfortunately to be part of an Android build, things we build for host for Dart will need to be built by a Linux toolchain based on an old glibc. So, I think it's not so much a *_linux vs. *_android distinction in Dart, as it is that some of our *_linux implementations are not compatible with older glibc. The changes needed should be fairly minor. Maybe I'll just draw up a CL and send it out. |
By "The changes needed should be fairly minor." do you mean that you are just going to stub out the APIs which are not present, and then we cross our fingers that they are not needed for the snapshot generation running on the host? |
That is a really good point. The eventhandler should not be needed at all for snapshots, so maybe we should move that into io_builtins? And I agree with you Zach, it is indeed an old-glibc issue. |
That's what I'll do for the timerfd calls in eventhandler_linux.cc. For file_system_watcher_linux.cc maybe we should just get rid of inotify_init1 like we already did in the Android implementation? For htobe16 etc. my plan is to include the macro definitions we need if the glibc version is < 2.9. These changes are sufficient for Dartium WebView to build and run successfully in the Android tree. |
Zach, we no longer compile the io part for host. Is this sufficient for you?
|
In runtime/platform/utils_linux.h we use some macros (htobe16, etc.) that don't appear until glibc 2.9. I need to check whether they are still a problem. |
Yes, it appears that the functions in platform/utils_linux.h are used by lib/typed_data.cc, which we probably can't avoid. However, I'm not sure we're really going to be trying to maintain this build configuration. I'm going to mark this issue as Waiting until we figure that out. I'll also remove Area-IO since that part is sorted out, now. cc @iposva-google. |
@zanderso is this something we are looking at? maybe we should close this issue. |
I think this is stale. |
eventhandler_linux.cc uses sys/timerfd.h which wasn't added until glibc 2.8, and file_system_watcher_linux.cc uses inotify_init1, which wasn't added until glibc 2.9. Before using these features, features.h should be #included. Then you can check the preprocessor defines GLIBC and GLIBC_MINOR. The code already in the _android.cc implementations should be safe.
This is needed when building for host during an Android build using the toolchain included in the AOSP tree (e.g. for snapshot generation), which uses glibc 2.7 headers.
The text was updated successfully, but these errors were encountered: