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

lib.systems.examples: use four component triples for embedded #247490

Open
wants to merge 5 commits into
base: staging
Choose a base branch
from
Open
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
22 changes: 11 additions & 11 deletions lib/systems/examples.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,22 @@ rec {
riscv32 = riscv "32";

riscv64-embedded = {
config = "riscv64-none-elf";
config = "riscv64-unknown-none-elf";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config = "riscv64-unknown-none-elf";
config = "riscv64-none-elf";
libc = "newlib";
};
riscv64-embedded-canonical = {
config = "riscv64-unknown-none-elf";
libc = "newlib";
};

libc = "newlib";
};

riscv32-embedded = {
config = "riscv32-none-elf";
config = "riscv32-unknown-none-elf";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config = "riscv32-unknown-none-elf";
config = "riscv32-none-elf";
libc = "newlib";
};
riscv32-embedded-canonical = {
config = "riscv32-unknown-none-elf";
libc = "newlib";
};

libc = "newlib";
};

mips64-embedded = {
config = "mips64-none-elf";
config = "mips64-unknown-none-elf";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config = "mips64-unknown-none-elf";
config = "mips64-none-elf";
libc = "newlib";
};
mips64-embedded-canonical = {
config = "mips64-unknown-none-elf";
libc = "newlib";
};

libc = "newlib";
};

mips-embedded = {
config = "mips-none-elf";
config = "mips-unknown-none-elf";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config = "mips-unknown-none-elf";
config = "mips-none-elf";
libc = "newlib";
};
mips-embedded-canonical = {
config = "riscv64-unknown-none-elf";
libc = "newlib";
};

libc = "newlib";
};

Expand All @@ -153,7 +153,7 @@ rec {
};

rx-embedded = {
config = "rx-none-elf";
config = "rx-unknown-none-elf";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config = "rx-unknown-none-elf";
config = "rx-none-elf";
libc = "newlib";
};
rx-embedded-canonical = {
config = "rx-unknown-none-elf";
libc = "newlib";
};

libc = "newlib";
};

Expand Down Expand Up @@ -189,11 +189,11 @@ rec {
};

arm-embedded = {
config = "arm-none-eabi";
config = "arm-unknown-none-eabi";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config = "arm-unknown-none-eabi";
config = "arm-none-elf";
libc = "newlib";
};
arm-embedded-canonical = {
config = "arm-unknown-none-elf";
libc = "newlib";
};

libc = "newlib";
};
armhf-embedded = {
config = "arm-none-eabihf";
config = "arm-unknown-none-eabihf";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config = "arm-unknown-none-eabihf";
config = "arm-none-eabihf";
libc = "newlib";
};
armhf-embedded-canonical = {
config = "arm-unknown-none-eabihf";
libc = "newlib";
};

libc = "newlib";
# GCC8+ does not build without this
# (https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg552339.html):
Expand All @@ -204,22 +204,22 @@ rec {
};

aarch64-embedded = {
config = "aarch64-none-elf";
config = "aarch64-unknown-none-elf";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config = "aarch64-unknown-none-elf";
config = "aarch64-none-elf";
libc = "newlib";
};
aarch64-embedded-canonical = {
config = "aarch64-unknown-none-elf";
libc = "newlib";
};

libc = "newlib";
};

aarch64be-embedded = {
config = "aarch64_be-none-elf";
config = "aarch64_be-unknown-none-elf";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config = "aarch64_be-unknown-none-elf";
config = "aarch64_be-none-elf";
libc = "newlib";
};
aarch64_be-embedded-canonical = {
config = "aarch64_be-unknown-none-elf";
libc = "newlib";
};

libc = "newlib";
};

ppc-embedded = {
config = "powerpc-none-eabi";
config = "powerpc-unknown-none-eabi";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config = "powerpc-unknown-none-eabi";
config = "powerpc-none-elf";
libc = "newlib";
};
ppc-embedded-canonical = {
config = "powerpc-unknown-none-elf";
libc = "newlib";
};

