Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Linux RISC-V 64 #261

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ include Makefile.common

linux-armv6-digest:=@sha256:7bad6ab302af34bdf6634c8c2b02c8dc6ac932c67da9ecc199c549ab405e971e
linux-x86-digest:=@sha256:7a8fda5ff1bb436ac1f2e7d40043deb630800fce33d123d04779d48f85702dcd
linux-riscv64-digest:=@sha256:e10e1d3588cffffaf4d0721825e4f952710ad29d4b6630ea76d353914ffdc415
windows-static-x86-digest:=@sha256:896bd4a43bbc89502904afdc8d00e6f2422f8f35852cc59777d6426bfc8491e8
windows-static-x64-digest:=@sha256:f159861bc80b29e5dafb223477167bec53ecec6cdacb051d31e90c5823542100
windows-arm64-digest:=@sha256:f4b3c1a49ec8b53418cef1499dc3f9a54a5570b7a3ecdf42fc8c83eb94b01b7d
Expand Down Expand Up @@ -121,6 +122,12 @@ linux-ppc64: download-includes
docker run -it --rm -v $$PWD:/workdir --user $$(id -u):$$(id -g) \
-e CROSS_TRIPLE=powerpc64le-linux-gnu multiarch/crossbuild$(cross-build-digest) make clean-native native OS_NAME=Linux OS_ARCH=ppc64

target/dockcross/dockcross-linux-riscv64: dockcross
docker run --rm dockcross/linux-riscv64$(linux-riscv64-digest) > target/dockcross/dockcross-linux-riscv64
chmod +x target/dockcross/dockcross-linux-riscv64
linux-riscv64: download-includes target/dockcross/dockcross-linux-riscv64
target/dockcross/dockcross-linux-riscv64 bash -c 'make clean-native native CROSS_PREFIX=riscv64-unknown-linux-gnu- OS_NAME=Linux OS_ARCH=riscv64'

target/dockcross/dockcross-windows-static-x86: dockcross
docker run --rm dockcross/windows-static-x86$(windows-static-x86-digest) > target/dockcross/dockcross-windows-static-x86
chmod +x target/dockcross/dockcross-windows-static-x86
Expand Down
7 changes: 7 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ Linux-ppc64_LINKFLAGS := -shared -static-libgcc
Linux-ppc64_LIBNAME := libjansi.so
Linux-ppc64_JANSI_FLAGS :=

Linux-riscv64_CC := $(CROSS_PREFIX)gcc
Linux-riscv64_STRIP := $(CROSS_PREFIX)strip
Linux-riscv64_CCFLAGS := -I$(JAVA_HOME)/include -Itarget/inc -Itarget/inc/unix -Os -fPIC -fvisibility=hidden
Linux-riscv64_LINKFLAGS := -shared -static-libgcc
Linux-riscv64_LIBNAME := libjansi.so
Linux-riscv64_JANSI_FLAGS :=

DragonFly-x86_64_CC := $(CROSS_PREFIX)cc
DragonFly-x86_64_STRIP := $(CROSS_PREFIX)strip
DragonFly-x86_64_CCFLAGS := -I$(JAVA_HOME)/include -Itarget/inc -Itarget/inc/unix -O2 -fPIC -fvisibility=hidden
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/fusesource/jansi/internal/OSInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class OSInfo {
public static final String PPC = "ppc";
public static final String PPC64 = "ppc64";
public static final String ARM64 = "arm64";
public static final String RISCV64 = "riscv64";

private static final HashMap<String, String> archMapping = new HashMap<String, String>();

Expand Down Expand Up @@ -92,6 +93,9 @@ public class OSInfo {

// aarch64 mappings
archMapping.put("aarch64", ARM64);

// riscv64 mappings
archMapping.put(RISCV64, RISCV64);
}

public static void main(String[] args) {
Expand Down