Skip to content

Commit

Permalink
Removed support for Native Client. https://developer.chrome.com/nativ…
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaradzic committed May 31, 2017
1 parent 8aa70cc commit 41da51d
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 251 deletions.
2 changes: 0 additions & 2 deletions include/bx/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#ifndef BX_CONFIG_CRT_FILE_READER_WRITER
# define BX_CONFIG_CRT_FILE_READER_WRITER !(0 \
|| BX_PLATFORM_NACL \
|| BX_CRT_NONE \
)
#endif // BX_CONFIG_CRT_FILE_READER_WRITER
Expand All @@ -27,7 +26,6 @@
# define BX_CONFIG_CRT_PROCESS !(0 \
|| BX_CRT_NONE \
|| BX_PLATFORM_EMSCRIPTEN \
|| BX_PLATFORM_NACL \
|| BX_PLATFORM_PS4 \
|| BX_PLATFORM_WINRT \
|| BX_PLATFORM_XBOXONE \
Expand Down
11 changes: 0 additions & 11 deletions include/bx/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
#define BX_PLATFORM_HURD 0
#define BX_PLATFORM_IOS 0
#define BX_PLATFORM_LINUX 0
#define BX_PLATFORM_NACL 0
#define BX_PLATFORM_OSX 0
#define BX_PLATFORM_PS4 0
#define BX_PLATFORM_QNX 0
Expand Down Expand Up @@ -181,11 +180,6 @@
# include <sys/cdefs.h> // Defines __BIONIC__ and includes android/api-level.h
# undef BX_PLATFORM_ANDROID
# define BX_PLATFORM_ANDROID __ANDROID_API__
#elif defined(__native_client__)
// NaCl compiler defines __linux__
# include <ppapi/c/pp_macros.h>
# undef BX_PLATFORM_NACL
# define BX_PLATFORM_NACL PPAPI_RELEASE
#elif defined(__STEAMLINK__)
// SteamLink compiler defines __linux__
# undef BX_PLATFORM_STEAMLINK
Expand Down Expand Up @@ -263,7 +257,6 @@
|| BX_PLATFORM_HURD \
|| BX_PLATFORM_IOS \
|| BX_PLATFORM_LINUX \
|| BX_PLATFORM_NACL \
|| BX_PLATFORM_OSX \
|| BX_PLATFORM_QNX \
|| BX_PLATFORM_STEAMLINK \
Expand All @@ -278,7 +271,6 @@
|| BX_PLATFORM_HURD \
|| BX_PLATFORM_IOS \
|| BX_PLATFORM_LINUX \
|| BX_PLATFORM_NACL \
|| BX_PLATFORM_OSX \
|| BX_PLATFORM_PS4 \
|| BX_PLATFORM_QNX \
Expand Down Expand Up @@ -334,9 +326,6 @@
# define BX_PLATFORM_NAME "iOS"
#elif BX_PLATFORM_LINUX
# define BX_PLATFORM_NAME "Linux"
#elif BX_PLATFORM_NACL
# define BX_PLATFORM_NAME "NaCl " \
BX_STRINGIZE(BX_PLATFORM_NACL)
#elif BX_PLATFORM_OSX
# define BX_PLATFORM_NAME "OSX"
#elif BX_PLATFORM_PS4
Expand Down
31 changes: 0 additions & 31 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ all:
$(GENIE) --gcc=android-arm gmake
$(GENIE) --gcc=android-mips gmake
$(GENIE) --gcc=android-x86 gmake
$(GENIE) --gcc=nacl gmake
$(GENIE) --gcc=nacl-arm gmake
$(GENIE) --gcc=pnacl gmake
$(GENIE) --gcc=mingw-gcc gmake
$(GENIE) --gcc=linux-gcc gmake
$(GENIE) --gcc=osx gmake
Expand Down Expand Up @@ -87,34 +84,6 @@ mingw-clang: mingw-clang-debug32 mingw-clang-release32 mingw-clang-debug64 mingw
.build/projects/vs2013:
$(GENIE) vs2013

.build/projects/gmake-nacl:
$(GENIE) --gcc=nacl gmake
nacl-debug32: .build/projects/gmake-nacl
make -R -C .build/projects/gmake-nacl config=debug32
nacl-release32: .build/projects/gmake-nacl
make -R -C .build/projects/gmake-nacl config=release32
nacl-debug64: .build/projects/gmake-nacl
make -R -C .build/projects/gmake-nacl config=debug64
nacl-release64: .build/projects/gmake-nacl
make -R -C .build/projects/gmake-nacl config=release64
nacl: nacl-debug32 nacl-release32 nacl-debug64 nacl-release64

.build/projects/gmake-nacl-arm:
$(GENIE) --gcc=nacl-arm gmake
nacl-arm-debug: .build/projects/gmake-nacl-arm
make -R -C .build/projects/gmake-nacl-arm config=debug
nacl-arm-release: .build/projects/gmake-nacl-arm
make -R -C .build/projects/gmake-nacl-arm config=release
nacl-arm: nacl-arm-debug32 nacl-arm-release32

