summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Kunz <jkz@google.com>2020-01-23 17:37:14 -0800
committerFangrui Song <i@maskray.me>2021-08-27 17:26:04 -0700
commitcb908840466823a53c03da86e65118eb7467ab0b (patch)
treeb7088310f77bc70e859a8c2a9a8078efab865542
parent144448d56646f119c227f171473372855dd17e95 (diff)
downloadglibc-cb908840466823a53c03da86e65118eb7467ab0b.tar.gz
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.
-rw-r--r--sysdeps/gnu/errlist.awk2
-rw-r--r--sysdeps/gnu/errlist.c2
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