[clang] [llvm] [PowerPC][AIX] Support #pragma comment copyright for AIX (PR #178184)

Tony Varghese via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 13 22:49:09 PDT 2026


================
@@ -6641,6 +6623,37 @@ The ``#pragma comment(lib, ...)`` directive is supported on all ELF targets.
 The second parameter is the library name (without the traditional Unix prefix of
 ``lib``).  This allows you to provide an implicit link of dependent libraries.
 
+Embedding Copyright Information on AIX
+======================================
+Clang supports the ``#pragma comment(copyright, "string")`` directive on AIX
+targets. This directive embeds a copyright or identifying string into the
+compiled object file so that the string survives into shared libraries and
+executables. The directive is silently ignored on non-AIX targets.
+
+.. code-block:: c
+
+   #pragma comment(copyright, "string-literal")
+
+The *string-literal* may be any ordinary string constant, including
+concatenated string literals. The directive may appear at file scope; it is
----------------
tonykuttai wrote:

Thanks. 
Modified the doc to say that we are supporting ordinary string literals only. Also added negative test points in `clang/test/Preprocessor/pragma-comment.c` for prefixed string literals.

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


More information about the cfe-commits mailing list