libc = "newlib";
};

ppcle-embedded = {
config = "powerpcle-none-eabi";
config = "powerpcle-unknown-none-eabi";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config = "powerpcle-unknown-none-eabi";
config = "powerpcle-none-elf";
libc = "newlib";
};
powerpcle-embedded-canonical = {
config = "powerpcle-unknown-none-elf";
libc = "newlib";
};

libc = "newlib";
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/virtualization/spike/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
runHook preInstallCheck

echo -e "#include<stdio.h>\nint main() {printf(\"Hello, world\");return 0;}" > hello.c
${riscvPkgs.stdenv.cc}/bin/riscv64-none-elf-gcc -o hello hello.c
${riscvPkgs.stdenv.cc}/bin/${riscvPkgs.stdenv.cc.targetPrefix}cc -o hello hello.c
$out/bin/spike -m64 ${riscvPkgs.riscv-pk}/bin/pk hello | grep -Fq "Hello, world"

runHook postInstallCheck
Expand Down
10 changes: 9 additions & 1 deletion pkgs/development/tools/fusee-launcher/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
, makeWrapper
} :

let
gcc-arm-embedded = pkgsCross.arm-embedded.buildPackages.gcc;
in

stdenv.mkDerivation {
pname = "fusee-launcher";
version = "unstable-2018-07-14";
Expand All @@ -17,6 +21,10 @@ stdenv.mkDerivation {
sha256 = "1pqkgw5bk0xcz9x7pc1f0r0b9nsc8jnnvcs1315d8ml8mx23fshm";
};

makeFlags = [
"CROSS_COMPILE=${gcc-arm-embedded.targetPrefix}"
];

installPhase = ''
mkdir -p $out/bin $out/share
cp fusee-launcher.py $out/bin/fusee-launcher
Expand All @@ -28,7 +36,7 @@ stdenv.mkDerivation {
--prefix PYTHONPATH : "$PYTHONPATH:$(toPythonPath $out)"
'';

nativeBuildInputs = [ pkgsCross.arm-embedded.buildPackages.gcc makeWrapper python3Packages.wrapPython ];
nativeBuildInputs = [ gcc-arm-embedded makeWrapper python3Packages.wrapPython ];
buildInputs = [ python3 python3Packages.pyusb ];
pythonPath = with python3Packages; [ pyusb ];

Expand Down
2 changes: 2 additions & 0 deletions pkgs/misc/arm-trusted-firmware/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ let
buildInputs = [ openssl ];

makeFlags = [
"HOSTCC=$(CC_FOR_BUILD)"
"M0_CROSS_COMPILE=${pkgsCross.arm-embedded.stdenv.cc.targetPrefix}"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
# binutils 2.39 regression
# `warning: /build/source/build/rk3399/release/bl31/bl31.elf has a LOAD segment with RWX permissions`
Expand Down
2 changes: 1 addition & 1 deletion pkgs/stdenv/cross/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ in lib.init bootStages ++ [
(hostPlatform.isLinux && !buildPlatform.isLinux)
[ buildPackages.patchelf ]
++ lib.optional
(let f = p: !p.isx86 || builtins.elem p.libc [ "musl" "wasilibc" "relibc" ] || p.isiOS || p.isGenode;
(let f = p: !p.isx86 || builtins.elem p.libc [ "musl" "wasilibc" "relibc" ] || p.isiOS || p.isGenode || p.isNone;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(let f = p: !p.isx86 || builtins.elem p.libc [ "musl" "wasilibc" "relibc" ] || p.isiOS || p.isGenode || p.isNone;
(let f = p: !p.isx86 || builtins.elem p.libc [ "musl" "wasilibc" "relibc" ] || p.isiOS || p.isGenode || (p.vendor=="unknown" && p.isNone);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the change that most needs to be double-checked. I'll do that if the general approach is agreeable to you.

in f hostPlatform && !(f buildPlatform) )
buildPackages.updateAutotoolsGnuConfigScriptsHook
;
Expand Down