Makefile: Link to the system logging library on Android
authorDanny Lin <danny@kdrag0n.dev>
Mon, 21 Oct 2019 01:43:08 +0000 (18:43 -0700)
committerDanny Lin <danny@kdrag0n.dev>
Mon, 21 Oct 2019 01:49:42 +0000 (18:49 -0700)
Android replaces syslog calls with calls to the Android system logging
library, liblog. Link to liblog when compiling for Android to fix the
following undefined reference errors:

aarch64-linux-android-ld: log.o: in function `android_polyfill_vsyslog':
/usr/include/syslog.h:185: undefined reference to `__android_log_print'
aarch64-linux-android-ld: /usr/include/syslog.h:182: undefined reference to `__android_log_vprint'

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Makefile

index 7c21ef8316f78d96021c9615ad8092d78c03e246..7aab6abd3231a04ab685aba581b2b8d765425c64 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -170,7 +170,7 @@ endif
 ifeq ($(CONFIG_TARGET_OS), Android)
   SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c profiles/tiobench.c \
                oslib/linux-dev-lookup.c
 ifeq ($(CONFIG_TARGET_OS), Android)
   SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c profiles/tiobench.c \
                oslib/linux-dev-lookup.c
-  LIBS += -ldl
+  LIBS += -ldl -llog
   LDFLAGS += -rdynamic
 endif
 ifeq ($(CONFIG_TARGET_OS), SunOS)
   LDFLAGS += -rdynamic
 endif
 ifeq ($(CONFIG_TARGET_OS), SunOS)