From cb908840466823a53c03da86e65118eb7467ab0b Mon Sep 17 00:00:00 2001 From: Josh Kunz Date: Thu, 23 Jan 2020 17:37:14 -0800 Subject: 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. --- sysdeps/gnu/errlist.awk | 2 +- sysdeps/gnu/errlist.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps') 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 -- cgit v1.2.1