summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Protsenko <semen.protsenko@linaro.org>2018-07-26 22:14:24 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-07-26 22:14:24 -0700
commit1f9f7067094561bcd7c7709186c1bb4e7c132c59 (patch)
treefba5513f6f6d10f4bb454be98c59c95b09ee7a37
parent3df1710818f44d2a23bfd11ba02d0c1b169e7b70 (diff)
parent109240bdddde5d6cbf0d65150363b092d26cff5b (diff)
downloadppp-1f9f7067094561bcd7c7709186c1bb4e7c132c59.tar.gz
pppd: Enable plugin support in pppd am: c976b78220 am: 0634ee55dc
am: 109240bddd Change-Id: Ia9b74c3324fe23466fbccb38788b5e6133b63312
-rw-r--r--pppd/Android.mk4
-rw-r--r--pppd/pathnames.h16
2 files changed, 20 insertions, 0 deletions
diff --git a/pppd/Android.mk b/pppd/Android.mk
index 88cfe35..ba06198 100644
--- a/pppd/Android.mk
+++ b/pppd/Android.mk
@@ -41,6 +41,10 @@ LOCAL_CFLAGS := -DCHAPMS=1 -DMPPE=1 -DINET6=1 -DUSE_OPENSSL=1 -Wno-unused-parame
# Turn off warnings for now until this is fixed upstream. b/18632512
LOCAL_CFLAGS += -Wno-unused-variable
+# Enable plugin support
+LOCAL_CFLAGS += -DPLUGIN
+LOCAL_LDFLAGS := -ldl -rdynamic
+
LOCAL_MODULE:= pppd
include $(BUILD_EXECUTABLE)
diff --git a/pppd/pathnames.h b/pppd/pathnames.h
index a33f046..ea74736 100644
--- a/pppd/pathnames.h
+++ b/pppd/pathnames.h
@@ -56,10 +56,26 @@
#endif /* __STDC__ */
#ifdef PLUGIN
+#ifdef __ANDROID__
+
+/*
+ * In Android we can't load plugins from /system/lib{64}/pppd/, because
+ * Bionic loader only allows us to dlopen() libraries from /system/lib{64} root
+ * directory (as specified in ld.config.txt, see "default" linker namespace).
+ */
+#ifdef __LP64__
+#define _PATH_PLUGIN "/system/lib64"
+#else /* __LP64__ */
+#define _PATH_PLUGIN "/system/lib"
+#endif /* __LP64__ */
+
+#else /* __ANDROID__ */
+
#ifdef __STDC__
#define _PATH_PLUGIN DESTDIR "/lib/pppd/" VERSION
#else /* __STDC__ */
#define _PATH_PLUGIN "/usr/lib/pppd"
#endif /* __STDC__ */
+#endif /* __ANDROID__ */
#endif /* PLUGIN */