.build/projects/gmake-pnacl:
$(GENIE) --gcc=pnacl gmake
pnacl-debug: .build/projects/gmake-pnacl
make -R -C .build/projects/gmake-pnacl config=debug
pnacl-release: .build/projects/gmake-pnacl
make -R -C .build/projects/gmake-pnacl config=release
pnacl: pnacl-debug pnacl-release

.build/projects/gmake-osx:
$(GENIE) --gcc=osx gmake
osx-debug32: .build/projects/gmake-osx
Expand Down
28 changes: 0 additions & 28 deletions scripts/genie.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,6 @@ project "bx.test"
"-shared",
}

configuration { "nacl or nacl-arm" }
targetextension ".nexe"
links {
"ppapi",
"pthread",
}

configuration { "pnacl" }
targetextension ".pexe"
links {
"ppapi",
"pthread",
}

configuration { "linux-*" }
links {
"pthread",
Expand Down Expand Up @@ -134,20 +120,6 @@ project "bx.bench"
"-shared",
}

configuration { "nacl or nacl-arm" }
targetextension ".nexe"
links {
"ppapi",
"pthread",
}

configuration { "pnacl" }
targetextension ".pexe"
links {
"ppapi",
"pthread",
}

configuration { "linux-*" }
links {
"pthread",
Expand Down
147 changes: 0 additions & 147 deletions scripts/toolchain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
--

local bxDir = path.getabsolute("..")
local naclToolchain = ""

local function crtNone()

Expand Down Expand Up @@ -69,11 +68,8 @@ function toolchain(_buildDir, _libDir)
{ "tvos-simulator", "tvOS - Simulator" },
{ "mingw-gcc", "MinGW" },
{ "mingw-clang", "MinGW (clang compiler)" },
{ "nacl", "Native Client" },
{ "nacl-arm", "Native Client - ARM" },
{ "netbsd", "NetBSD" },
{ "osx", "OSX" },
{ "pnacl", "Native Client - PNaCl" },
{ "orbis", "Orbis" },
{ "qnx-arm", "QNX/Blackberry - ARM" },
{ "riscv", "RISC-V" },
Expand Down Expand Up @@ -347,42 +343,6 @@ function toolchain(_buildDir, _libDir)
-- premake.gcc.llvm = true
location (path.join(_buildDir, "projects", _ACTION .. "-mingw-clang"))

elseif "nacl" == _OPTIONS["gcc"] then

if not os.getenv("NACL_SDK_ROOT") then
print("Set NACL_SDK_ROOT enviroment variable.")
end

naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_x86_glibc/bin/x86_64-nacl-"
if os.is("macosx") then
naclToolchain = "$(NACL_SDK_ROOT)/toolchain/mac_x86_glibc/bin/x86_64-nacl-"
elseif os.is("linux") then
naclToolchain = "$(NACL_SDK_ROOT)/toolchain/linux_x86_glibc/bin/x86_64-nacl-"
end

premake.gcc.cc = naclToolchain .. "gcc"
premake.gcc.cxx = naclToolchain .. "g++"
premake.gcc.ar = naclToolchain .. "ar"
location (path.join(_buildDir, "projects", _ACTION .. "-nacl"))

elseif "nacl-arm" == _OPTIONS["gcc"] then

if not os.getenv("NACL_SDK_ROOT") then
print("Set NACL_SDK_ROOT enviroment variable.")
end

naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_arm_glibc/bin/arm-nacl-"
if os.is("macosx") then
naclToolchain = "$(NACL_SDK_ROOT)/toolchain/mac_arm_glibc/bin/arm-nacl-"
elseif os.is("linux") then
naclToolchain = "$(NACL_SDK_ROOT)/toolchain/linux_arm_glibc/bin/arm-nacl-"
end

premake.gcc.cc = naclToolchain .. "gcc"
premake.gcc.cxx = naclToolchain .. "g++"
premake.gcc.ar = naclToolchain .. "ar"
location (path.join(_buildDir, "projects", _ACTION .. "-nacl-arm"))

elseif "netbsd" == _OPTIONS["gcc"] then
location (path.join(_buildDir, "projects", _ACTION .. "-netbsd"))

Expand All @@ -400,24 +360,6 @@ function toolchain(_buildDir, _libDir)
end
location (path.join(_buildDir, "projects", _ACTION .. "-osx"))

elseif "pnacl" == _OPTIONS["gcc"] then

if not os.getenv("NACL_SDK_ROOT") then
print("Set NACL_SDK_ROOT enviroment variable.")
end

naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_pnacl/bin/pnacl-"
if os.is("macosx") then
naclToolchain = "$(NACL_SDK_ROOT)/toolchain/mac_pnacl/bin/pnacl-"
elseif os.is("linux") then
naclToolchain = "$(NACL_SDK_ROOT)/toolchain/linux_pnacl/bin/pnacl-"
end

premake.gcc.cc = naclToolchain .. "clang"
premake.gcc.cxx = naclToolchain .. "clang++"
premake.gcc.ar = naclToolchain .. "ar"
location (path.join(_buildDir, "projects", _ACTION .. "-pnacl"))

elseif "orbis" == _OPTIONS["gcc"] then

if not os.getenv("SCE_ORBIS_SDK_DIR") then
Expand Down Expand Up @@ -1037,83 +979,6 @@ function toolchain(_buildDir, _libDir)
path.join(bxDir, "include/compat/freebsd"),
}

