From bec84b6503e55093b4b9fb5865788625fa2cf9b6 Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 23 Jan 2018 17:26:10 -0500
Subject: [PATCH] P4 to Git Change 1506901 by lmoriche@lmoriche_opencl_dev2 on
2018/01/23 17:08:11
SWDEV-1 - Cleanups required to build with gcc-5.4
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#171 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/glibc_functions.cpp#1 add
... //depot/stg/opencl/drivers/opencl/compiler/sclibdefs.opencl#24 edit
... //depot/stg/opencl/drivers/opencl/compiler/spirv-tools/spirvdefs#2 edit
... //depot/stg/opencl/drivers/opencl/compiler/tools/caching/cache.cpp#14 edit
... //depot/stg/opencl/drivers/opencl/make/llvm.git/llvmdefs#10 edit
... //depot/stg/opencl/drivers/opencl/opencldefs#225 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbe/build/Makefile.palbe#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbe/src/core/imported/jemalloc/make/Makefile.jemalloc#3 edit
... //depot/stg/opencl/drivers/opencl/support/libcxx/build/Makefile.libcxx#6 edit
... //depot/stg/opencl/drivers/opencl/tools/clinfo/clinfo.cpp#4 edit
[ROCm/clr commit: 59df136c4c3db31d5d2136394262136632a3a173]
---
.../api/opencl/amdocl/glibc_functions.cpp | 19 +++++++++++++++++++
projects/clr/opencl/tools/clinfo/clinfo.cpp | 2 +-
2 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 projects/clr/opencl/api/opencl/amdocl/glibc_functions.cpp
diff --git a/projects/clr/opencl/api/opencl/amdocl/glibc_functions.cpp b/projects/clr/opencl/api/opencl/amdocl/glibc_functions.cpp
new file mode 100644
index 0000000000..9ae576196d
--- /dev/null
+++ b/projects/clr/opencl/api/opencl/amdocl/glibc_functions.cpp
@@ -0,0 +1,19 @@
+#if defined(__linux__)
+
+#include
+
+#if defined(__cplusplus)
+extern "C" {
+#endif // __cplusplus
+
+asm (".symver memcpy, memcpy@GLIBC_2.2.5");
+void *__wrap_memcpy(void *dest, const void *src, size_t n)
+{
+ return memcpy(dest, src, n);
+}
+
+#if defined(__cplusplus)
+}
+#endif // __cplusplus)
+
+#endif // __linux__
diff --git a/projects/clr/opencl/tools/clinfo/clinfo.cpp b/projects/clr/opencl/tools/clinfo/clinfo.cpp
index 48a3d0094b..4d49c8db89 100644
--- a/projects/clr/opencl/tools/clinfo/clinfo.cpp
+++ b/projects/clr/opencl/tools/clinfo/clinfo.cpp
@@ -155,7 +155,7 @@ main(int argc, char** argv)
err = cl::Platform::get(&platforms);
checkErr(
- err && (platforms.size() == 0 ? -1 : CL_SUCCESS),
+ platforms.size() == 0 ? -1 : err,
"cl::Platform::get()");
try {