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

Compile inline with AOSP n preview #51

Closed
ikalkov opened this issue Aug 15, 2016 · 9 comments
Closed

Compile inline with AOSP n preview #51

ikalkov opened this issue Aug 15, 2016 · 9 comments

Comments

@ikalkov
Copy link

ikalkov commented Aug 15, 2016

Can we extract those nested methods to allow compilation inline with AOSP?

external/Superuser/Superuser/jni/su/daemon.c:506:69: error: function definition is not allowed here
auto void cb(void *arg, int uid, const char *src, const char *dst) {

external/Superuser/Superuser/jni/su/daemon.c:545:15: error: use of undeclared identifier 'cb'
bind_foreach(cb, NULL);

external/Superuser/Superuser/jni/su/daemon.c:549:53: error: function definition is not allowed here
auto void cb(void *arg, int uid, const char *path) {

external/Superuser/Superuser/jni/su/daemon.c:566:15: error: use of undeclared identifier 'cb'
init_foreach(cb, NULL);

@phhusson
Copy link
Owner

Isn't it just of setting cflags properly?

Le 15 août 2016 23:50, "Igor Kalkov" notifications@github.com a écrit :

Can we extract those nested methods to allow compilation inline with AOSP?

external/Superuser/Superuser/jni/su/daemon.c:506:69: error: function
definition is not allowed here
auto void cb(void *arg, int uid, const char *src, const char *dst) {

external/Superuser/Superuser/jni/su/daemon.c:545:15: error: use of
undeclared identifier 'cb'
bind_foreach(cb, NULL);

external/Superuser/Superuser/jni/su/daemon.c:549:53: error: function
definition is not allowed here
auto void cb(void *arg, int uid, const char *path) {

external/Superuser/Superuser/jni/su/daemon.c:566:15: error: use of
undeclared identifier 'cb'
init_foreach(cb, NULL);


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#51, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAOOhpDlJqpA86uRIwzVuE94X5vaxyYks5qgN8KgaJpZM4JkzqU
.

@ikalkov
Copy link
Author

ikalkov commented Aug 16, 2016

To be honest, I have no idea :)
Do you have a suggestion how it should be changed? I'd be happy to test it.

Until now I was using the original repo from koush. But as it seems pretty abandoned, I'd like to switch to something else for my AOSP N preview 5.

@ikalkov
Copy link
Author

ikalkov commented Aug 19, 2016

I've just tried this:

LOCAL_CFLAGS += -fnested-functions -z execstack -Wa,--execstack

in Superuser/jni/Android.mk, but I'm keep getting the same error message. Flags are taken from here:
http://stackoverflow.com/questions/10577613/nested-functions-on-android-ndk

@kelvinji2009
Copy link

@ikalkov Did you figure out how to fix this? I saw the same error. Thanks.

@ikalkov
Copy link
Author

ikalkov commented Oct 27, 2016

@kelvinji2009 No, but I've just found this commit: airend@3236a1c
I'll check it in the next days.

@kelvinji2009
Copy link

@ikalkov Thanks for your reply. The commit is just for application build but not for su binary build(ndk-build).
My dev-env:
OSX-10.11.6
NDK-r13(the latest version)

@ikalkov
Copy link
Author

ikalkov commented Oct 28, 2016

@kelvinji2009 I didn't test it myself yet, but the commit message is clearly about nested functions in the su binary:

Clang doesn't like nested functions, so use GCC temporarily, until
su code is fixed.

There is also a change in the Android.mk file for the su module:

  LOCAL_MODULE := su
 +LOCAL_CLANG := false

@kelvinji2009
Copy link

@ikalkov Yes, i have noticed it.And i have tried to modify the Superuser/jni/Android.mk as below

LOCAL_CLANG := false

But it does not work for me.

@ikalkov
Copy link
Author

ikalkov commented May 22, 2017

Hmm, there are other issues similar to this one, so I'll close it for now.

@ikalkov ikalkov closed this as completed May 22, 2017
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

No branches or pull requests

3 participants