Merge ~vicamo/libhybris/+git/libhybris:for-ubuntu/dont-use-jb-linker-on-arm64-anyway into ~libhybris-maintainers/libhybris/+git/libhybris:master

Proposed by You-Sheng Yang
Status: Merged
Merged at revision: 2fc8b56d984ceffd29ef3289f0a815d41e90dd83
Proposed branch: ~vicamo/libhybris/+git/libhybris:for-ubuntu/dont-use-jb-linker-on-arm64-anyway
Merge into: ~libhybris-maintainers/libhybris/+git/libhybris:master
Diff against target: 216 lines (+36/-15)
14 files modified
hybris/camera/camera.c (+1/-1)
hybris/common/Makefile.am (+6/-0)
hybris/common/hooks.c (+14/-3)
hybris/configure.ac (+5/-1)
hybris/egl/platforms/null/eglplatform_null.c (+1/-1)
hybris/glesv1/glesv1_cm.c (+1/-1)
hybris/input/is.c (+1/-1)
hybris/libnfc_ndef_nxp/libnfc_ndef_nxp.c (+1/-1)
hybris/libnfc_nxp/libnfc_nxp.c (+1/-1)
hybris/media/media.c (+1/-1)
hybris/sf/sf.c (+1/-1)
hybris/ui/ui.c (+1/-1)
hybris/vibrator/vibrator.c (+1/-1)
hybris/wifi/wifi.c (+1/-1)
Reviewer Review Type Date Requested Status
Simon Fels Needs Fixing
Review via email: mp+301894@code.launchpad.net

Description of the change

linker: disable linker probing when unavailable

On arm64 we don't have jb linker, so always probing only those available.

To post a comment you must log in.
Revision history for this message
You-Sheng Yang (vicamo) wrote :

This avoid "ERROR: Failed to load hybris linker for Android SDK version 19" when somehow the property system goes wrong on arm64 xenial.

Revision history for this message
You-Sheng Yang (vicamo) :
Revision history for this message
You-Sheng Yang (vicamo) wrote :

[push f7dc8df] fix the typo.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

[push 8721faf] fix also "Loading module: 'libubuntu_application_api_touch_mirclient.so.3.0.0'
"/android/system/lib/libubuntu_application_api.so" is 32-bit instead of 64-bit"

Revision history for this message
Simon Fels (morphis) wrote :

One comment inline otherwise LGTM

review: Needs Fixing
Revision history for this message
You-Sheng Yang (vicamo) wrote :

