-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: add openharmony header #22109
base: master
Are you sure you want to change the base?
feat: add openharmony header #22109
Conversation
So the idea is to use the original musl headers for cases where they are semantically identical to the OpenHarmony ones anyway? Good idea, I like it. A few thoughts:
|
According to https://github.com/ziglang/zig/blob/master/src/musl.zig#L461 , it seems that when the musl is built, the original musl header file will be searched first.
|
Note that this code is for building static musl artifacts. Since, as we discussed previously, we will only support dynamic linking for OpenHarmony, this code only matters for building For the include paths that are exposed to user code, see: Lines 169 to 214 in aa7d138
In both code paths, we will need to check for
Ah, ok. That's pretty silly, but not easy to fix without hacky special cases in the script. |
In any case, I suggest getting rid of all that |
eb0bb8b
to
9a129e9
Compare
Removed. |
I'm not sure if changing the field name will have any impact on the system or code. So I'm going to keep the difference. |
This is a new PR #20020, which adds OpenHarmony header files for use with zig cc. Following the suggestions from PR #20020 and #21809, this PR only includes the logic for generating header files, while the remaining adaptation logic will be handled in other PRs.
cc @alexrp
Diff logic:
i. Put musl/include
ii. Put musl/arch/generic
iii. Put musl/arch/$arch
i. If the file exists, read the file and remove the comments and spaces and lines
ii. Calculate the hash of the file content and check if the hash is the same
iii. If the hash is the same, we can reduce the size
iv. If the hash is different, we should save the content
i. If the hit count is greater than 1, save the content to the generic-ohos dir
ii. If the hit count is equal to 1, save the content to the target dir