1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
Relax Linux checks for the code works on any non-Windows platform
core/elf/writer.cpp:54:9: error:
use of undeclared identifier 'memcpy_s'
memcpy_s(data, queueFront.dataSize, queueFront.data.c_str(), queueFront.dataSize);
^
core/elf/writer.cpp:59:13: error:
use of undeclared identifier 'memcpy_s'
memcpy_s(curString, queueFront.name.size(), queueFront.name.c_str(), queueFront.name.size());
^
core/elf/writer.cpp:76:5: error:
use of undeclared identifier 'memcpy_s'
memcpy_s(curSectionHeader, sizeof(SElf64SectionHeader),
^
--- core/helpers/string.h.orig 2019-11-22 15:41:47 UTC
+++ core/helpers/string.h
@@ -10,7 +10,7 @@
#include <memory>
#include <type_traits>
-#if defined(__linux__)
+#if !defined(_WIN32)
#include <cstring>
#include <errno.h>
--- core/unit_tests/compiler_interface/compiler_interface_tests.cpp.orig 2019-11-22 15:41:47 UTC
+++ core/unit_tests/compiler_interface/compiler_interface_tests.cpp
@@ -24,7 +24,7 @@ using namespace NEO;
#if defined(_WIN32)
const char *gBadDompilerDllName = "bad_compiler.dll";
-#elif defined(__linux__)
+#elif !defined(__APPLE__)
const char *gCBadDompilerDllName = "libbad_compiler.so";
#else
#error "Unknown OS!"
--- core/unit_tests/helpers/memory_management.cpp.orig 2019-11-22 15:41:47 UTC
+++ core/unit_tests/helpers/memory_management.cpp
@@ -18,7 +18,7 @@
#include <iostream>
#include <new>
-#if defined(__linux__)
+#if !defined(__APPLE__) && !defined(_WIN32)
#include <cstdio>
#include <dlfcn.h>
#include <execinfo.h>
@@ -109,7 +109,7 @@ static void *allocate(size_t size) {
eventAllocation.address = p;
eventAllocation.event = typeValid;
-#if defined(__linux__)
+#if !defined(__APPLE__) && !defined(_WIN32)
eventAllocation.frames = logTraces ? (int)backtrace(eventAllocation.callstack, AllocationEvent::CallStackSize) : 0;
#elif defined(_WIN32)
eventAllocation.frames = logTraces ? CaptureStackBackTrace(0, AllocationEvent::CallStackSize, eventAllocation.callstack, NULL) : 0;
@@ -161,7 +161,7 @@ static void *allocate(size_t size, const std::nothrow_
: typeFail;
eventAllocation.address = p;
eventAllocation.size = size;
-#if defined(__linux__)
+#if !defined(__APPLE__) && !defined(_WIN32)
eventAllocation.frames = logTraces ? (int)backtrace(eventAllocation.callstack, AllocationEvent::CallStackSize) : 0;
#elif defined(_WIN32)
eventAllocation.frames = logTraces ? CaptureStackBackTrace(0, AllocationEvent::CallStackSize, eventAllocation.callstack, NULL) : 0;
@@ -206,7 +206,7 @@ static void deallocate(void *p) {
eventDeallocation.event = typeValid;
eventDeallocation.address = p;
eventDeallocation.size = -1;
-#if defined(__linux__)
+#if !defined(__APPLE__) && !defined(_WIN32)
eventDeallocation.frames = logTraces ? (int)backtrace(eventDeallocation.callstack, AllocationEvent::CallStackSize) : 0;
#elif defined(_WIN32)
eventDeallocation.frames = logTraces ? CaptureStackBackTrace(0, AllocationEvent::CallStackSize, eventDeallocation.callstack, NULL) : 0;
@@ -312,7 +312,7 @@ std::string printCallStack(const MemoryManagement::All
printf("for detailed stack information turn on captureCallStacks in memory_management.h\n");
}
if (event.frames > 0) {
-#if defined(__linux__)
+#if !defined(__APPLE__) && !defined(_WIN32)
char **bt = backtrace_symbols(event.callstack, event.frames);
char *demangled;
int status;
--- core/unit_tests/helpers/string_tests.cpp.orig 2019-11-22 15:41:47 UTC
+++ core/unit_tests/helpers/string_tests.cpp
@@ -10,7 +10,7 @@
#include "gtest/gtest.h"
-#if defined(__linux__)
+#if !defined(_WIN32)
TEST(StringHelpers, strncpy) {
char dst[1024] = "";
--- unit_tests/fixtures/memory_management_fixture.cpp.orig 2019-11-22 15:41:47 UTC
+++ unit_tests/fixtures/memory_management_fixture.cpp
@@ -12,12 +12,12 @@
#include "runtime/helpers/options.h"
#include <cinttypes>
-#if defined(__linux__)
+#if !defined(_WIN32)
#include <cstdio>
#include <cxxabi.h>
#include <dlfcn.h>
#include <execinfo.h>
-#elif defined(_WIN32)
+#else
#include <Windows.h>
#pragma warning(push) // Saves the current warning state.
#pragma warning(disable : 4091) // Temporarily disables warning 4091.
--- unit_tests/main.cpp.orig 2019-11-22 15:41:47 UTC
+++ unit_tests/main.cpp
@@ -104,7 +104,7 @@ void applyWorkarounds() {
tempThreadID = t.get_id();
t.join();
}
-#ifdef __linux__
+#ifndef _WIN32
void handle_SIGALRM(int signal) {
std::cout << "Tests timeout on: " << lastTest << std::endl;
abort();
@@ -158,7 +158,7 @@ std::string getRunPath(char *argv0) {
res = res.substr(0, pos);
if (res == "." || pos == std::string::npos) {
-#if defined(__linux__)
+#if !defined(_WIN32)
res = getcwd(nullptr, 0);
#else
res = _getcwd(nullptr, 0);
@@ -176,7 +176,7 @@ int main(int argc, char **argv) {
applyWorkarounds();
-#if defined(__linux__)
+#if !defined(_WIN32)
bool enable_segv = true;
bool enable_abrt = true;
if (getenv("IGDRCL_TEST_SELF_EXEC") == nullptr) {
@@ -373,7 +373,7 @@ int main(int argc, char **argv) {
if (_chdir(executionDirectory.c_str())) {
std::cout << "chdir into " << executionDirectory << " directory failed.\nThis might cause test failures." << std::endl;
}
-#elif defined(__linux__)
+#else
#include <unistd.h>
if (chdir(executionDirectory.c_str()) != 0) {
std::cout << "chdir into " << executionDirectory << " directory failed.\nThis might cause test failures." << std::endl;
@@ -412,7 +412,7 @@ int main(int argc, char **argv) {
gEnvironment->setMockFileNames(fclDebugVars.fileName, igcDebugVars.fileName);
gEnvironment->setDefaultDebugVars(fclDebugVars, igcDebugVars, device);
-#if defined(__linux__)
+#if !defined(_WIN32)
//ULTs timeout
if (enable_alarm) {
unsigned int alarmTime = NEO::ultIterationMaxTime * ::testing::GTEST_FLAG(repeat);
--- unit_tests/offline_compiler/main.cpp.orig 2019-11-22 15:41:47 UTC
+++ unit_tests/offline_compiler/main.cpp
@@ -14,7 +14,7 @@
#ifdef WIN32
const char *fSeparator = "\\";
-#elif defined(__linux__)
+#else
const char *fSeparator = "/";
#endif
@@ -22,7 +22,7 @@ Environment *gEnvironment;
std::string getRunPath() {
std::string res;
-#if defined(__linux__)
+#if !defined(_WIN32)
res = getcwd(nullptr, 0);
#else
res = _getcwd(nullptr, 0);
@@ -36,7 +36,7 @@ int main(int argc, char **argv) {
std::string devicePrefix("skl");
std::string familyNameWithType("Gen9core");
-#if defined(__linux__)
+#if !defined(_WIN32)
if (getenv("CLOC_SELFTEST") == nullptr) {
setenv("CLOC_SELFTEST", "YES", 1);
@@ -88,7 +88,7 @@ int main(int argc, char **argv) {
if (_chdir(familyNameWithType.c_str())) {
std::cout << "chdir into " << familyNameWithType << " directory failed.\nThis might cause test failures." << std::endl;
}
-#elif defined(__linux__)
+#else
#include <unistd.h>
if (chdir(familyNameWithType.c_str()) != 0) {
std::cout << "chdir into " << familyNameWithType << " directory failed.\nThis might cause test failures." << std::endl;
--- unit_tests/os_interface/linux/options.cpp.orig 2019-11-22 15:41:47 UTC
+++ unit_tests/os_interface/linux/options.cpp
@@ -15,7 +15,7 @@ namespace Os {
// These options determine the Linux specific behavior for
// the runtime unit tests
///////////////////////////////////////////////////////////////////////////////
-#if defined(__linux__)
+#if !defined(__APPLE__) && !defined(_WIN32)
const char *frontEndDllName = "libmock_igdfcl.so";
const char *igcDllName = "libmock_igc.so";
const char *libvaDllName = nullptr;
--- unit_tests/os_interface/os_library_tests.cpp.orig 2019-11-22 15:41:47 UTC
+++ unit_tests/os_interface/os_library_tests.cpp
@@ -7,7 +7,7 @@
#if defined(_WIN32)
#include "core/os_interface/windows/os_library_win.h"
-#elif defined(__linux__)
+#else
#include "core/os_interface/linux/os_library_linux.h"
#endif
#include "core/os_interface/os_library.h"
|