summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-09-12 16:38:39 -0400
committerGitHub <noreply@github.com>2019-09-12 16:38:39 -0400
commit33f95e0e3d41262a6ebe023b2b2624d735539c6d (patch)
treed05c09cced0a539ec1da3ebfe159e5a5f478ac65 /source
parentbde858b31ac99b84ffba546d1022b34bb4621d49 (diff)
Fix problems with x86 CPU tests (#1051)
* Try to make x86 builds on x86 platforms (not the default for the os). * Use c style include for stdint.h cos not found on x86 linux. * Simplified x86 issue for linux. * Fix typo. * Remove the need for the shared-library category. * Disable CPU tests on linux x86. * Fix typo. * Named test requirement methods so overloading not confusing (around flags, and SlangPassThroughType which are both 'int')
Diffstat (limited to 'source')
-rw-r--r--source/core/slang-common.h2
-rw-r--r--source/core/slang-gcc-compiler-util.cpp14
2 files changed, 15 insertions, 1 deletions
diff --git a/source/core/slang-common.h b/source/core/slang-common.h
index 7d8568642..717b63740 100644
--- a/source/core/slang-common.h
+++ b/source/core/slang-common.h
@@ -5,7 +5,7 @@
#include <assert.h>
-#include <cstdint>
+#include <stdint.h>
#ifdef __GNUC__
#define CORE_LIB_ALIGN_16(x) x __attribute__((aligned(16)))
diff --git a/source/core/slang-gcc-compiler-util.cpp b/source/core/slang-gcc-compiler-util.cpp
index 21b55e686..3c4c4ec15 100644
--- a/source/core/slang-gcc-compiler-util.cpp
+++ b/source/core/slang-gcc-compiler-util.cpp
@@ -407,6 +407,20 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse
cmdLine.addArg("-std=c++14");
}
+ // TODO(JS): Here we always set -m32 on x86. It could be argued it is only necessary when creating a shared library
+ // but if we create an object file, we don't know what to choose because we don't know what final usage is.
+ // It could also be argued that the platformKind could define the actual desired target - but as it stands
+ // we only have a target of 'Linux' (as opposed to Win32/64). Really it implies we need an arch enumeration too.
+ //
+ // For now we just make X86 binaries try and produce x86 compatible binaries as fixes the immediate problems.
+#if SLANG_PROCESSOR_X86
+ /* Used to specify the processor more broadly. For a x86 binary we need to make sure we build x86 builds
+ even when on an x64 system.
+ -m32
+ -m64*/
+ cmdLine.addArg("-m32");
+#endif
+
switch (options.optimizationLevel)
{
case OptimizationLevel::None: