Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Broken for Android >5.0 #4

Open
protist opened this issue May 26, 2020 · 2 comments
Open

Broken for Android >5.0 #4

protist opened this issue May 26, 2020 · 2 comments

Comments

@protist
Copy link

protist commented May 26, 2020

Looks like this project is dead, but for others, this is currently broken for Android >5.0

# /data/local/ntpclient -c 1 -d -h pool.ntp.org -s                                                                                                                                                       
"/data/local/ntpclient": error: Android 5.0 and later only support position-independent executables (-fPIE).

I tried naively messing around with the flags in Makefile, changing the two instances of -fPIC to -fPIE, but the same error persisted.

@benv2k6
Copy link

benv2k6 commented Apr 15, 2022

If you want to run ntpclient from adb, you can build it with musl (https://musl.cc/). Creating statically compiled binary to run on aarch64 (without using the ndk)

export MUSL=$path to aarch64-linux-musl-cross
LDFLAGS="-static -static-pie -static-libgcc -Wl,-static" CFLAGS="-static" CC=$MUSL/bin/aarch64-linux-musl-gcc make -j

And by that I mean using the original package (no need for special android fork) http://doolittle.icarus.com/ntpclient/

@wlach
Copy link
Owner

wlach commented Apr 15, 2022

Thanks @benv2k6. I'm going to mark this project as archived to hopefully make it more clear this is no longer a needed thing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants