Closed AreaZR closed 8 months ago
@compnerd Can we please do a test?
Should we not have a fallback path here?
Should we not have a fallback path here?
are we not compiling with c11?
There is no guarantee that the libc is going to be complete (e.g. Windows). Yes, I know that there is a separate Windows path, but this is already a difficult library to port, lets not complicate it further.
Collaborator
Windows is literally the only libc with this issue. I just checked.
There is no guarantee that the libc is going to be complete (e.g. Windows). Yes, I know that there is a separate Windows path, but this is already a difficult library to port, lets not complicate it further.
That's literally the point of this PR. And let's not assume that the code already assumes you are compiling for C11, as there are C99 and C11 features in this codebase like 0 length arrays.
Also, the PR I did for swift literally only checks for windows, and then the STDC version, not a complete libc. I don't see why we would need to find the one libc that doesn't have this but somehow has posix_memalign
@swift-ci please test
@swift-ci please test Windows platform
FYI for anyone else running into this: this change makes libdispatch require a minimum Android SDK version of 28 (Android 9 Pie) as noted here, because earlier versions don’t have aligned_alloc
.
Building with an earlier minSdkVersion
results in this error:
Linking CXX shared library ../libdispatch.so
ld: error: undefined symbol: aligned_alloc
>>> referenced by io.c:2377
Is there any chance to add an Android target to CI to be able to spot things like this sooner?
Is there any chance to add an Android target to CI to be able to spot things like this sooner?
I will look into it. In the meantime, I have submitted a fallback, #811.
Thank you @finagolfin! 🙏
aligned_alloc is more cleaner and portable.