Support gcc build for aarch64. 96/307496/2
authorvenu.musham <venu.musham@samsung.com>
Mon, 11 Mar 2024 07:29:31 +0000 (12:59 +0530)
committervenu.musham <venu.musham@samsung.com>
Mon, 11 Mar 2024 10:45:40 +0000 (16:15 +0530)
This commit provides fixes to aarch64 arm build to support
gcc build.

Change-Id: I2d51c36a4de12cebf831e76afdcc3134f57cdfb7
Signed-off-by: venu.musham <venu.musham@samsung.com>
third_party/crashpad/crashpad/util/linux/pac_helper.cc
third_party/libvpx/BUILD.gn
third_party/libvpx/source/libvpx/vpx_ports/arm.h
v8/src/trap-handler/trap-handler.h

index a9d5f04..eb2c6c8 100644 (file)
@@ -32,10 +32,14 @@ VMAddress StripPACBits(VMAddress address) {
 #if CRASHPAD_HAS_FEATURE(ptrauth_intrinsics)
     address = ptrauth_strip(address, ptrauth_key_function_pointer);
 #elif defined(ARCH_CPU_ARM64)
+#if !defined(__GNUC__) || defined(__clang__)
     // Strip any pointer authentication bits that are assigned to the address.
     register uintptr_t x30 __asm("x30") = address;
     asm("xpaclri" : "+r"(x30));
     address = x30;
+#else
+    return address;
+#endif
 #endif
     return address;
 }
index edddde4..4f755a4 100644 (file)
@@ -505,7 +505,7 @@ static_library("libvpx") {
       cpu_arch_full == "arm-neon-cpu-detect" || current_cpu == "arm64") {
     deps += [ ":libvpx_intrinsics_neon" ]
   }
-  if (current_cpu == "arm64") {
+  if (current_cpu == "arm64" && is_clang) {
     deps += [ ":libvpx_intrinsics_neon_dotprod" ]
     deps += [ ":libvpx_intrinsics_neon_i8mm" ]
   }
index 65909d8..d5625d9 100644 (file)
@@ -19,10 +19,17 @@ extern "C" {
 
 // Armv7-A optional Neon instructions, mandatory from Armv8.0-A.
 #define HAS_NEON (1 << 0)
+
+#if !defined(__GNUC__) || defined(__clang__)
 // Armv8.2-A optional Neon dot-product instructions, mandatory from Armv8.4-A.
 #define HAS_NEON_DOTPROD (1 << 1)
 // Armv8.2-A optional Neon i8mm instructions, mandatory from Armv8.6-A.
 #define HAS_NEON_I8MM (1 << 2)
+#else
+// gcc compilers have issues with dotprod & i8mm
+#define HAS_NEON_DOTPROD 0
+#define HAS_NEON_I8MM 0
+#endif
 
 int arm_cpu_caps(void);
 
index 289a755..6a2f00c 100644 (file)
@@ -24,7 +24,8 @@ namespace trap_handler {
 #define V8_TRAP_HANDLER_SUPPORTED true
 // Arm64 (non-simulator) on Mac and Linux.
 #elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && \
-    (V8_OS_DARWIN || (V8_OS_LINUX && !V8_OS_ANDROID))
+    (V8_OS_DARWIN || (V8_OS_LINUX && !V8_OS_ANDROID)) && \
+    defined(__clang__)
 #define V8_TRAP_HANDLER_SUPPORTED true
 // Arm64 simulator on x64 on Linux, Mac, or Windows.
 //