public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/maskray/grte] Additional fixes for llvm-as
@ 2021-08-28 0:33 Fangrui Song
0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28 0:33 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cb908840466823a53c03da86e65118eb7467ab0b
commit cb908840466823a53c03da86e65118eb7467ab0b
Author: Josh Kunz <jkz@google.com>
Date: Thu Jan 23 17:37:14 2020 -0800
Additional fixes for llvm-as
Unlike GCC, llvm always uses an integrated assembler, which attempts to
recognized all `asm` statements written in the C code. glibc uses some
syntactically invalid asm statements to emit constants into assembly that
are later extracted with a sed or AWK script.
This change fixes two such invalid `asm` statements by wrapping the
output in a `.ascii` directive.. This does not break the sed/AWK (the same
special sequence is output) but it makes the statement syntactically valid.
See cf8e3f8757 for a previous fix for the same issue.
Diff:
---
sysdeps/gnu/errlist.awk | 2 +-
sysdeps/gnu/errlist.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sysdeps/gnu/errlist.awk b/sysdeps/gnu/errlist.awk
index 9a5adf86a6..cc07510e10 100644
--- a/sysdeps/gnu/errlist.awk
+++ b/sysdeps/gnu/errlist.awk
@@ -105,6 +105,6 @@ END {
print "";
print "#ifdef EMIT_ERR_MAX";
print "void dummy (void)"
- print "{ asm volatile (\" @@@ %0 @@@ \" : : \"i\" (ERR_REMAP (ERR_MAX))); }"
+ print "{ asm volatile (\".ascii \\\" @@@ %0 @@@ \\\"\" : : \"i\" (ERR_REMAP (ERR_MAX))); }"
print "#endif";
}
diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c
index 4a1c093ed0..5345df0268 100644
--- a/sysdeps/gnu/errlist.c
+++ b/sysdeps/gnu/errlist.c
@@ -1478,5 +1478,5 @@ const int _sys_nerr_internal = NERR;
#ifdef EMIT_ERR_MAX
void dummy (void)
-{ asm volatile (" @@@ %0 @@@ " : : "i" (ERR_REMAP (ERR_MAX))); }
+{ asm volatile (".ascii \" @@@ %0 @@@ \"" : : "i" (ERR_REMAP (ERR_MAX))); }
#endif
^ permalink raw reply [flat|nested] 3+ messages in thread
* [glibc/maskray/grte] Additional fixes for llvm-as
@ 2021-08-28 0:28 Fangrui Song
0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28 0:28 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=056f7d271753703e95f26b40643023eb6fb2e9be
commit 056f7d271753703e95f26b40643023eb6fb2e9be
Author: Josh Kunz <jkz@google.com>
Date: Thu Jan 23 17:37:14 2020 -0800
Additional fixes for llvm-as
Unlike GCC, llvm always uses an integrated assembler, which attempts to
recognized all `asm` statements written in the C code. glibc uses some
syntactically invalid asm statements to emit constants into assembly that
are later extracted with a sed or AWK script.
This change fixes two such invalid `asm` statements by wrapping the
output in a `.ascii` directive.. This does not break the sed/AWK (the same
special sequence is output) but it makes the statement syntactically valid.
See cf8e3f8757 for a previous fix for the same issue.
Diff:
---
sysdeps/gnu/errlist.awk | 2 +-
sysdeps/gnu/errlist.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sysdeps/gnu/errlist.awk b/sysdeps/gnu/errlist.awk
index 9a5adf86a6..cc07510e10 100644
--- a/sysdeps/gnu/errlist.awk
+++ b/sysdeps/gnu/errlist.awk
@@ -105,6 +105,6 @@ END {
print "";
print "#ifdef EMIT_ERR_MAX";
print "void dummy (void)"
- print "{ asm volatile (\" @@@ %0 @@@ \" : : \"i\" (ERR_REMAP (ERR_MAX))); }"
+ print "{ asm volatile (\".ascii \\\" @@@ %0 @@@ \\\"\" : : \"i\" (ERR_REMAP (ERR_MAX))); }"
print "#endif";
}
diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c
index 4a1c093ed0..5345df0268 100644
--- a/sysdeps/gnu/errlist.c
+++ b/sysdeps/gnu/errlist.c
@@ -1478,5 +1478,5 @@ const int _sys_nerr_internal = NERR;
#ifdef EMIT_ERR_MAX
void dummy (void)
-{ asm volatile (" @@@ %0 @@@ " : : "i" (ERR_REMAP (ERR_MAX))); }
+{ asm volatile (".ascii \" @@@ %0 @@@ \"" : : "i" (ERR_REMAP (ERR_MAX))); }
#endif
^ permalink raw reply [flat|nested] 3+ messages in thread
* [glibc/maskray/grte] Additional fixes for llvm-as
@ 2021-08-27 23:45 Fangrui Song
0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-27 23:45 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f4e3f24cdc0bb812ab0ad597a819b546a347e67d
commit f4e3f24cdc0bb812ab0ad597a819b546a347e67d
Author: Josh Kunz <jkz@google.com>
Date: Thu Jan 23 17:37:14 2020 -0800
Additional fixes for llvm-as
Unlike GCC, llvm always uses an integrated assembler, which attempts to
recognized all `asm` statements written in the C code. glibc uses some
syntactically invalid asm statements to emit constants into assembly that
are later extracted with a sed or AWK script.
This change fixes two such invalid `asm` statements by wrapping the
output in a `.ascii` directive.. This does not break the sed/AWK (the same
special sequence is output) but it makes the statement syntactically valid.
See cf8e3f8757 for a previous fix for the same issue.
Diff:
---
sysdeps/gnu/errlist.awk | 2 +-
sysdeps/gnu/errlist.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sysdeps/gnu/errlist.awk b/sysdeps/gnu/errlist.awk
index 9a5adf86a6..cc07510e10 100644
--- a/sysdeps/gnu/errlist.awk
+++ b/sysdeps/gnu/errlist.awk
@@ -105,6 +105,6 @@ END {
print "";
print "#ifdef EMIT_ERR_MAX";
print "void dummy (void)"
- print "{ asm volatile (\" @@@ %0 @@@ \" : : \"i\" (ERR_REMAP (ERR_MAX))); }"
+ print "{ asm volatile (\".ascii \\\" @@@ %0 @@@ \\\"\" : : \"i\" (ERR_REMAP (ERR_MAX))); }"
print "#endif";
}
diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c
index 4a1c093ed0..5345df0268 100644
--- a/sysdeps/gnu/errlist.c
+++ b/sysdeps/gnu/errlist.c
@@ -1478,5 +1478,5 @@ const int _sys_nerr_internal = NERR;
#ifdef EMIT_ERR_MAX
void dummy (void)
-{ asm volatile (" @@@ %0 @@@ " : : "i" (ERR_REMAP (ERR_MAX))); }
+{ asm volatile (".ascii \" @@@ %0 @@@ \"" : : "i" (ERR_REMAP (ERR_MAX))); }
#endif
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-28 0:33 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:33 [glibc/maskray/grte] Additional fixes for llvm-as Fangrui Song
-- strict thread matches above, loose matches on Subject: below --
2021-08-28 0:28 Fangrui Song
2021-08-27 23:45 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).