Dear SEAndroid developers
I want to print call stack when restorecon failed, so I modified libselinux
using libutils
- libselinux: external/libselinux
- libutils: system/core/libutils
I modified my source like it.
----------------------------------------------------------------------------------------
external/libselinux/Android.mk [modified source]
-LOCAL_SRC_FILES := $(common_SRC_FILES) $(common_HOST_FILES) src/android.c
+LOCAL_SRC_FILES := $(common_SRC_FILES) $(common_HOST_FILES) src/android.c
src/dump_stack.cpp
LOCAL_MODULE:= libselinux
LOCAL_MODULE_TAGS := eng
-LOCAL_STATIC_LIBRARIES := libmincrypt
+LOCAL_STATIC_LIBRARIES := libmincrypt libutils
external/libselinux/src/dump_stack.cpp [new file]
+#include <utils/CallStack.h>
+using namespace android;
+extern "C" void dump_stack_android(void)
+{
+ CallStack stack;
+ stack.update();
+// stack.dump();
+ }
----------------------------------------------------------------------------------------
The libselinux build succeeded, but the init(system/core/init) build failed.
----------------------------------------------------------------------------------------
target StaticExecutable: init
(my_project/target/product/my_project/obj/EXECUTABLES/init_intermediates/LINKED/init)
my_project/target/product/my_project/obj/STATIC_LIBRARIES/libselinux_intermediates/libselinux.a(dump_stack.o):
In function `dump_stack_android':
my_source/android/external/libselinux/src/dump_stack.cpp:5: undefined
reference to `android::CallStack::CallStack()'
my_source/android/external/libselinux/src/dump_stack.cpp:6: undefined
reference to `android::CallStack::update(int, int)'
my_source/android/external/libselinux/src/dump_stack.cpp:6: undefined
reference to `android::CallStack::~CallStack()'
collect2: error: ld returned 1 exit status
make: ***
[my_project/target/product/my_project/obj/EXECUTABLES/init_intermediates/LINKED/init]
Error 1
make: Leaving directory `my_project/android'
#### make failed to build some targets (19 seconds) ####
----------------------------------------------------------------------------------------
Is there any way to overcome this build error?
Thank you
Best regards
_______________________________________________
Seandroid-list mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to
[email protected].