[llvm] 71cbc62 - [llvm-exegesis] Disable SubprocessMemory class on Android
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 6 19:12:43 PDT 2023
Author: Aiden Grossman
Date: 2023-07-06T19:12:28-07:00
New Revision: 71cbc62a24df85cf6c6d02d959fccfde231c0698
URL: https://github.com/llvm/llvm-project/commit/71cbc62a24df85cf6c6d02d959fccfde231c0698
DIFF: https://github.com/llvm/llvm-project/commit/71cbc62a24df85cf6c6d02d959fccfde231c0698.diff
LOG: [llvm-exegesis] Disable SubprocessMemory class on Android
Having the SubprocessMemory class available on Android was causing build
failures in downstream builds as Android doesn't implement the SystemV
IPC specification that supplies shm_open and other functions that the
class relies on. This patch simply makes it unavailable on Android using
preprocessor directives.
Added:
Modified:
llvm/tools/llvm-exegesis/lib/SubprocessMemory.cpp
llvm/unittests/tools/llvm-exegesis/X86/SubprocessMemoryTest.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-exegesis/lib/SubprocessMemory.cpp b/llvm/tools/llvm-exegesis/lib/SubprocessMemory.cpp
index 750e49d8e304b6..97ae0078d7e591 100644
--- a/llvm/tools/llvm-exegesis/lib/SubprocessMemory.cpp
+++ b/llvm/tools/llvm-exegesis/lib/SubprocessMemory.cpp
@@ -19,7 +19,7 @@
namespace llvm {
namespace exegesis {
-#ifdef __linux__
+#if defined(__linux__) && !defined(__ANDROID__)
Error SubprocessMemory::initializeSubprocessMemory(pid_t ProcessID) {
// Add the PID to the shared memory name so that if we're running multiple
@@ -139,7 +139,7 @@ Expected<int> SubprocessMemory::setupAuxiliaryMemoryInSubprocess(
SubprocessMemory::~SubprocessMemory() {}
-#endif // __linux__
+#endif // defined(__linux__) && !defined(__ANDROID__)
} // namespace exegesis
} // namespace llvm
diff --git a/llvm/unittests/tools/llvm-exegesis/X86/SubprocessMemoryTest.cpp b/llvm/unittests/tools/llvm-exegesis/X86/SubprocessMemoryTest.cpp
index 9d194b6b247ca5..4a6f13642ddedf 100644
--- a/llvm/unittests/tools/llvm-exegesis/X86/SubprocessMemoryTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/X86/SubprocessMemoryTest.cpp
@@ -21,7 +21,7 @@
namespace llvm {
namespace exegesis {
-#ifdef __linux__
+#if defined(__linux__) && !defined(__ANDROID__)
class SubprocessMemoryTest : public X86TestBase {
protected:
@@ -126,7 +126,7 @@ TEST_F(SubprocessMemoryTest, DefinitionEndTruncation) {
checkSharedMemoryDefinition("/3memdef0", 4096, Test1Expected);
}
-#endif // __linux__
+#endif // defined(__linux__) && !defined(__ANDROID__)
} // namespace exegesis
} // namespace llvm
More information about the llvm-commits
mailing list