aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordtorilov <dtorilov@yandex-team.com>2023-07-19 18:04:52 +0300
committerdtorilov <dtorilov@yandex-team.com>2023-07-19 18:04:52 +0300
commitc98261a5002451209d47b09981427aa75a0e6907 (patch)
tree8190771218d14ea3b2e925efb94f517f3342e30e
parent29ab18afdb3aca70fc943207733eba6959b38392 (diff)
downloadydb-c98261a5002451209d47b09981427aa75a0e6907.tar.gz
Add wasm64-unknown-emscripten target
-rw-r--r--build/conf/compilers/gnu_compiler.conf4
-rw-r--r--build/conf/linkers/ld.conf9
-rwxr-xr-xbuild/ymake_conf.py11
3 files changed, 22 insertions, 2 deletions
diff --git a/build/conf/compilers/gnu_compiler.conf b/build/conf/compilers/gnu_compiler.conf
index 97e6f94abc..d6c8165949 100644
--- a/build/conf/compilers/gnu_compiler.conf
+++ b/build/conf/compilers/gnu_compiler.conf
@@ -52,6 +52,10 @@ when ($ARCH_XTENSA == "yes") {
FSTACK=
}
+when ($OS_EMSCRIPTEN == "yes") {
+ FSTACK=-fno-stack-protector
+}
+
CFLAGS+=$_C_FLAGS $DEBUG_INFO_FLAGS $_C_FOPTIONS $C_WARNING_OPTS $GCC_PREPROCESSOR_OPTS $USER_CFLAGS $USER_CFLAGS_GLOBAL
CXXFLAGS+=$CFLAGS $_CXX_STD $CXX_WARNING_OPTS $USER_CXXFLAGS $USER_CXXFLAGS_GLOBAL
CONLYFLAGS+=$USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL
diff --git a/build/conf/linkers/ld.conf b/build/conf/linkers/ld.conf
index c0fea5f0d3..2ec22beff0 100644
--- a/build/conf/linkers/ld.conf
+++ b/build/conf/linkers/ld.conf
@@ -102,6 +102,9 @@ when ($MUSL == "yes") {
_C_SYSTEM_LIBRARIES=-nostdlib
}
C_SYSTEM_LIBRARIES=$_C_SYSTEM_LIBRARIES
+when ($OS_EMSCRIPTEN == "yes") {
+ C_SYSTEM_LIBRARIES=-nostdlib
+}
OBJADDE=
@@ -156,7 +159,13 @@ _EXE_FLAGS=\
$_LINKER_TIME_TRACE_FLAG
_SONAME_FLAG=-Wl,$_SONAME_OPTION,$_SONAME
+when ($OS_EMSCRIPTEN == "yes") {
+ _SONAME_FLAG=
+}
_SHARED_FLAG=-shared
+when ($OS_EMSCRIPTEN == "yes") {
+ _SHARED_FLAG=-Wl,-shared -Wl,--no-entry -Wl,--export-all -Wl,--import-memory -Wl,--import-undefined
+}
_EXEC_SHARED_FLAG=
when ($OS_LINUX == "yes") {
_EXEC_SHARED_FLAG=-pie -fPIE -Wl,--unresolved-symbols=ignore-all -rdynamic
diff --git a/build/ymake_conf.py b/build/ymake_conf.py
index 022394d3b2..f68fcd10c8 100755
--- a/build/ymake_conf.py
+++ b/build/ymake_conf.py
@@ -88,8 +88,11 @@ class Platform(object):
self.is_power9le = self.arch == 'power9le'
self.is_powerpc = self.is_power8le or self.is_power9le
+ self.is_wasm64 = self.arch == 'wasm64'
+ self.is_wasm = self.is_wasm64
+
self.is_32_bit = self.is_x86 or self.is_armv7 or self.is_armv8m or self.is_riscv32 or self.is_nds32 or self.is_armv7em or self.is_xtensa
- self.is_64_bit = self.is_x86_64 or self.is_armv8 or self.is_powerpc
+ self.is_64_bit = self.is_x86_64 or self.is_armv8 or self.is_powerpc or self.is_wasm64
assert self.is_32_bit or self.is_64_bit
assert not (self.is_32_bit and self.is_64_bit)
@@ -120,6 +123,7 @@ class Platform(object):
self.is_cygwin = self.os == 'cygwin'
self.is_yocto = self.os == 'yocto'
+ self.is_emscripten = self.os == 'emscripten'
self.is_none = self.os == 'none'
@@ -170,6 +174,7 @@ class Platform(object):
(self.is_riscv32, 'ARCH_RISCV32'),
(self.is_xtensa, 'ARCH_XTENSA'),
(self.is_nds32, 'ARCH_NDS32'),
+ (self.is_wasm64, 'ARCH_WASM64'),
(self.is_32_bit, 'ARCH_TYPE_32'),
(self.is_64_bit, 'ARCH_TYPE_64'),
))
@@ -1224,6 +1229,8 @@ class GnuToolchain(Toolchain):
(target.is_android and target.is_x86_64, 'x86_64-linux-android'),
(target.is_android and target.is_armv7, 'armv7a-linux-androideabi'),
(target.is_android and target.is_armv8, 'aarch64-linux-android'),
+
+ (target.is_emscripten and target.is_wasm64, 'wasm64-unknown-emscripten'),
])
if target.is_android:
@@ -1612,7 +1619,7 @@ class Linker(object):
# Android toolchain is NDK, LLD works on all supported platforms
return Linker.LLD
- elif self.build.target.is_linux or self.build.target.is_macos or self.build.target.is_ios:
+ elif self.build.target.is_linux or self.build.target.is_macos or self.build.target.is_ios or self.build.target.is_wasm:
return Linker.LLD
# There is no linker choice on Windows (link.exe)