]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add comments explaining the diff from cf8e3f8757
authorJosh Kunz <jkz@google.com>
Mon, 12 Aug 2019 20:28:09 +0000 (13:28 -0700)
committerFangrui Song <i@maskray.me>
Sat, 28 Aug 2021 00:26:02 +0000 (17:26 -0700)
These comments should make it easier to see the (small) diff introduced
in cf8e3f8757. Without these comments, the diff may get list on a future
upstream merge.

scripts/gen-as-const.awk
scripts/gen-py-const.awk

index 36e6de303c769fe9f22723f3b8ae87471f3027e2..fd662c9df9bed6e1a1e9cdefe0926837e978b951 100644 (file)
@@ -49,6 +49,13 @@ NF > 1 {
   if (test)
     print "  TEST (" name ", \"" FILENAME ":" FNR "\", " $0 ")";
   else
+    # The `.ascii` directive here is needed for LLVM/clang support. LLVM will
+    # validate every `asm(...)` directive before emitting it, whereas GCC will
+    # literally emit the directive without validation. Without `.ascii` the
+    # directives emitted by this generator are not valid assembler statements,
+    # and the LLVM assembler will fail to assemble the file. The `.ascii` here
+    # has no functional affect, because string parsing is used to extract the
+    # integer constant from the assembly file built from the generated file.
     printf "asm (\".ascii \\\"@@@name@@@%s@@@value@@@%%0@@@end@@@\\\"\" : : \"i\" ((long) %s));\n",
       name, $0;
 }
index beb41964eefd12d06c64262f41e36ada30340ed0..8101bf87acc2ecb9580d06293b0003c7c5150fa2 100644 (file)
@@ -109,6 +109,13 @@ NF > 1 {
     # Remove any characters before the second field.
     sub(/^[^[:blank:]]+[[:blank:]]+/, "");
 
+    # The `.ascii` directive here is needed for LLVM/clang support. LLVM will
+    # validate every `asm(...)` directive before emitting it, whereas GCC will
+    # literally emit the directive without validation. Without `.ascii` the
+    # directives emitted by this generator are not valid assembler statements,
+    # and the LLVM assembler will fail to assemble the file. The `.ascii` here
+    # has no functional affect, because string parsing is used to extract the
+    # integer constant from the assembly file built from the generated file.
     # '$0' ends up being everything that appeared after the first field
     # separator.
     printf "  asm (\".ascii \\\"@name@%s@value@%0@\\\"\" : : \"i\" (%s));\n", name, $0;