]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Additional fixes for llvm-as
authorJosh Kunz <jkz@google.com>
Fri, 24 Jan 2020 01:37:14 +0000 (17:37 -0800)
committerFangrui Song <i@maskray.me>
Sat, 28 Aug 2021 00:26:04 +0000 (17:26 -0700)
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.

sysdeps/gnu/errlist.awk
sysdeps/gnu/errlist.c

index 9a5adf86a6aa6b70f090de91dd8ab160c0c11c86..cc07510e10306693169e670135a21d712da13763 100644 (file)
@@ -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";
 }
index 4a1c093ed0ee327d1d92e6c509fe2ffc3557c1b2..5345df026876974e31c3aff469f65ee8254caea9 100644 (file)
@@ -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