configuration { "nacl or nacl-arm or pnacl" }
buildoptions {
"-U__STRICT_ANSI__", -- strcasecmp, setenv, unsetenv,...
"-fno-stack-protector",
"-fdiagnostics-show-option",
"-fdata-sections",
"-ffunction-sections",
"-Wunused-value",
"-Wundef",
}
buildoptions_cpp {
"-std=c++11",
}
includedirs {
"$(NACL_SDK_ROOT)/include",
path.join(bxDir, "include/compat/nacl"),
}

configuration { "nacl" }
buildoptions {
"-pthread",
"-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic.
"-msse2",
}
linkoptions {
"-Wl,--gc-sections",
}

configuration { "x32", "nacl" }
targetdir (path.join(_buildDir, "nacl-x86/bin"))
objdir (path.join(_buildDir, "nacl-x86/obj"))
libdirs { path.join(_libDir, "lib/nacl-x86") }
linkoptions { "-melf32_nacl" }

configuration { "x32", "nacl", "Debug" }
libdirs { "$(NACL_SDK_ROOT)/lib/glibc_x86_32/Debug" }

configuration { "x32", "nacl", "Release" }
libdirs { "$(NACL_SDK_ROOT)/lib/glibc_x86_32/Release" }

configuration { "x64", "nacl" }
targetdir (path.join(_buildDir, "nacl-x64/bin"))
objdir (path.join(_buildDir, "nacl-x64/obj"))
libdirs { path.join(_libDir, "lib/nacl-x64") }
linkoptions { "-melf64_nacl" }

configuration { "x64", "nacl", "Debug" }
libdirs { "$(NACL_SDK_ROOT)/lib/glibc_x86_64/Debug" }

configuration { "x64", "nacl", "Release" }
libdirs { "$(NACL_SDK_ROOT)/lib/glibc_x86_64/Release" }

configuration { "nacl-arm" }
buildoptions {
"-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
}
targetdir (path.join(_buildDir, "nacl-arm/bin"))
objdir (path.join(_buildDir, "nacl-arm/obj"))
libdirs { path.join(_libDir, "lib/nacl-arm") }

configuration { "nacl-arm", "Debug" }
libdirs { "$(NACL_SDK_ROOT)/lib/glibc_arm/Debug" }

configuration { "nacl-arm", "Release" }
libdirs { "$(NACL_SDK_ROOT)/lib/glibc_arm/Release" }

configuration { "pnacl" }
targetdir (path.join(_buildDir, "pnacl/bin"))
objdir (path.join(_buildDir, "pnacl/obj"))
libdirs { path.join(_libDir, "lib/pnacl") }

configuration { "pnacl", "Debug" }
libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Debug" }

configuration { "pnacl", "Release" }
libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Release" }

configuration { "xbox360" }
targetdir (path.join(_buildDir, "xbox360/bin"))
objdir (path.join(_buildDir, "xbox360/obj"))
Expand Down Expand Up @@ -1420,18 +1285,6 @@ function strip()
"$(SILENT) $(MINGW)/bin/strip -s \"$(TARGET)\""
}

configuration { "pnacl" }
postbuildcommands {
"$(SILENT) echo Running pnacl-finalize.",
"$(SILENT) " .. naclToolchain .. "finalize \"$(TARGET)\""
}

configuration { "*nacl*", "Release" }
postbuildcommands {
"$(SILENT) echo Stripping symbols.",
"$(SILENT) " .. naclToolchain .. "strip -s \"$(TARGET)\""
}

configuration { "asmjs" }
postbuildcommands {
"$(SILENT) echo Running asmjs finalize.",
Expand Down
2 changes: 1 addition & 1 deletion src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace bx
#elif BX_CPU_ARM
__builtin_trap();
// asm("bkpt 0");
#elif !BX_PLATFORM_NACL && BX_CPU_X86 && (BX_COMPILER_GCC || BX_COMPILER_CLANG)
#elif BX_CPU_X86 && (BX_COMPILER_GCC || BX_COMPILER_CLANG)
// NaCl doesn't like int 3:
// NativeClient: NaCl module load failed: Validation failure. File violates Native Client safety rules.
__asm__ ("int $3");
Expand Down
1 change: 0 additions & 1 deletion src/mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#if BX_PLATFORM_ANDROID \
|| BX_PLATFORM_LINUX \
|| BX_PLATFORM_NACL \
|| BX_PLATFORM_IOS \
|| BX_PLATFORM_OSX \
|| BX_PLATFORM_PS4 \
Expand Down
Loading

0 comments on commit 41da51d

Please sign in to comment.