Use C preprocessor comments in assembly headers.
We generate .S files for assembly, which means they run through the C preprocessor first. In gas targets where # is the comment marker, there is a conflict with cpp directives. The comments actually rely on #This and #source not being directives. If I begin a line with "if", the build fails. Since the C preprocessor is responsible for removing C preprocessor comments, we should be able to safely use // everywhere with less ambiguity. (In fact, we were already relying on this for 32-bit ARM. The 32-bit ARM gas line comment marker is @. 64-bit ARM uses //, and x86/x86_64/ppc64 use #.) This reportedly causes issues for goma. See https://bugs.chromium.org/p/boringssl/issues/detail?id=448#c3 Bug: 448 Change-Id: Ib58f3152691c1dbcccfc045f21f486b56824283d Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/49965 Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
committed by
Adam Langley
parent
45608a1b9f
commit
08dee19b7b
@@ -256,8 +256,8 @@ my $darn = sub {
|
||||
};
|
||||
|
||||
print <<___;
|
||||
# This file is generated from a similarly-named Perl script in the BoringSSL
|
||||
# source tree. Do not edit by hand.
|
||||
// This file is generated from a similarly-named Perl script in the BoringSSL
|
||||
// source tree. Do not edit by hand.
|
||||
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(memory_sanitizer) && !defined(OPENSSL_NO_ASM)
|
||||
|
||||
@@ -1136,7 +1136,7 @@ my $endbranch = sub {
|
||||
########################################################################
|
||||
|
||||
{
|
||||
my $comment = "#";
|
||||
my $comment = "//";
|
||||
$comment = ";" if ($masm || $nasm);
|
||||
print <<___;
|
||||
$comment This file is generated from a similarly-named Perl script in the BoringSSL
|
||||
|
||||
@@ -275,7 +275,7 @@ sub ::asciz
|
||||
|
||||
sub ::asm_finish
|
||||
{ &file_end();
|
||||
my $comment = "#";
|
||||
my $comment = "//";
|
||||
$comment = ";" if ($win32);
|
||||
print <<___;
|
||||
$comment This file is generated from a similarly-named Perl script in the BoringSSL
|
||||
|
||||
Reference in New Issue
Block a user