feat: cross compiler riscv64 support
This commit is contained in:
parent
d0e46369af
commit
504e9ded2e
39 changed files with 253 additions and 30 deletions
|
|
@ -39,6 +39,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -96,6 +96,16 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -47,6 +47,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -95,6 +95,11 @@ in
|
|||
host = "x86_64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -26,17 +26,9 @@ let
|
|||
../patches/libstdc++-target.patch
|
||||
];
|
||||
|
||||
ldLinux =
|
||||
if platform.target.double == "aarch64-linux" then
|
||||
"ld-linux-aarch64.so.1"
|
||||
else if platform.target.double == "x86_64-linux" then
|
||||
"ld-linux-x86-64.so.2"
|
||||
else
|
||||
"ld-linux.so.2";
|
||||
|
||||
gccFlags = [
|
||||
"-Wl,-dynamic-linker"
|
||||
"-Wl,${config.deps.target.target.glibc.package}/lib/${ldLinux}"
|
||||
"-Wl,${config.deps.target.target.glibc.dynamicLinker}"
|
||||
"-B${config.deps.target.target.glibc.package}/lib"
|
||||
];
|
||||
|
||||
|
|
@ -99,6 +91,11 @@ in
|
|||
host = "x86_64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
@ -186,7 +183,7 @@ in
|
|||
env = {
|
||||
CC = "gcc -Wl,-dynamic-linker";
|
||||
CXX = "g++ -Wl,-dynamic-linker";
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.target.target.glibc.package}/lib/${ldLinux} -B${config.deps.target.target.glibc.package}/lib";
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.target.target.glibc.dynamicLinker} -B${config.deps.target.target.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET = "-L$(pwd)/${platform.target.triple}/libgcc -L${config.deps.target.target.glibc.package}/lib";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -26,18 +26,13 @@ let
|
|||
../patches/libstdc++-target.patch
|
||||
];
|
||||
|
||||
ldLinux =
|
||||
if platform.target.double == "aarch64-linux" then
|
||||
"ld-linux-aarch64.so.1"
|
||||
else if platform.target.double == "x86_64-linux" then
|
||||
"ld-linux-x86-64.so.2"
|
||||
else
|
||||
"ld-linux.so.2";
|
||||
|
||||
gccFlags = [
|
||||
"-Wl,-dynamic-linker"
|
||||
"-Wl,${config.deps.host.host.glibc.package}/lib/${ldLinux}"
|
||||
"-Wl,${config.deps.host.host.glibc.dynamicLinker}"
|
||||
"-B${config.deps.host.host.glibc.package}/lib"
|
||||
]
|
||||
++ lib.lists.when (config.platform.target == "riscv64-linux") [
|
||||
"-L${config.package.outPath}/lib"
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
|
|
@ -186,7 +181,7 @@ in
|
|||
};
|
||||
|
||||
env = {
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.host.host.glibc.package}/lib/${ldLinux}";
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.host.host.glibc.dynamicLinker}";
|
||||
LIBRARY_PATH = "${config.deps.host.host.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET = "-L$(pwd)/${platform.target.triple}/libgcc -L${config.deps.host.host.glibc.package}/lib";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,18 +22,13 @@ let
|
|||
../patches/libstdc++-target.patch
|
||||
];
|
||||
|
||||
ldLinux =
|
||||
if platform.target.double == "aarch64-linux" then
|
||||
"ld-linux-aarch64.so.1"
|
||||
else if platform.target.double == "x86_64-linux" then
|
||||
"ld-linux-x86-64.so.2"
|
||||
else
|
||||
"ld-linux.so.2";
|
||||
|
||||
gccFlags = [
|
||||
"-Wl,-dynamic-linker"
|
||||
"-Wl,${config.deps.host.host.glibc.package}/lib/${ldLinux}"
|
||||
"-Wl,${config.deps.host.host.glibc.dynamicLinker}"
|
||||
"-B${config.deps.host.host.glibc.package}/lib"
|
||||
]
|
||||
++ lib.lists.when (config.platform.target == "riscv64-linux") [
|
||||
"-L${config.package.outPath}/lib"
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
|
|
@ -91,6 +86,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
@ -161,7 +161,7 @@ in
|
|||
};
|
||||
|
||||
env = {
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${"${config.deps.host.host.glibc.package}/lib/${ldLinux}"}";
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.host.host.glibc.dynamicLinker}";
|
||||
LIBRARY_PATH = "${config.deps.host.host.glibc.package}/lib";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,14 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
dynamicLinker = lib.options.create {
|
||||
type = lib.types.string;
|
||||
default = "ld-linux-x86-64.so.2";
|
||||
description = "The dynamic linker/loader to be used.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
meta = {
|
||||
description = "The GNU C Library.";
|
||||
|
|
@ -38,8 +46,15 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
dynamicLinker = package.dynamicLinker;
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
settings = {
|
||||
derivation = package.package;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,14 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
dynamicLinker = lib.options.create {
|
||||
type = lib.types.string;
|
||||
default = "ld-linux-x86-64.so.2";
|
||||
description = "The dynamic linker/loader to be used.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
meta = {
|
||||
description = "The GNU C Library.";
|
||||
|
|
@ -36,6 +44,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
@ -88,6 +101,19 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
dynamicLinker =
|
||||
"${config.package.outPath}/lib/"
|
||||
+ (
|
||||
if platform.target.double == "x86_64-linux" then
|
||||
"ld-linux-x86-64.so.2"
|
||||
else if platform.target.double == "aarch64-linux" then
|
||||
"ld-linux-aarch64.so.1"
|
||||
else if platform.target.double == "riscv64-linux" then
|
||||
"ld-linux-riscv64-lp64d.so.1"
|
||||
else
|
||||
"ld-linux.so.2"
|
||||
);
|
||||
|
||||
phases = {
|
||||
unpack = ''
|
||||
tar xf ${config.src}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -41,6 +41,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,16 @@ in
|
|||
host = "x86_64-linux";
|
||||
target = "x86_64-linux";
|
||||
}
|
||||
{
|
||||
build = "aarch64-linux";
|
||||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,11 @@ in
|
|||
host = "x86_64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,16 @@ in
|
|||
host = "x86_64-linux";
|
||||
target = "x86_64-linux";
|
||||
}
|
||||
{
|
||||
build = "aarch64-linux";
|
||||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,11 @@ in
|
|||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,16 @@ in
|
|||
host = "x86_64-linux";
|
||||
target = "x86_64-linux";
|
||||
}
|
||||
{
|
||||
build = "aarch64-linux";
|
||||
host = "aarch64-linux";
|
||||
target = "aarch64-linux";
|
||||
}
|
||||
{
|
||||
build = "riscv64-linux";
|
||||
host = "riscv64-linux";
|
||||
target = "riscv64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.basic;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue