public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/maskray/grte] Add comments explaining the diff from cf8e3f8757
@ 2021-08-28  0:32 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28  0:32 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6733782381a84fe18cf89d11c88d7df497e3a275

commit 6733782381a84fe18cf89d11c88d7df497e3a275
Author: Josh Kunz <jkz@google.com>
Date:   Mon Aug 12 13:28:09 2019 -0700

    Add comments explaining the diff from cf8e3f8757
    
    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.

Diff:
---
 scripts/gen-as-const.awk | 7 +++++++
 scripts/gen-py-const.awk | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/scripts/gen-as-const.awk b/scripts/gen-as-const.awk
index 36e6de303c..fd662c9df9 100644
--- a/scripts/gen-as-const.awk
+++ b/scripts/gen-as-const.awk
@@ -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;
 }
diff --git a/scripts/gen-py-const.awk b/scripts/gen-py-const.awk
index beb41964ee..8101bf87ac 100644
--- a/scripts/gen-py-const.awk
+++ b/scripts/gen-py-const.awk
@@ -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;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [glibc/maskray/grte] Add comments explaining the diff from cf8e3f8757
@ 2021-08-28  0:27 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28  0:27 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d5d3a0e8898d3f24c1f3053999baacbf34733137

commit d5d3a0e8898d3f24c1f3053999baacbf34733137
Author: Josh Kunz <jkz@google.com>
Date:   Mon Aug 12 13:28:09 2019 -0700

    Add comments explaining the diff from cf8e3f8757
    
    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.

Diff:
---
 scripts/gen-as-const.awk | 7 +++++++
 scripts/gen-py-const.awk | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/scripts/gen-as-const.awk b/scripts/gen-as-const.awk
index 36e6de303c..fd662c9df9 100644
--- a/scripts/gen-as-const.awk
+++ b/scripts/gen-as-const.awk
@@ -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;
 }
diff --git a/scripts/gen-py-const.awk b/scripts/gen-py-const.awk
index beb41964ee..8101bf87ac 100644
--- a/scripts/gen-py-const.awk
+++ b/scripts/gen-py-const.awk
@@ -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;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [glibc/maskray/grte] Add comments explaining the diff from cf8e3f8757
@ 2021-08-27 23:50 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-27 23:50 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9b77aff01bcddcd5aea89e5d5496611adf01965b

commit 9b77aff01bcddcd5aea89e5d5496611adf01965b
Author: Josh Kunz <jkz@google.com>
Date:   Mon Aug 12 13:28:09 2019 -0700

    Add comments explaining the diff from cf8e3f8757
    
    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.

Diff:
---
 scripts/gen-as-const.awk | 7 +++++++
 scripts/gen-py-const.awk | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/scripts/gen-as-const.awk b/scripts/gen-as-const.awk
index 36e6de303c..fd662c9df9 100644
--- a/scripts/gen-as-const.awk
+++ b/scripts/gen-as-const.awk
@@ -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;
 }
diff --git a/scripts/gen-py-const.awk b/scripts/gen-py-const.awk
index beb41964ee..8101bf87ac 100644
--- a/scripts/gen-py-const.awk
+++ b/scripts/gen-py-const.awk
@@ -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;


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-28  0:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  0:32 [glibc/maskray/grte] Add comments explaining the diff from cf8e3f8757 Fangrui Song
  -- strict thread matches above, loose matches on Subject: below --
2021-08-28  0:27 Fangrui Song
2021-08-27 23:50 Fangrui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).