Skip to content

Commit

Permalink
Basic s390x and riscv64 build system support
Browse files Browse the repository at this point in the history
  • Loading branch information
riptl committed Jan 8, 2025
1 parent 8f77acd commit e086acd
Show file tree
Hide file tree
Showing 21 changed files with 98 additions and 22 deletions.
2 changes: 2 additions & 0 deletions config/extra/with-arm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ include config/extra/with-openssl.mk
include config/extra/with-rocksdb.mk

endif

FD_ARCH_SUPPORTS_SANDBOX:=1
2 changes: 2 additions & 0 deletions config/extra/with-x86-64.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ include config/extra/with-zstd.mk
include config/extra/with-lz4.mk
include config/extra/with-openssl.mk
include config/extra/with-rocksdb.mk

FD_ARCH_SUPPORTS_SANDBOX:=1
2 changes: 1 addition & 1 deletion config/machine/linux_clang_haswell.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
BUILDDIR?=linux/clang/haswell

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-clang.mk
include config/extra/with-x86-64.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-threads.mk
Expand Down
2 changes: 1 addition & 1 deletion config/machine/linux_clang_icelake.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
BUILDDIR?=linux/clang/icelake

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-clang.mk
include config/extra/with-x86-64.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-threads.mk
Expand Down
2 changes: 1 addition & 1 deletion config/machine/linux_clang_minimal.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
BUILDDIR:=linux/clang/minimal

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-clang.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk

Expand Down
2 changes: 1 addition & 1 deletion config/machine/linux_clang_noarch128.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
BUILDDIR:=linux/clang/noarch128

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-clang.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-threads.mk
Expand Down
2 changes: 1 addition & 1 deletion config/machine/linux_clang_noarch64.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
BUILDDIR?=linux/clang/noarch64

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-clang.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-threads.mk
Expand Down
2 changes: 1 addition & 1 deletion config/machine/linux_clang_x86_64.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
BUILDDIR?=linux/clang/x86_64

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-clang.mk
include config/extra/with-x86-64.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-threads.mk
Expand Down
2 changes: 1 addition & 1 deletion config/machine/linux_clang_zen2.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
BUILDDIR?=linux/clang/zen2

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-clang.mk
include config/extra/with-x86-64.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-threads.mk
Expand Down
2 changes: 1 addition & 1 deletion config/machine/linux_gcc_icelake.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
BUILDDIR?=linux/gcc/icelake

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-gcc.mk
include config/extra/with-x86-64.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-threads.mk
Expand Down
2 changes: 1 addition & 1 deletion config/machine/linux_gcc_minimal.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
BUILDDIR:=linux/gcc/minimal

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-gcc.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk

Expand Down
2 changes: 1 addition & 1 deletion config/machine/linux_gcc_noarch128.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
BUILDDIR:=linux/gcc/noarch128

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-gcc.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-threads.mk
Expand Down
2 changes: 1 addition & 1 deletion config/machine/linux_gcc_noarch64.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
BUILDDIR:=linux/gcc/noarch64

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-gcc.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-threads.mk
Expand Down
26 changes: 19 additions & 7 deletions config/machine/linux_gcc_power9.mk
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
BUILDDIR:=linux/gcc/power9

include config/base.mk
include config/extra/with-clang.mk
include config/extra/with-debug.mk
include config/extra/with-gcc.mk

CPPFLAGS:=-mcpu=power9
LDFLAGS:=-lm

ifneq ($(shell uname -m),ppc64le)
CROSS=1
endif

ifeq ($(CROSS),1)
CC:=powerpc64le-linux-gnu-gcc
CXX:=powerpc64le-linux-gnu-g++
LD:=powerpc64le-linux-gnu-g++
endif

include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-threads.mk

CPPFLAGS+=-D_XOPEN_SOURCE=700
CPPFLAGS+=-DFD_HAS_INT128=1 -DFD_HAS_DOUBLE=1 -DFD_HAS_ALLOCA=1
CPPFLAGS+=-DFD_ENV_STYLE=0 -DFD_IO_STYLE=0 -DFD_LOG_STYLE=0
CPPFLAGS+=-DFD_HAS_ATOMIC=1

