Skip to content
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

Closed
zanderso opened this issue Feb 20, 2014 · 13 comments
Closed

Missing feature detection for glibc calls #17002

zanderso opened this issue Feb 20, 2014 · 13 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant status-blocked Blocked from making progress by another (referenced) issue type-enhancement A request for a change that isn't a bug

Comments

@zanderso
Copy link
Member

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.

@zanderso
Copy link
Member Author

Same goes for htobe16, etc., which appeared in glibc 2.9.

@andersjohnsen
Copy link

So, just to be sure what's going on.

What is the host? A Android device? In such case, it should not use *_linux but *_android as well.

Or are you using the toolchain to build for the host on a linux box? That should not be the case.

Cheers,

@zanderso
Copy link
Member Author

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.

@andersjohnsen
Copy link

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?

@zanderso
Copy link
Member Author

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.

@sgjesse
Copy link
Contributor

sgjesse commented Feb 21, 2014

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?

@andersjohnsen
Copy link

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.

@zanderso
Copy link
Member Author

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.

@andersjohnsen
Copy link

Zach, we no longer compile the io part for host. Is this sufficient for you?

  • Anders

@zanderso
Copy link
Member Author

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.

@zanderso
Copy link
Member Author

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.
Removed Type-Defect, Area-IO labels.
Added Type-Enhancement, Area-VM, Waiting labels.

@zanderso zanderso added Type-Enhancement area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. labels Mar 14, 2014
@zanderso zanderso self-assigned this Mar 14, 2014
@kevmoo kevmoo added status-blocked Blocked from making progress by another (referenced) issue and removed waiting labels Feb 8, 2016
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Feb 29, 2016
@mraleph
Copy link
Member

mraleph commented Mar 6, 2018

@zanderso is this something we are looking at? maybe we should close this issue.

@zanderso
Copy link
Member Author

zanderso commented Mar 8, 2018

I think this is stale.

@zanderso zanderso added the closed-obsolete Closed as the reported issue is no longer relevant label Mar 8, 2018
@zanderso zanderso closed this as completed Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant status-blocked Blocked from making progress by another (referenced) issue type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants