On 12/11/2017 01:52 AM, Marcus Johnson wrote:
Ok, I undid my __asm fix, and changed the define to what you suggested here, and cleaned and recompiled and it also worked with your fix.

Thanks for checking. I installed that patch (attached) and am closing the bug.

>From f46906b5f70f0f9b62d3bfc3687e0c5cca29a641 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Tue, 12 Dec 2017 16:41:21 -0800
Subject: [PATCH] explicit_bzero: port to macOS + Clang 9.0.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Problem reported by Marcus Johnson (Bug#29658).
* lib/explicit_bzero.c (explicit_bzero) [__clang__]:
Don’t use asm.
---
 ChangeLog            | 7 +++++++
 lib/explicit_bzero.c | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 0993f4e06..8030b8065 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-12-12  Paul Eggert  <[email protected]>
+
+	explicit_bzero: port to macOS + Clang 9.0.0
+	Problem reported by Marcus Johnson (Bug#29658).
+	* lib/explicit_bzero.c (explicit_bzero) [__clang__]:
+	Don’t use asm.
+
 2017-12-11  Reuben Thomas  <[email protected]>
 
 	doc: Improve explanation of supporting relocatable libraries.
diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c
index fa06478d0..001278479 100644
--- a/lib/explicit_bzero.c
+++ b/lib/explicit_bzero.c
@@ -40,7 +40,7 @@ explicit_bzero (void *s, size_t len)
   explicit_memset (s, 0, len);
 #else
   memset (s, '\0', len);
-# ifdef __GNUC__
+# if defined __GNUC__ && !defined __clang__
   /* Compiler barrier.  */
   asm volatile ("" ::: "memory");
 # endif
-- 
2.14.3

Reply via email to