FD_HAS_INT128:=1
FD_HAS_DOUBLE:=1
FD_HAS_ALLOCA:=1
FD_HAS_ATOMIC:=1

29 changes: 29 additions & 0 deletions config/machine/linux_gcc_riscv.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BUILDDIR:=linux/gcc/riscv

include config/base.mk
include config/extra/with-gcc.mk

CPPFLAGS:=
LDFLAGS:=-lm

ifneq ($(shell uname -m),ppc64le)
CROSS=1
endif

ifeq ($(CROSS),1)
CC:=riscv64-linux-gnu-gcc
CXX:=riscv64-linux-gnu-g++
LD:=riscv64-linux-gnu-g++
endif

include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-threads.mk

CPPFLAGS+=-DFD_HAS_INT128=1 -DFD_HAS_DOUBLE=1 -DFD_HAS_ALLOCA=1

FD_HAS_INT128:=1
FD_HAS_DOUBLE:=1
FD_HAS_ALLOCA:=1
29 changes: 29 additions & 0 deletions config/machine/linux_gcc_s390x.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BUILDDIR:=linux/gcc/s390x

include config/base.mk
include config/extra/with-gcc.mk

CPPFLAGS:=
LDFLAGS:=-lm

ifneq ($(shell uname -m),s390x)
CROSS=1
endif

ifeq ($(CROSS),1)
CC:=s390x-linux-gnu-gcc
CXX:=s390x-linux-gnu-g++
LD:=s390x-linux-gnu-g++
endif

include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-threads.mk

CPPFLAGS+=-DFD_HAS_INT128=1 -DFD_HAS_DOUBLE=1 -DFD_HAS_ALLOCA=1

FD_HAS_INT128:=1
FD_HAS_DOUBLE:=1
FD_HAS_ALLOCA:=1
2 changes: 1 addition & 1 deletion config/machine/linux_gcc_x86_64.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
BUILDDIR?=linux/gcc/x86_64

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-gcc.mk
include config/extra/with-x86-64.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-threads.mk
Expand Down
2 changes: 1 addition & 1 deletion config/machine/linux_gcc_zen2.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
BUILDDIR?=linux/gcc/zen2

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-gcc.mk
include config/extra/with-x86-64.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-threads.mk
Expand Down
2 changes: 1 addition & 1 deletion config/machine/linux_gcc_zen4.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
BUILDDIR?=linux/gcc/zen4

include config/base.mk
include config/extra/with-security.mk
include config/extra/with-gcc.mk
include config/extra/with-x86-64.mk
include config/extra/with-debug.mk
include config/extra/with-security.mk
include config/extra/with-brutality.mk
include config/extra/with-optimization.mk
include config/extra/with-threads.mk
Expand Down
2 changes: 1 addition & 1 deletion src/util/fd_util_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ __extension__ typedef unsigned __int128 uint128;

#if defined(__aarch64__)
#define FD_ASM_LG_ALIGN(lg_n) ".align " #lg_n "\n"
#elif defined(__x86_64__) || defined(__powerpc64__)
#elif defined(__x86_64__) || defined(__powerpc64__) || defined(__riscv) || defined(__s390x__)
#define FD_ASM_LG_ALIGN(lg_n) ".p2align " #lg_n "\n"
#endif

Expand Down
2 changes: 2 additions & 0 deletions src/util/sandbox/Local.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
ifdef FD_HAS_HOSTED
ifdef FD_HAS_LINUX
ifdef FD_ARCH_SUPPORTS_SANDBOX
$(call add-hdrs,fd_sandbox.h)
$(call add-objs,fd_sandbox,fd_util)
$(call make-unit-test,test_sandbox,test_sandbox,fd_util)
endif
endif
endif

0 comments on commit e086acd

Please sign in to comment.