From efa7f9f49c1491483910d438b3d5be927c9e5ddc Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Wed, 27 Dec 2017 23:21:37 -0800
Subject: [PATCH 2001/2002] xray: Define O_CLOEXEC for older SDKs that don't
 have it

diff --git llvm_master/projects/compiler-rt/lib/xray/xray_x86_64.cpp macports_master/projects/compiler-rt/lib/xray/xray_x86_64.cpp
index e63ee1b3b..65b59ec61 100644
--- llvm_master/projects/compiler-rt/lib/xray/xray_x86_64.cpp
+++ macports_master/projects/compiler-rt/lib/xray/xray_x86_64.cpp
@@ -26,6 +26,12 @@
 #include <tuple>
 #include <unistd.h>
 
+#ifdef __APPLE__
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0x1000000
+#endif
+#endif
+
 namespace __xray {
 
 #if SANITIZER_LINUX
-- 
2.21.0 (Apple Git-120)

