| 1 | |
| 2 | # Android use Bionic for libc, and this does not have |
| 3 | # - pthread barriers |
| 4 | # - pthread_[gs]etaffinity |
| 5 | # |
| 6 | # This is all handled by bionic.h based on flags we set here. |
| 7 | |
| 8 | # Typically see something like "aarch64-linux-android". However, in some |
| 9 | # buildsystems, it will be a variation of -androidabe. |
| 10 | ost=$(findstring android, $(ostype)) |
| 11 | ifeq (android,$(ost)) |
| 12 | USE_BIONIC := 1 |
| 13 | CFLAGS += -DPTHREAD_BIONIC |
| 14 | |
| 15 | LDFLAGS += -pie |
| 16 | # -lrt and -lpthread is in standard bionic library, no standalone library |
| 17 | LIBS := $(filter-out -lrt,$(LIBS)) |
| 18 | LIBS := $(filter-out -lpthread,$(LIBS)) |
| 19 | |
| 20 | # Currently, only these binaries will compile and link properly for android |
| 21 | # - cyclictest |
| 22 | # - hackbench |
| 23 | sources := cyclictest.c hackbench.c |
| 24 | endif |