[push 079fdc5] address previous comment.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/hybris/camera/camera.c b/hybris/camera/camera.c
2index 710cdfb..f51f70b 100644
3--- a/hybris/camera/camera.c
4+++ b/hybris/camera/camera.c
5@@ -26,7 +26,7 @@
6 #include <hybris/camera/camera_compatibility_layer_capabilities.h>
7 #include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
8
9-#define COMPAT_LIBRARY_PATH "/system/lib/libcamera_compat_layer.so"
10+#define COMPAT_LIBRARY_PATH "libcamera_compat_layer.so"
11
12 HYBRIS_LIBRARY_INITIALIZE(camera, COMPAT_LIBRARY_PATH);
13
14diff --git a/hybris/common/Makefile.am b/hybris/common/Makefile.am
15index cb1cdbd..867627e 100644
16--- a/hybris/common/Makefile.am
17+++ b/hybris/common/Makefile.am
18@@ -35,6 +35,12 @@ endif
19 if WANT_UBUNTU_LINKER_OVERRIDES
20 libhybris_common_la_CPPFLAGS += -DUBUNTU_LINKER_OVERRIDES
21 endif
22+if !WANT_ARCH_ARM64
23+libhybris_common_la_CPPFLAGS += -DWANT_LINKER_JB
24+endif
25+if WANT_EXPERIMENTAL
26+libhybris_common_la_CPPFLAGS += -DWANT_LINKER_MM
27+endif
28 libhybris_common_la_LDFLAGS = \
29 -ldl \
30 -lrt \
31diff --git a/hybris/common/hooks.c b/hybris/common/hooks.c
32index b705f8e..ce9972b 100644
33--- a/hybris/common/hooks.c
34+++ b/hybris/common/hooks.c
35@@ -2803,6 +2803,12 @@ static void* __hybris_load_linker(const char *path)
36 #define LINKER_NAME_JB "jb"
37 #define LINKER_NAME_MM "mm"
38
39+#if defined(WANT_LINKER_JB)
40+#define LINKER_NAME_DEFAULT LINKER_NAME_JB
41+#elif defined(WANT_LINKER_MM)
42+#define LINKER_NAME_DEFAULT LINKER_NAME_MM
43+#endif
44+
45 static int linker_initialized = 0;
46
47 static void __hybris_linker_init()
48@@ -2812,14 +2818,19 @@ static void __hybris_linker_init()
49 int sdk_version = get_android_sdk_version();
50
51 char path[PATH_MAX];
52- char *name = NULL;
53+ const char *name = LINKER_NAME_DEFAULT;
54+
55 /* See https://source.android.com/source/build-numbers.html for
56 * an overview over available SDK version numbers and which
57 * Android version they relate to. */
58+#if defined(WANT_LINKER_MM)
59+ if (sdk_version <= 23)
60+ name = LINKER_NAME_MM;
61+#endif
62+#if defined(WANT_LINKER_JB)
63 if (sdk_version < 21)
64 name = LINKER_NAME_JB;
65- else
66- name = LINKER_NAME_MM;
67+#endif
68
69 const char *linker_dir = LINKER_PLUGIN_DIR;
70 const char *user_linker_dir = getenv("HYBRIS_LINKER_DIR");
71diff --git a/hybris/configure.ac b/hybris/configure.ac
72index ee72547..eb073a1 100644
73--- a/hybris/configure.ac
74+++ b/hybris/configure.ac
75@@ -124,7 +124,11 @@ AC_ARG_WITH(default-egl-platform,
76 [ ])
77 AC_SUBST(DEFAULT_EGL_PLATFORM)
78
79-DEFAULT_HYBRIS_LD_LIBRARY_PATH="/vendor/lib:/system/lib"
80+if test "x$arch" = "xarm" -o "x$arch" = "xx86"; then
81+ DEFAULT_HYBRIS_LD_LIBRARY_PATH="/vendor/lib:/system/lib"
82+else
83+ DEFAULT_HYBRIS_LD_LIBRARY_PATH="/vendor/lib64:/system/lib64"
84+fi
85 AC_ARG_WITH(default-hybris-ld-library-path,
86 [ --with-default-hybris-ld-library-path=PATH1:PATH2:... Use PATH1:PATH2 for default HYBRIS_LD_LIBRARY_PATH if not specified by environment ],
87 [ DEFAULT_HYBRIS_LD_LIBRARY_PATH="$withval" ],
88diff --git a/hybris/egl/platforms/null/eglplatform_null.c b/hybris/egl/platforms/null/eglplatform_null.c
89index 379afe7..1f991d8 100644
90--- a/hybris/egl/platforms/null/eglplatform_null.c
91+++ b/hybris/egl/platforms/null/eglplatform_null.c
92@@ -16,7 +16,7 @@ static alloc_device_t *alloc = 0;
93
94 static void _init_androidui()
95 {
96- _libui = (void *) android_dlopen("/system/lib/libui.so", RTLD_LAZY);
97+ _libui = (void *) android_dlopen("libui.so", RTLD_LAZY);
98 }
99
100 #define UI_DLSYM(fptr, sym) do { if (_libui == NULL) { _init_androidui(); }; if (*(fptr) == NULL) { *(fptr) = (void *) android_dlsym(_libui, sym); } } while (0)
101diff --git a/hybris/glesv1/glesv1_cm.c b/hybris/glesv1/glesv1_cm.c
102index 1c383d4..3c2519c 100644
103--- a/hybris/glesv1/glesv1_cm.c
104+++ b/hybris/glesv1/glesv1_cm.c
105@@ -26,7 +26,7 @@
106
107 #include <hybris/common/binding.h>
108
109-#define GLESV1_CM_LIBRARY_PATH "/system/lib/libGLESv1_CM.so"
110+#define GLESV1_CM_LIBRARY_PATH "libGLESv1_CM.so"
111
112 HYBRIS_LIBRARY_INITIALIZE(glesv1_cm, GLESV1_CM_LIBRARY_PATH);
113
114diff --git a/hybris/input/is.c b/hybris/input/is.c
115index b9587f8..0b3da08 100644
116--- a/hybris/input/is.c
117+++ b/hybris/input/is.c
118@@ -24,7 +24,7 @@
119 #include <hybris/common/binding.h>
120 #include <hybris/input/input_stack_compatibility_layer.h>
121
122-#define COMPAT_LIBRARY_PATH "/system/lib/libis_compat_layer.so"
123+#define COMPAT_LIBRARY_PATH "libis_compat_layer.so"
124
125 HYBRIS_LIBRARY_INITIALIZE(is, COMPAT_LIBRARY_PATH);
126
127diff --git a/hybris/libnfc_ndef_nxp/libnfc_ndef_nxp.c b/hybris/libnfc_ndef_nxp/libnfc_ndef_nxp.c
128index 5af8393..0b80bb9 100644
129--- a/hybris/libnfc_ndef_nxp/libnfc_ndef_nxp.c
130+++ b/hybris/libnfc_ndef_nxp/libnfc_ndef_nxp.c
131@@ -34,7 +34,7 @@
132
133 #include <hybris/common/binding.h>
134
135-HYBRIS_LIBRARY_INITIALIZE(libnfc_ndef_so, "/system/lib/libnfc_ndef.so");
136+HYBRIS_LIBRARY_INITIALIZE(libnfc_ndef_so, "libnfc_ndef.so");
137
138 HYBRIS_IMPLEMENT_FUNCTION5(libnfc_ndef_so, NFCSTATUS, phFriNfc_NdefRecord_GetRecords, uint8_t *, uint32_t, uint8_t **, uint8_t *, uint32_t *);
139 HYBRIS_IMPLEMENT_FUNCTION1(libnfc_ndef_so, uint32_t, phFriNfc_NdefRecord_GetLength, phFriNfc_NdefRecord_t *);
140diff --git a/hybris/libnfc_nxp/libnfc_nxp.c b/hybris/libnfc_nxp/libnfc_nxp.c
141index febd89a..ddf224b 100644
142--- a/hybris/libnfc_nxp/libnfc_nxp.c
143+++ b/hybris/libnfc_nxp/libnfc_nxp.c
144@@ -56,7 +56,7 @@ typedef void (*pphDal4Nfc_DeferFuncPointer_t) (void * );
145
146 #include <hybris/common/binding.h>
147
148-HYBRIS_LIBRARY_INITIALIZE(libnfc_so, "/system/lib/libnfc.so");
149+HYBRIS_LIBRARY_INITIALIZE(libnfc_so, "libnfc.so");
150
151 HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phLibNfc_Mgt_ConfigureDriver, pphLibNfc_sConfig_t, void **);
152 HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phDal4Nfc_Config, pphDal4Nfc_sConfig_t, void **);
153diff --git a/hybris/media/media.c b/hybris/media/media.c
154index eee644e..d39c454 100644
155--- a/hybris/media/media.c
156+++ b/hybris/media/media.c
157@@ -33,7 +33,7 @@
158 #include <hybris/media/media_codec_source_layer.h>
159 #include <hybris/media/media_buffer_layer.h>
160
161-#define COMPAT_LIBRARY_PATH "/system/lib/libmedia_compat_layer.so"
162+#define COMPAT_LIBRARY_PATH "libmedia_compat_layer.so"
163
164 #ifdef __ARM_PCS_VFP
165 #define FP_ATTRIB __attribute__((pcs("aapcs")))
166diff --git a/hybris/sf/sf.c b/hybris/sf/sf.c
167index 5c55b93..45258cc 100644
168--- a/hybris/sf/sf.c
169+++ b/hybris/sf/sf.c
170@@ -24,7 +24,7 @@
171 #include <hybris/common/binding.h>
172 #include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
173
174-#define COMPAT_LIBRARY_PATH "/system/lib/libsf_compat_layer.so"
175+#define COMPAT_LIBRARY_PATH "libsf_compat_layer.so"
176
177 HYBRIS_LIBRARY_INITIALIZE(sf, COMPAT_LIBRARY_PATH);
178
179diff --git a/hybris/ui/ui.c b/hybris/ui/ui.c
180index 817a857..6a56f1d 100644
181--- a/hybris/ui/ui.c
182+++ b/hybris/ui/ui.c
183@@ -20,7 +20,7 @@
184 #include <hybris/common/binding.h>
185 #include <hybris/ui/ui_compatibility_layer.h>
186
187-#define COMPAT_LIBRARY_PATH "/system/lib/libui_compat_layer.so"
188+#define COMPAT_LIBRARY_PATH "libui_compat_layer.so"
189
190 HYBRIS_LIBRARY_INITIALIZE(ui, COMPAT_LIBRARY_PATH);
191
192diff --git a/hybris/vibrator/vibrator.c b/hybris/vibrator/vibrator.c
193index a92186c..ffe2766 100644
194--- a/hybris/vibrator/vibrator.c
195+++ b/hybris/vibrator/vibrator.c
196@@ -22,7 +22,7 @@
197
198 #include <hybris/common/binding.h>
199
200-HYBRIS_LIBRARY_INITIALIZE(vibrator, "/system/lib/libhardware_legacy.so");
201+HYBRIS_LIBRARY_INITIALIZE(vibrator, "libhardware_legacy.so");
202
203 HYBRIS_IMPLEMENT_FUNCTION0(vibrator, int, vibrator_exists);
204 HYBRIS_IMPLEMENT_FUNCTION1(vibrator, int, vibrator_on, int);
205diff --git a/hybris/wifi/wifi.c b/hybris/wifi/wifi.c
206index c76985f..5ce9a94 100644
207--- a/hybris/wifi/wifi.c
208+++ b/hybris/wifi/wifi.c
209@@ -22,7 +22,7 @@
210 #include <hybris/common/binding.h>
211 #include <hardware_legacy/wifi.h>
212
213-#define COMPAT_LIBRARY_PATH "/system/lib/libhardware_legacy.so"
214+#define COMPAT_LIBRARY_PATH "libhardware_legacy.so"
215
216 HYBRIS_LIBRARY_INITIALIZE(wifi, COMPAT_LIBRARY_PATH);
217

Subscribers

People subscribed via source and target branches