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

NDK build problem #1

Open
hsucw opened this issue Apr 9, 2016 · 3 comments
Open

NDK build problem #1

hsucw opened this issue Apr 9, 2016 · 3 comments

Comments

@hsucw
Copy link

hsucw commented Apr 9, 2016

On OS X, I try to build the libProbeDroid.so
Everything is fine until the linker get error

[x86] Compile : ProbeDroid <= debug.c ... [x86] Compile++ : ProbeDroid <= org_probedroid_instrument.cc [x86] SharedLibrary : libProbeDroid.so /IGNORED_PATH/../../../../i686-linux-android/bin/ld: warning: shared library text segment is not shareable /IGNORED_PATH/i686-linux-android/bin/ld: error: treating warnings as errors collect2: error: ld returned 1 exit status make: *** [/..../ProbeDroid/engine/obj/local/x86/libProbeDroid.so] Error 1

Some one suggested that adding
LOCAL_LDFLAGS := --no-warn-shared-textrel

However, it is not helpful under my environment. I am using ndk-r11, and get the following message

[x86] SharedLibrary : libProbeDroid.so i686-linux-android-g++: error: unrecognized command line option '--no-warn-shared-textrel' make: *** [/.../ProbeDroid/engine/obj/local/x86/libProbeDroid.so] Error 1

Should the compile flag add -fPIC ? or any idea?

@ZSShen
Copy link
Owner

ZSShen commented Apr 9, 2016

Appreciate for the bug report !

Could you patch the compilation flag:

LOCAL_LDFLAGS += -fPIC

in /engine/Android.mk and try again?

In my environment, it can work with the added flag.

If it also works in your machine, a patch is welcome!

@hsucw hsucw changed the title NDL build problem NDK build problem Apr 9, 2016
@ZSShen
Copy link
Owner

ZSShen commented Apr 16, 2016

If the previous configuration does not work,

could you switch to this flag and try again?

LOCAL_DISABLE_FATAL_LINKER_WARNINGS = true

@ZSShen
Copy link
Owner

ZSShen commented Apr 21, 2016

Currently the assembly code in engine/arch/x86 is not written as "Position Independent" style.

Though we can turn off the warning with some aggressive flags, it is still not a super good solution.

I start to rewrite the assembly. The issue should be solved in these days.

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

2 participants