diff options
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | libshims/Android.mk | 9 | ||||
| -rw-r--r-- | libshims/atomic.cpp | 21 | ||||
| -rw-r--r-- | patches/system/core/0001-mtk-O-reintroduce-atomic-symbols-in-libcutils-for-ol.patch | 60 | ||||
| -rw-r--r-- | product/libshims.mk | 5 |
5 files changed, 36 insertions, 60 deletions
@@ -30,6 +30,7 @@ The only configuration libshim needs is the following flags : `#LIBSHIM_GUI_SYMBOLS := true` `#LIBSHIM_OMX_SYMBOLS := true` `#LIBSHIM_AGPS_SYMBOLS := true` +`#LIBSHIM_ATOMIC_SYMBOLS := true` (copy/paste in `BoardConfig.mk` & uncomment the flags you need) # Optional : diff --git a/libshims/Android.mk b/libshims/Android.mk index 51e4c4b..3b99ea0 100644 --- a/libshims/Android.mk +++ b/libshims/Android.mk @@ -20,6 +20,15 @@ LOCAL_PROPRIETARY_MODULE := true include $(BUILD_SHARED_LIBRARY) +## libshim_atomic +include $(CLEAR_VARS) +LOCAL_SRC_FILES := atomic.cpp +LOCAL_MODULE := libshim_atomic +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +LOCAL_CFLAGS := -O3 -Wno-unused-variable -Wno-unused-parameter +LOCAL_PROPRIETARY_MODULE := true +include $(BUILD_SHARED_LIBRARY) + ## libshim_omx include $(CLEAR_VARS) diff --git a/libshims/atomic.cpp b/libshims/atomic.cpp new file mode 100644 index 0000000..3a159e2 --- /dev/null +++ b/libshims/atomic.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2017 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <string> +#define ANDROID_ATOMIC_INLINE +extern "C" { +#include <cutils/atomic.h> +} diff --git a/patches/system/core/0001-mtk-O-reintroduce-atomic-symbols-in-libcutils-for-ol.patch b/patches/system/core/0001-mtk-O-reintroduce-atomic-symbols-in-libcutils-for-ol.patch deleted file mode 100644 index df86e12..0000000 --- a/patches/system/core/0001-mtk-O-reintroduce-atomic-symbols-in-libcutils-for-ol.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 041026c3d8ab43a088e9907b1ec33f8e0bf7d685 Mon Sep 17 00:00:00 2001 -From: Mister Oyster <oysterized@gmail.com> -Date: Wed, 28 Jun 2017 19:41:05 +0200 -Subject: [PATCH] mtk: O: reintroduce atomic symbols in libcutils for old Mtk - audio hals & Mali blobs - -Change-Id: I4b7cf5e5a772f9c281ae4bf3d3fdfd2d3b41d4c1 ---- - libcutils/Android.bp | 1 + - libcutils/atomic.c | 26 ++++++++++++++++++++++++++ - 2 files changed, 27 insertions(+) - create mode 100644 libcutils/atomic.c - -diff --git a/libcutils/Android.bp b/libcutils/Android.bp -index 513736d..6ebff26 100644 ---- a/libcutils/Android.bp -+++ b/libcutils/Android.bp -@@ -53,6 +53,7 @@ cc_library { - vendor_available: true, - host_supported: true, - srcs: [ -+ "atomic.c", - "config_utils.c", - "fs_config.c", - "canned_fs_config.c", -diff --git a/libcutils/atomic.c b/libcutils/atomic.c -new file mode 100644 -index 0000000..d34aa00 ---- /dev/null -+++ b/libcutils/atomic.c -@@ -0,0 +1,26 @@ -+/* -+ * Copyright (C) 2007 The Android Open Source Project -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+/* -+ * Generate non-inlined versions of android_atomic functions. -+ * Nobody should be using these, but some binary blobs currently (late 2014) -+ * are. -+ * If you read this in 2015 or later, please try to delete this file. -+ */ -+ -+#define ANDROID_ATOMIC_INLINE -+ -+#include <cutils/atomic.h> --- -2.11.0 - diff --git a/product/libshims.mk b/product/libshims.mk index 8f8df3a..674b04b 100644 --- a/product/libshims.mk +++ b/product/libshims.mk @@ -23,3 +23,8 @@ ifeq ($(LIBSHIM_AGPS_SYMBOLS),true) PRODUCT_PACKAGES += libshim_agps LINKER_FORCED_SHIM_LIBS := $(LINKER_FORCED_SHIM_LIBS):/vendor/bin/mtk_agpsd|libshim_agps.so endif +ifeq ($(LIBSHIM_ATOMIC_SYMBOLS),true) +PRODUCT_PACKAGES += libshim_atomic +LINKER_FORCED_SHIM_LIBS := $(LINKER_FORCED_SHIM_LIBS):/system/lib/libcutils.so|libshim_atomic.so:/system/lib64/libcutils.so|libshim_atomic.so +endif + |
