From 33f95e0e3d41262a6ebe023b2b2624d735539c6d Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 12 Sep 2019 16:38:39 -0400 Subject: 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') --- source/core/slang-common.h | 2 +- source/core/slang-gcc-compiler-util.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'source') 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 -#include +#include #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: -- cgit v1.2.3