Page MenuHome GnuPG

0001-configure.ac-fix-Intel-syntax-check-with-clang-flto.patch

Authored By
jukivili
Jan 21 2021, 9:19 PM
Size
1 KB
Subscribers
None

0001-configure.ac-fix-Intel-syntax-check-with-clang-flto.patch

From 0578f7e3d01d1c32707f99026e70df994f0495bd Mon Sep 17 00:00:00 2001
From: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Date: Thu, 21 Jan 2021 17:56:32 +0200
Subject: [PATCH 1/2] configure.ac: fix Intel syntax check with "clang -flto"
* configure.ac (gcry_cv_gcc_platform_as_ok_for_intel_syntax): Run
check through linker.
--
LTO with clang causes assembly to be checked at linker stage
instead of compiler stage.
GnuPG-bug-id: 5255
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
---
configure.ac | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index bcbd16d7..634ac2b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1719,9 +1719,11 @@ AC_CACHE_CHECK([whether GCC assembler is compatible for Intel syntax assembly im
gcry_cv_gcc_platform_as_ok_for_intel_syntax="n/a"
else
gcry_cv_gcc_platform_as_ok_for_intel_syntax=no
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[__asm__(
".intel_syntax noprefix\n\t"
+ ".text\n\t"
+ "actest:\n\t"
"pxor xmm1, xmm7;\n\t"
/* Intel syntax implementation also use GAS macros, so check
* for them here. */
@@ -1738,7 +1740,8 @@ AC_CACHE_CHECK([whether GCC assembler is compatible for Intel syntax assembly im
"SET_VAL_B ebp\n\t"
"add VAL_A, VAL_B;\n\t"
"add VAL_B, 0b10101;\n\t"
- );]])],
+ ".att_syntax prefix\n\t"
+ );]], [ actest(); ])],
[gcry_cv_gcc_platform_as_ok_for_intel_syntax=yes])
fi])
if test "$gcry_cv_gcc_platform_as_ok_for_intel_syntax" = "yes" ; then
--
2.27.0

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1344461

Event Timeline