Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minimize build for halium/hybris #47

Draft
wants to merge 1 commit into
base: halium-10.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 64 additions & 19 deletions art/0001-hybris-Silence-some-build-errors-to-let-the-systemim.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 1a27bd48255a96853e49d25c82a0fe47dd477f83 Mon Sep 17 00:00:00 2001
From b7aef38b325eed4897bdae1d39ae4683e4f9f509 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <[email protected]>
Date: Fri, 3 Jul 2020 22:15:49 +0200
Subject: [PATCH] (hybris) Silence some build errors to let the systemimage
Expand All @@ -14,22 +14,64 @@ them and insert dummy data to allow the building of the systemimage.
Signed-off-by: Björn Bidar <[email protected]>
Change-Id: Ide41188b6263a22c371ec28786bbc1ef1ee62df7
---
runtime/thread-current-inl.h | 4 ++--
runtime/thread.cc | 4 ++--
runtime/thread_list.cc | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
build/Android.gtest.mk | 20 ++++++++++----------
runtime/thread-current-inl.h | 2 +-
runtime/thread.cc | 4 ++++
runtime/thread_list.cc | 2 ++
4 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 2249b1b750..4b5ec87ca0 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -74,28 +74,28 @@ $(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval $(call build-art-test-dex,art-gte

# Create rules for MainStripped, a copy of Main with the classes.dex stripped
# for the oat file assistant tests.
-ART_TEST_HOST_GTEST_MainStripped_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
-ART_TEST_TARGET_GTEST_MainStripped_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
+ART_TEST_HOST_GTEST_MainStripped_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
+ART_TEST_TARGET_GTEST_MainStripped_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))

# Create rules for MainUncompressed, a copy of Main with the classes.dex uncompressed
# for the dex2oat tests.
-ART_TEST_HOST_GTEST_MainUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Uncompressed$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
-ART_TEST_TARGET_GTEST_MainUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Uncompressed$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
+ART_TEST_HOST_GTEST_MainUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
+ART_TEST_TARGET_GTEST_MainUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))

# Create rules for UncompressedEmpty, a classes.dex that is empty and uncompressed
# for the dex2oat tests.
-ART_TEST_HOST_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))EmptyUncompressed$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
-ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))EmptyUncompressed$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
+ART_TEST_HOST_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
+ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))

# Create rules for UncompressedEmptyAligned, a classes.dex that is empty, uncompressed,
# and 4 byte aligned for the dex2oat tests.
-ART_TEST_HOST_GTEST_EmptyUncompressedAligned_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))EmptyUncompressedAligned$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
-ART_TEST_TARGET_GTEST_EmptyUncompressedAligned_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))EmptyUncompressedAligned$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
+ART_TEST_HOST_GTEST_EmptyUncompressedAligned_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
+ART_TEST_TARGET_GTEST_EmptyUncompressedAligned_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))

# Create rules for MultiDexUncompressed, a copy of MultiDex with the classes.dex uncompressed
# for the OatFile tests.
-ART_TEST_HOST_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_MultiDex_DEX))Uncompressed$(suffix $(ART_TEST_HOST_GTEST_MultiDex_DEX))
-ART_TEST_TARGET_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_MultiDex_DEX))Uncompressed$(suffix $(ART_TEST_TARGET_GTEST_MultiDex_DEX))
+ART_TEST_HOST_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_MultiDex_DEX))$(suffix $(ART_TEST_HOST_GTEST_MultiDex_DEX))
+ART_TEST_TARGET_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_MultiDex_DEX))(suffix $(ART_TEST_TARGET_GTEST_MultiDex_DEX))

ifdef ART_TEST_HOST_GTEST_Main_DEX
$(ART_TEST_HOST_GTEST_MainStripped_DEX): $(ART_TEST_HOST_GTEST_Main_DEX)
diff --git a/runtime/thread-current-inl.h b/runtime/thread-current-inl.h
index 9241b1f875..a3e0520423 100644
--- a/runtime/thread-current-inl.h
+++ b/runtime/thread-current-inl.h
@@ -33,8 +33,8 @@ inline Thread* Thread::Current() {
if (!is_started_) {
@@ -34,7 +34,7 @@ inline Thread* Thread::Current() {
return nullptr;
} else {
-#ifdef ART_TARGET_ANDROID
#ifdef ART_TARGET_ANDROID
- void* thread = __get_tls()[TLS_SLOT_ART_THREAD_SELF];
+#ifdef DISABLED_FOR_HYBRIS_SUPPORT
+ void* thread = nullptr; //__get_tls()[TLS_SLOT_ART_THREAD_SELF];
#else
void* thread = pthread_getspecific(Thread::pthread_key_self_);
Expand All @@ -38,37 +80,40 @@ diff --git a/runtime/thread.cc b/runtime/thread.cc
index be0e30ad11..da112e19c9 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -932,7 +932,7 @@ bool Thread::Init(ThreadList* thread_list, JavaVMExt* java_vm, JNIEnvExt* jni_en
interpreter::InitInterpreterTls(this);
@@ -933,7 +933,9 @@ bool Thread::Init(ThreadList* thread_list, JavaVMExt* java_vm, JNIEnvExt* jni_en
}

-#ifdef ART_TARGET_ANDROID
#ifdef ART_TARGET_ANDROID
+#ifdef DISABLED_FOR_HYBRIS_SUPPORT
__get_tls()[TLS_SLOT_ART_THREAD_SELF] = this;
+#endif
#else
CHECK_PTHREAD_CALL(pthread_setspecific, (Thread::pthread_key_self_, this), "attach self");
@@ -2198,7 +2198,7 @@ void Thread::ThreadExitCallback(void* arg) {
LOG(WARNING) << "Native thread exiting without having called DetachCurrentThread (maybe it's "
#endif
@@ -2199,7 +2201,9 @@ void Thread::ThreadExitCallback(void* arg) {
"going to use a pthread_key_create destructor?): " << *self;
CHECK(is_started_);
-#ifdef ART_TARGET_ANDROID
#ifdef ART_TARGET_ANDROID
+#ifdef DISABLED_FOR_HYBRIS_SUPPORT
__get_tls()[TLS_SLOT_ART_THREAD_SELF] = self;
+#endif
#else
CHECK_PTHREAD_CALL(pthread_setspecific, (Thread::pthread_key_self_, self), "reattach self");
#endif
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index ed6b2c91e5..37a2bd6911 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -1481,7 +1481,7 @@ void ThreadList::Unregister(Thread* self) {

@@ -1482,7 +1482,9 @@ void ThreadList::Unregister(Thread* self) {
// Clear the TLS data, so that the underlying native thread is recognizably detached.
// (It may wish to reattach later.)
-#ifdef ART_TARGET_ANDROID
#ifdef ART_TARGET_ANDROID
+#ifdef DISABLED_FOR_HYBRIS_SUPPORT
__get_tls()[TLS_SLOT_ART_THREAD_SELF] = nullptr;
+#endif
#else
CHECK_PTHREAD_CALL(pthread_setspecific, (Thread::pthread_key_self_, nullptr), "detach self");
#endif
--
2.27.0
2.35.1

Loading