================
@@ -16,6 +16,8 @@
 
 #if defined(_AIX)
   .toc
+#elif defined(__aarch64__) && defined(__ELF__) && 
defined(_LIBUNWIND_EXECUTE_ONLY_CODE)
----------------
Il-Capitano wrote:

`.section .text,"axy",@progbits,unique,0` is an ELF-specific directive, so I 
think it makes sense to check for an ELF target here, rather than in the CMake 
script.

I found a few examples in libc++ that do a similar thing, e.g. 
`_LIBCPP_LINK_PTHREAD_LIB` which is always checked as `defined(__ELF__) && 
defined(_LIBCPP_LINK_PTHREAD_LIB)`. I also didn't find any checks for the 
target format in CMake files, so I think my approach here is reasonable.

Also, from a maintainability perspective, if a different target is ever added 
with execute-only code support, only the assembly files need to be updated, and 
the definition of `_LIBUNWIND_EXECUTE_ONLY_CODE` doesn't need to be touched.

https://github.com/llvm/llvm-project/pull/140554
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to