[compiler-rt] [compiler-rt] Add initial ARM64EC builtins support (PR #139279)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Wed May 14 15:13:03 PDT 2025


================
@@ -31,22 +44,28 @@ int main()
 {
 #if defined(__ve__)
     unsigned char execution_buffer[128] __attribute__((__aligned__(8)));
+#elif defined(__x86_64__)
+  unsigned char execution_buffer[sizeof(func1)];
 #else
     unsigned char execution_buffer[128];
 #endif
     // mark stack page containing execution_buffer to be executable
     __enable_execute_stack(execution_buffer);
 	
     // verify you can copy and execute a function
-    pfunc f1 = (pfunc)memcpy_f(execution_buffer, func1, 128);
-    __clear_cache(execution_buffer, &execution_buffer[128]);
+    pfunc f1 =
+        (pfunc)memcpy_f(execution_buffer, func1, sizeof(execution_buffer));
----------------
cjacek wrote:

My thinking was that using an array for the code made it easier to avoid overreads than on other platforms, but there’s no strong reason for it. I’ve reverted that in the new version. Thanks for the review!

https://github.com/llvm/llvm-project/pull/139279


More information about the llvm-commits mailing list