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

Set USE_STD_C99=0 for libsparse in order to avoid build failure #187

Closed
wants to merge 1 commit into from

Conversation

RedL0tus
Copy link

Otherwise it will throw an error while compiling, not just for Android >= 8

Build log for a failed build: http://termbin.com/6i3r

Huge thanks to @zhxt

…ild failure

Otherwise it will throw an error while compiling, not just for Android >= 8

Huge thanks to @zhxt
@krnlyng
Copy link
Contributor

krnlyng commented Jul 20, 2018

Is this required for all adaptations? Android 4 - 7/8?

@RedL0tus
Copy link
Author

@krnlyng
Well... I'm not sure, but at leaset it's required for Android 7.
The problem is libsparse uses a GNU99 style typeof in its min macro, and it will cause it fail to compile if the compiler use standard C99.
https://github.com/mer-hybris/android_system_core/blob/hybris-10.1/libsparse/output_file.c#L59
And the min macro is the same from CM10.1 to 15.1.

The solution is to set USE_STD_C99=0 or rewrite that macro. I saw someone said he rewrote that macro but he didn't pushed it to anywhere, so...

@krnlyng
Copy link
Contributor

krnlyng commented Jul 23, 2018

@RedL0tus well currently the USE_STD_C99 was used for android < 8. But the patch you made still has the same detection for USE_STD_C99 and it then unconditionally overwrites it which is a bit weird.
I think the problem is that we had to switch the compiler to g++ for android 8.
In my opinion the best thing is to either, get rid of the whole USE_STD_C99 code, or if that is not possible (due to android code?) then when USE_STD_C99 is set, also use gcc instead of g++.

@RedL0tus
Copy link
Author

@krnlyng Oh... I'm afraid that I cannot help on that since I'm not familiar with C/C++. I will close this PR and open an issue instead (since it is still a problem that will cause build failure).

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.

None yet

2 participants