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

Android ARM compile #8

Open
zz77 opened this issue Sep 7, 2018 · 1 comment
Open

Android ARM compile #8

zz77 opened this issue Sep 7, 2018 · 1 comment

Comments

@zz77
Copy link

zz77 commented Sep 7, 2018

Hello.

I'm trying to cross-compile microsocks for android 5.1.1 with arm-linux-musleabi-gcc (from musl-cross-make). Compile is okay, but have issues with execute on my device.

Firstly i got error:
error: only position independent executables (PIE) are supported.

And i added

CFLAGS += -fPIE
LDFLAGS += -Wl,--dynamic-linker=/system/bin/linker -fPIE -pie

to make parametres.

After this changes and re-compiled i got another error on device:

WARNING: linker: Unsupported flags DT_FLAGS_1=0x8000000
WARNING: linker: ./microsocks has text relocations. This is wasting memory and prevents security hardening. Please fix.
CANNOT LINK EXECUTABLE: cannot locate symbol "__errno_location" referenced by "./microsocks"...

And now i dont know what to do.
Can you help me with it? Please

Also i want to compile all dynamic libraries to binary, i dont know how to do it too...
Sorry my english is bad, and i just only learning now about sources and compile, googled not give me any success. Thanks you for any help.

@rofl0r
Copy link
Owner

rofl0r commented Sep 7, 2018

it seems your toolchain targets a different android or even libc version. i'd suggest you use musl-cross-make and compile a static binary.
(hint add -static to your LDFLAGS, that may even work with the existing toolchain)

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