A bunch of unstaged stuff I found months later

This commit is contained in:
Ehmry - 2021-12-10 10:07:57 +00:00
parent 2b1c9d710a
commit ad9261c0ac
34 changed files with 634 additions and 618 deletions

View File

@ -5,11 +5,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1615634419, "lastModified": 1617699750,
"narHash": "sha256-VSPhQ2wvwrPbnfxPGsXQe3lTEsTOk9mUjfD/WVDPskM=", "narHash": "sha256-jVsaLrPxppRW40hob3OR1tspdWcWXRwvu2mGVGqH/2Y=",
"owner": "nix-community", "owner": "nix-community",
"repo": "flake-nimble", "repo": "flake-nimble",
"rev": "79d42ec0ba0349a967b38db70ae2e3e2f6d9c3e2", "rev": "5d7a9c0d28472ad2ded4c3c335b8d3b1f6a65e6d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -33,16 +33,16 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1617984351, "lastModified": 1618995560,
"narHash": "sha256-mo/tmR1sVmQ+4uziIAZpdNnr9AG0NAAo9Md3tucf73k=", "narHash": "sha256-pqMtPTgqWatdhIPBxENaZPKSirJ2AMYegkNBnD9ur4A=",
"owner": "NixOS", "owner": "ehmry",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "842f900e73c7ce985218cc4f455e34d1d56475c1", "rev": "efc09182fa0cc67721c878d6da48ea968c99984e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "ehmry",
"ref": "nixpkgs-unstable", "ref": "sigil",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@ -1,7 +1,7 @@
{ {
description = "Nix flavored Genode distribution"; description = "Nix flavored Genode distribution";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; inputs.nixpkgs.url = "github:ehmry/nixpkgs/sigil";
outputs = { self, nixpkgs, nimble }: outputs = { self, nixpkgs, nimble }:
let let

View File

@ -30,6 +30,7 @@ in λ ( params
λ(binary : Text) → λ(binary : Text) →
Init.toChild Init.toChild
Init::{ Init::{
, verbose = True
, routes = [ Init.ServiceRoute.parent "Timer" ] , routes = [ Init.ServiceRoute.parent "Timer" ]
, children = toMap , children = toMap
{ terminal = { terminal =
@ -99,7 +100,7 @@ in λ ( params
( toMap ( toMap
{ name = "regular" { name = "regular"
, path = params.fontFile , path = params.fontFile
, size_px = "10" , size_px = "8"
} }
) )
] ]

View File

@ -5,29 +5,34 @@ let toDhall = lib.generators.toDhall { };
in { in {
imports = [ ./ahci.nix ./framebuffer.nix ./nic.nix ./usb.nix ]; imports = [ ./ahci.nix ./framebuffer.nix ./nic.nix ./usb.nix ];
options.hardware.genode.platform.policies = lib.mkOption { options.hardware.genode = {
type = with types; listOf path; verbose = lib.mkEnableOption "verbose drivers";
default = [ ]; platform.policies = lib.mkOption {
description = '' type = with types; listOf path;
List of policies to append to the Genode platform driver. default = [ ];
Type is Init.Config.Policy.Type. description = ''
''; List of policies to append to the Genode platform driver.
Type is Init.Config.Policy.Type.
'';
};
}; };
config = let config = let
deviceManagerEnable = config.hardware.genode.ahci.enable cfg = config.hardware.genode;
|| config.hardware.genode.usb.enable;
deviceManagerEnable = cfg.ahci.enable || cfg.usb.enable;
ahciEris = lib.getEris "bin" pkgs.genodePackages.ahci_drv; ahciEris = lib.getEris "bin" pkgs.genodePackages.ahci_drv;
partBlockEris = lib.getEris "bin" pkgs.genodePackages.part_block; partBlockEris = lib.getEris "bin" pkgs.genodePackages.part_block;
usbEris = lib.attrsets.mapAttrs (_: lib.getEris "bin") { usbEris = lib.attrsets.mapAttrs (_: lib.getEris "bin") {
inherit (pkgs.genodePackages) usb_block_drv usb_drv; usb_block_drv = cfg.usb.storage.package;
usb_host_drv = cfg.usb.host.package;
}; };
ahciConfig = with config.hardware.genode.ahci; ahciConfig = with cfg.ahci;
lib.optionalString enable '' lib.optionalString enable ''
, ahci_driver = Some ${ , ahci_drv = Some ${
toDhall { toDhall {
binary = ahciEris.cap; binary = ahciEris.cap;
atapi = atapiSupport; atapi = atapiSupport;
@ -35,20 +40,20 @@ in {
} }
''; '';
usbConfig = with config.hardware.genode.usb; usbConfig = lib.optionalString cfg.usb.enable ''
lib.optionalString enable '' , usb_block_drv = Some { binary = "${usbEris.usb_block_drv.cap}" }
, usb_block = Some { binary = "${usbEris.usb_block_drv.cap}" } , usb_host_drv = Some ${
, usb_driver = Some ${ with cfg.usb.host;
toDhall { toDhall {
binary = usbEris.usb_drv.cap; binary = usbEris.usb_host_drv.cap;
bios_handoff = biosHandoff; bios_handoff = biosHandoff;
ehci = ehciSupport; ehci = ehciSupport;
ohci = ohciSupport; ohci = ohciSupport;
uhci = uhciSupport; uhci = uhciSupport;
xhci = xhciSupport; xhci = xhciSupport;
}
} }
''; }
'';
managerConfig = pkgs.writeText "device_manager.dhall" '' managerConfig = pkgs.writeText "device_manager.dhall" ''
let Manager = ${pkgs.genodePackages.device_manager.dhall}/package.dhall let Manager = ${pkgs.genodePackages.device_manager.dhall}/package.dhall
@ -58,6 +63,7 @@ in {
, part_block.binary = "${partBlockEris.cap}" , part_block.binary = "${partBlockEris.cap}"
${ahciConfig} ${ahciConfig}
${usbConfig} ${usbConfig}
, verbose = ${toDhall cfg.verbose}
} }
''; '';
in { in {
@ -124,9 +130,8 @@ in {
genode.core.children.drivers = lib.mkIf deviceManagerEnable { genode.core.children.drivers = lib.mkIf deviceManagerEnable {
package = pkgs.genodePackages.init; package = pkgs.genodePackages.init;
extraErisInputs = [ partBlockEris ] extraErisInputs = [ partBlockEris ]
++ lib.optional config.hardware.genode.ahci.enable ahciEris ++ lib.optional cfg.ahci.enable ahciEris
++ lib.optionals config.hardware.genode.usb.enable ++ lib.optionals cfg.usb.enable (builtins.attrValues usbEris);
(builtins.attrValues usbEris);
configFile = pkgs.writeText "drivers.dhall" '' configFile = pkgs.writeText "drivers.dhall" ''
let Sigil = env:DHALL_SIGIL let Sigil = env:DHALL_SIGIL

View File

@ -42,6 +42,12 @@ in {
Init.Child.flat Init.Child.flat
Init.Child.Attributes::{ Init.Child.Attributes::{
, binary , binary
, config = Init.Config::{
, attributes = toMap
{ width = "1024"
, height = "768"
}
}
, resources = Init.Resources::{ caps = 256, ram = Sigil.units.MiB 32 } , resources = Init.Resources::{ caps = 256, ram = Sigil.units.MiB 32 }
, routes = , routes =
[ Init.ServiceRoute.parent "IO_MEM" [ Init.ServiceRoute.parent "IO_MEM"

View File

@ -10,21 +10,32 @@ in {
options.hardware.genode.usb = { options.hardware.genode.usb = {
enable = lib.mkEnableOption "USB driver"; enable = lib.mkEnableOption "USB driver";
storage.enable = lib.mkEnableOption "USB mass storage driver";
biosHandoff = mkEnableOption' "perform the BIOS handoff procedure" true; host = {
package = lib.mkOption {
type = types.package;
default = pkgs.genodePackages.usb_host_drv;
description = "USB host driver package.";
};
biosHandoff = mkEnableOption' "perform the BIOS handoff procedure" true;
ehciSupport = mkEnableOption' "EHCI support" true;
ohciSupport = mkEnableOption' "OHCI support" true;
uhciSupport = mkEnableOption' "UHCI support" true;
xhciSupport = mkEnableOption' "XHCI support" true;
};
storage = {
enable = lib.mkEnableOption "USB mass storage driver";
package = lib.mkOption {
type = types.package;
default = pkgs.genodePackages.usb_block_drv;
description = "USB mass storage driver package.";
};
};
ehciSupport = mkEnableOption' "EHCI support" true;
ohciSupport = mkEnableOption' "OHCI support" true;
uhciSupport = mkEnableOption' "UHCI support" false;
xhciSupport = mkEnableOption' "XHCI support" true;
}; };
config = let config = let cfg = config.hardware.genode.usb;
cfg = config.hardware.genode.usb;
usbEris = lib.attrsets.mapAttrs (_: lib.getEris "bin") {
inherit (pkgs.genodePackages) part_block usb_block_drv usb_drv;
};
in { in {
hardware.genode.usb.enable = lib.mkDefault cfg.storage.enable; hardware.genode.usb.enable = lib.mkDefault cfg.storage.enable;

View File

@ -1,8 +1,6 @@
# Builds a compressed EFI System Partition image # Builds a compressed EFI System Partition image
{ config, lib, pkgs }: { config, lib, pkgs }:
with config.block.partitions;
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
name = "boot.qcow2"; name = "boot.qcow2";
@ -40,8 +38,8 @@ pkgs.stdenv.mkDerivation {
sfdisk $img <<EOF sfdisk $img <<EOF
label: gpt label: gpt
label-id: $disklabel label-id: $disklabel
start=$(( $storeByteOffset / $sectorSize )), uuid=${store.guid}, type=${store.gptType} start=$(( $storeByteOffset / $sectorSize )), uuid=${config.block.partitions.store.guid}, type=${store.gptType}
start=$(( $espByteOffset / $sectorSize )), uuid=${esp.guid}, type=${esp.gptType} start=$(( $espByteOffset / $sectorSize )), uuid=${config.block.partitions.esp.guid}, type=${esp.gptType}
EOF EOF
sfdisk --reorder $img sfdisk --reorder $img

View File

@ -51,9 +51,9 @@ in {
boot.loader.grub = { boot.loader.grub = {
extraEntries = '' extraEntries = ''
menuentry 'Genode on NOVA' { menuentry 'sigil-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}' {
insmod multiboot2
insmod gzio insmod gzio
insmod multiboot2
multiboot2 /boot/bender.gz serial_fallback multiboot2 /boot/bender.gz serial_fallback
module2 /boot/hypervisor.gz hypervisor iommu logmem novga novpid serial module2 /boot/hypervisor.gz hypervisor iommu logmem novga novpid serial
module2 /boot/image.elf.gz image.elf module2 /boot/image.elf.gz image.elf

View File

@ -5,7 +5,7 @@ with import ../tests/lib/qemu-flags.nix { inherit pkgs; };
let let
qemu = config.system.build.qemu; qemu = pkgs.buildPackages.buildPackages.qemu;
cfg = config.virtualisation; cfg = config.virtualisation;

View File

@ -3,7 +3,7 @@ final: prev:
with prev; with prev;
let let
# Helper functions to override package dependant # Helper functions to override package dependent
# on whether the host or target system is Genode. # on whether the host or target system is Genode.
overrideHost = attrs: drv: overrideHost = attrs: drv:
@ -32,8 +32,8 @@ let
if hostPlatform.isGenode then if hostPlatform.isGenode then
builtins.listToAttrs (map (name: { builtins.listToAttrs (map (name: {
inherit name; inherit name;
value = null; value = final.hello;
}) [ "iproute2" ]) }) [ "iproute2" "strace" ])
else else
{ }; { };
@ -43,7 +43,7 @@ in nullPkgs // {
configureFlags = attrs.configureFlags configureFlags = attrs.configureFlags
++ [ "--without-bash-malloc" ]; # no sbrk please ++ [ "--without-bash-malloc" ]; # no sbrk please
postPatch = "sed '/check_dev_tty/d' shell.c"; postPatch = "sed '/check_dev_tty/d' shell.c";
}) bash; }) prev.bash;
binutils-unwrapped = overrideAttrsTarget (attrs: { binutils-unwrapped = overrideAttrsTarget (attrs: {
patches = attrs.patches ++ [ patches = attrs.patches ++ [
@ -52,7 +52,7 @@ in nullPkgs // {
]; ];
nativeBuildInputs = attrs.nativeBuildInputs nativeBuildInputs = attrs.nativeBuildInputs
++ [ final.updateAutotoolsGnuConfigScriptsHook ]; ++ [ final.updateAutotoolsGnuConfigScriptsHook ];
}) binutils-unwrapped; }) prev.binutils-unwrapped;
cmake = cmake =
# TODO: upstream # TODO: upstream
@ -67,7 +67,7 @@ in nullPkgs // {
fi fi
cp ${./cmake/Genode.cmake} $MODULE cp ${./cmake/Genode.cmake} $MODULE
''; '';
}) cmake; }) prev.cmake;
coreutils = overrideHost { coreutils = overrideHost {
gmp = null; gmp = null;
@ -82,7 +82,7 @@ in nullPkgs // {
]; ];
LDFLAGS = [ "-Wl,--no-as-needed" ]; LDFLAGS = [ "-Wl,--no-as-needed" ];
# keep libposix NEEDED # keep libposix NEEDED
}) coreutils); }) prev.coreutils);
erisPatchHook = final.callPackage ./eris-patch-hook { erisPatchHook = final.callPackage ./eris-patch-hook {
patchelf = prev.patchelf.overrideAttrs (attrs: { patchelf = prev.patchelf.overrideAttrs (attrs: {
@ -97,7 +97,7 @@ in nullPkgs // {
gdb = addPatchesTarget [ gdb = addPatchesTarget [
./gdb/genode.patch ./gdb/genode.patch
# Upstreamed, remove at next release. # Upstreamed, remove at next release.
] gdb; ] prev.gdb;
genodeLibcCross = callPackage ./libc { }; genodeLibcCross = callPackage ./libc { };
@ -126,11 +126,11 @@ in nullPkgs // {
./libsodium/genode.patch ./libsodium/genode.patch
# https://github.com/jedisct1/libsodium/pull/1006 # https://github.com/jedisct1/libsodium/pull/1006
]; ];
}) libsodium; }) prev.libsodium;
libkrb5 = libkrb5 =
# Do not want. # Do not want.
autoreconfHost libkrb5; autoreconfHost prev.libkrb5;
libtool = libtool =
# Autotools related nonesense. Better to compile # Autotools related nonesense. Better to compile
@ -139,24 +139,27 @@ in nullPkgs // {
nativeBuildInputs = with final; nativeBuildInputs = with final;
attrs.nativeBuildInputs ++ [ autoconf automake115x ]; attrs.nativeBuildInputs ++ [ autoconf automake115x ];
patches = ./libtool/genode.patch; patches = ./libtool/genode.patch;
}) libtool; }) prev.libtool;
libtoxcore = overrideHost { libtoxcore = overrideHost {
libopus = null; libopus = null;
libvpx = null; libvpx = null;
} libtoxcore; } prev.libtoxcore;
linuxPackages = linuxPackages =
# Dummy package. # Dummy package.
if hostPlatform.isGenode then { if hostPlatform.isGenode then {
extend = _: final.linuxPackages; extend = _: final.linuxPackages;
features = { }; features = { };
kernel.config = { kernel = {
isEnabled = _: false; version = "999";
isYes = _: false; config = {
isEnabled = _: false;
isYes = _: false;
};
}; };
} else } else
linuxPackages; prev.linuxPackages;
llvmPackages_11 = if targetPlatform.isGenode then llvmPackages_11 = if targetPlatform.isGenode then
# A copy of the LLVM expressions from Nixpkgs. # A copy of the LLVM expressions from Nixpkgs.
@ -175,7 +178,7 @@ in nullPkgs // {
ncurses = ncurses =
# https://invisible-island.net/autoconf/ # https://invisible-island.net/autoconf/
# Stay clear of upstream on this one. # Stay clear of upstream on this one.
addPatchesHost [ ./ncurses/genode.patch ] ncurses; addPatchesHost [ ./ncurses/genode.patch ] prev.ncurses;
nim-unwrapped = nim-unwrapped =
# Fixes to the compiler and standard libary. # Fixes to the compiler and standard libary.
@ -211,7 +214,7 @@ in nullPkgs // {
configureFlags = attrs.configureFlags ++ [ "no-devcryptoeng" ]; configureFlags = attrs.configureFlags ++ [ "no-devcryptoeng" ];
postInstall = postInstall =
"rm $out/bin/c_rehash"; # eliminate the perl runtime dependency "rm $out/bin/c_rehash"; # eliminate the perl runtime dependency
}) openssl); }) prev.openssl);
patchelf = addPatchesTarget [ patchelf = addPatchesTarget [
./patchelf/dynstr.patch ./patchelf/dynstr.patch
@ -231,14 +234,12 @@ in nullPkgs // {
}) prev.stdenv; }) prev.stdenv;
tor = overrideAttrsHost (attrs: { tor = overrideAttrsHost (attrs: {
configureFlags = attrs.configureFlags or [ ]
++ [ "--disable-tool-name-check" ];
patches = attrs.patches or [ ] ++ [ patches = attrs.patches or [ ] ++ [
./tor/genode.patch ./tor/genode.patch
# We don't do users and groups here. # We don't do users and groups here.
]; ];
postPatch = null; # Avoid torsocks patching postPatch = null; # Avoid torsocks patching
}) tor; }) prev.tor;
zlib = overrideAttrsHost (attrs: { zlib = overrideAttrsHost (attrs: {
postInstall = attrs.postInstall or "" + '' postInstall = attrs.postInstall or "" + ''
@ -247,7 +248,7 @@ in nullPkgs // {
mv libz.so.* libz.so mv libz.so.* libz.so
popd popd
''; '';
}) zlib; }) prev.zlib;
zstd = let zstd = let
static = true; static = true;

View File

@ -1,29 +1,29 @@
{ runCommand, stdenv, llvm, lld, version }: { runCommand, stdenv, llvm, lld, version }:
let let
prefix = prefix = if stdenv.hostPlatform != stdenv.targetPlatform then
if stdenv.hostPlatform != stdenv.targetPlatform "${stdenv.targetPlatform.config}-"
then "${stdenv.targetPlatform.config}-" else
else ""; "";
in runCommand "llvm-binutils-${version}" { preferLocalBuild = true; } '' in runCommand "llvm-binutils-${version}" { preferLocalBuild = true; } ''
mkdir -p $out/bin mkdir -p $out/bin
for prog in ${lld}/bin/*; do for prog in ${lld}/bin/*; do
ln -s $prog $out/bin/${prefix}$(basename $prog) ln -s $prog $out/bin/${prefix}$(basename $prog)
done done
for prog in ${llvm}/bin/*; do for prog in ${llvm}/bin/*; do
ln -sf $prog $out/bin/${prefix}$(basename $prog) ln -sf $prog $out/bin/${prefix}$(basename $prog)
done done
ln -s ${llvm}/bin/llvm-ar $out/bin/${prefix}ar ln -s ${llvm}/bin/llvm-ar $out/bin/${prefix}ar
ln -s ${llvm}/bin/llvm-as $out/bin/${prefix}as ln -s ${llvm}/bin/llvm-as $out/bin/${prefix}as
ln -s ${llvm}/bin/llvm-dwp $out/bin/${prefix}dwp ln -s ${llvm}/bin/llvm-dwp $out/bin/${prefix}dwp
ln -s ${llvm}/bin/llvm-nm $out/bin/${prefix}nm ln -s ${llvm}/bin/llvm-nm $out/bin/${prefix}nm
ln -s ${llvm}/bin/llvm-objcopy $out/bin/${prefix}objcopy ln -s ${llvm}/bin/llvm-objcopy $out/bin/${prefix}objcopy
ln -s ${llvm}/bin/llvm-objdump $out/bin/${prefix}objdump ln -s ${llvm}/bin/llvm-objdump $out/bin/${prefix}objdump
ln -s ${llvm}/bin/llvm-ranlib $out/bin/${prefix}ranlib ln -s ${llvm}/bin/llvm-ranlib $out/bin/${prefix}ranlib
ln -s ${llvm}/bin/llvm-readelf $out/bin/${prefix}readelf ln -s ${llvm}/bin/llvm-readelf $out/bin/${prefix}readelf
ln -s ${llvm}/bin/llvm-size $out/bin/${prefix}size ln -s ${llvm}/bin/llvm-size $out/bin/${prefix}size
ln -s ${llvm}/bin/llvm-strip $out/bin/${prefix}strip ln -s ${llvm}/bin/llvm-strip $out/bin/${prefix}strip
ln -s ${lld}/bin/lld $out/bin/${prefix}ld ln -s ${lld}/bin/lld $out/bin/${prefix}ld
'' ''

View File

@ -1,7 +1,5 @@
{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld { lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src
, fixDarwinDylibNames , python3, lld, fixDarwinDylibNames, enableManpages ? false }:
, enableManpages ? false
}:
let let
self = stdenv.mkDerivation ({ self = stdenv.mkDerivation ({
@ -25,16 +23,14 @@ let
buildInputs = [ libxml2 llvm ]; buildInputs = [ libxml2 llvm ];
cmakeFlags = [ cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++14" "-DCLANGD_BUILD_XPC=OFF" ]
"-DCMAKE_CXX_FLAGS=-std=c++14" ++ lib.optionals enableManpages [
"-DCLANGD_BUILD_XPC=OFF" "-DCLANG_INCLUDE_DOCS=ON"
] ++ lib.optionals enableManpages [ "-DLLVM_ENABLE_SPHINX=ON"
"-DCLANG_INCLUDE_DOCS=ON" "-DSPHINX_OUTPUT_MAN=ON"
"-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_HTML=OFF"
"-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
"-DSPHINX_OUTPUT_HTML=OFF" ];
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
];
patches = [ patches = [
./purity.patch ./purity.patch
@ -49,12 +45,13 @@ let
# Patch for standalone doc building # Patch for standalone doc building
sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
'' + lib.optionalString (stdenv.hostPlatform.isMusl || stdenv.targetPlatform.isGenode) '' '' + lib.optionalString
sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp (stdenv.hostPlatform.isMusl || stdenv.targetPlatform.isGenode) ''
'' + lib.optionalString stdenv.hostPlatform.isDarwin '' sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
substituteInPlace tools/extra/clangd/CMakeLists.txt \ '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
--replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE substituteInPlace tools/extra/clangd/CMakeLists.txt \
''; --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE
'';
outputs = [ "out" "lib" "python" ]; outputs = [ "out" "lib" "python" ];
@ -90,10 +87,11 @@ let
}; };
meta = { meta = {
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; description =
homepage = "https://llvm.org/"; "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
license = lib.licenses.ncsa; homepage = "https://llvm.org/";
platforms = lib.platforms.all; license = lib.licenses.ncsa;
platforms = lib.platforms.all;
}; };
} // lib.optionalAttrs enableManpages { } // lib.optionalAttrs enableManpages {
pname = "clang-manpages"; pname = "clang-manpages";

View File

@ -6,9 +6,7 @@ let
bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none";
inherit (stdenv.hostPlatform) isMusl; inherit (stdenv.hostPlatform) isMusl;
in in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
pname = "compiler-rt"; pname = "compiler-rt";
inherit version; inherit version;
src = fetch pname "0d5j5l8phwqjjscmk8rmqn0i2i0abl537gdbkagl8fjpzy1gyjip"; src = fetch pname "0d5j5l8phwqjjscmk8rmqn0i2i0abl537gdbkagl8fjpzy1gyjip";
@ -24,36 +22,35 @@ stdenv.mkDerivation rec {
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ lib.optionals (stdenv.isDarwin) [ ] ++ lib.optionals (stdenv.isDarwin)
"-DDARWIN_macosx_OVERRIDE_SDK_VERSION=ON" [ "-DDARWIN_macosx_OVERRIDE_SDK_VERSION=ON" ]
] ++ lib.optionals (useLLVM || bareMetal || isMusl) [ ++ lib.optionals (useLLVM || bareMetal || isMusl) [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF" "-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
"-DCOMPILER_RT_BUILD_XRAY=OFF" "-DCOMPILER_RT_BUILD_XRAY=OFF"
"-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
"-DCOMPILER_RT_BUILD_PROFILE=OFF" "-DCOMPILER_RT_BUILD_PROFILE=OFF"
] ++ lib.optionals (useLLVM || bareMetal) [ ] ++ lib.optionals (useLLVM || bareMetal) [
"-DCMAKE_C_COMPILER_WORKS=ON" "-DCMAKE_C_COMPILER_WORKS=ON"
"-DCMAKE_CXX_COMPILER_WORKS=ON" "-DCMAKE_CXX_COMPILER_WORKS=ON"
"-DCOMPILER_RT_BAREMETAL_BUILD=ON" "-DCOMPILER_RT_BAREMETAL_BUILD=ON"
"-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" "-DCMAKE_SIZEOF_VOID_P=${
] ++ lib.optionals (useLLVM) [ toString (stdenv.hostPlatform.parsed.cpu.bits / 8)
"-DCOMPILER_RT_BUILD_BUILTINS=ON" }"
"-DCMAKE_C_FLAGS=-nodefaultlibs" ] ++ lib.optionals (useLLVM) [
#https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program "-DCOMPILER_RT_BUILD_BUILTINS=ON"
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" "-DCMAKE_C_FLAGS=-nodefaultlibs"
] ++ lib.optionals (bareMetal) [ #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
"-DCOMPILER_RT_OS_DIR=baremetal" "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
]; ] ++ lib.optionals (bareMetal) [ "-DCOMPILER_RT_OS_DIR=baremetal" ];
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
patches = [ patches = [
./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
./compiler-rt-X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config ./compiler-rt-X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config
]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch ] # ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
# TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
# to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
# can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
@ -77,14 +74,15 @@ stdenv.mkDerivation rec {
''; '';
# Hack around weird upsream RPATH bug # Hack around weird upsream RPATH bug
postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' postInstall = lib.optionalString
ln -s "$out/lib"/*/* "$out/lib" (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
'' + lib.optionalString (useLLVM) '' ln -s "$out/lib"/*/* "$out/lib"
ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o '' + lib.optionalString (useLLVM) ''
ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o
ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o
ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o
''; ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o
'';
enableParallelBuilding = true; enableParallelBuilding = true;
} }

View File

@ -1,219 +1,220 @@
{ lib, lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs { lib, lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs, libxml2, python3, isl
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith , fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith, buildPackages
, buildPackages
, buildLlvmTools # tools, but from the previous stage, for cross , buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross
, erisPatchHook, genodePackages ? null , erisPatchHook, genodePackages ? null }:
}:
let let
release_version = "11.0.0"; release_version = "11.0.0";
version = release_version; # differentiating these (variables) is important for RCs version =
release_version; # differentiating these (variables) is important for RCs
targetConfig = stdenv.targetPlatform.config; targetConfig = stdenv.targetPlatform.config;
fetch = name: sha256: fetchurl { fetch = name: sha256:
url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${release_version}/${name}-${version}.src.tar.xz"; fetchurl {
inherit sha256; url =
}; "https://github.com/llvm/llvm-project/releases/download/llvmorg-${release_version}/${name}-${version}.src.tar.xz";
inherit sha256;
clang-tools-extra_src = fetch "clang-tools-extra" "02bcwwn54661madhq4nxc069s7p7pj5gpqi8ww50w3anbpviilzy";
tools = lib.makeExtensible (tools: let
callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
mkExtraBuildCommands = cc: ''
rsrc="$out/resource-root"
mkdir "$rsrc"
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'';
in {
llvm = callPackage ./llvm.nix { };
clang-unwrapped = callPackage ./clang {
inherit (tools) lld;
inherit clang-tools-extra_src;
}; };
# disabled until recommonmark supports sphinx 3 clang-tools-extra_src = fetch "clang-tools-extra"
#Llvm-manpages = lowPrio (tools.llvm.override { "02bcwwn54661madhq4nxc069s7p7pj5gpqi8ww50w3anbpviilzy";
# enableManpages = true;
# python3 = pkgs.python3; # don't use python-boot
#});
clang-manpages = lowPrio (tools.clang-unwrapped.override { tools = lib.makeExtensible (tools:
enableManpages = true; let
python3 = pkgs.python3; # don't use python-boot callPackage = newScope (tools // {
}); inherit stdenv cmake libxml2 python3 isl release_version version fetch;
});
mkExtraBuildCommands = cc:
''
rsrc="$out/resource-root"
mkdir "$rsrc"
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + lib.optionalString (stdenv.targetPlatform.isLinux
&& !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'';
in {
# disabled until recommonmark supports sphinx 3 llvm = callPackage ./llvm.nix { };
# lldb-manpages = lowPrio (tools.lldb.override {
# enableManpages = true;
# python3 = pkgs.python3; # don't use python-boot
# });
libclang = tools.clang-unwrapped.lib; clang-unwrapped = callPackage ./clang {
inherit (tools) lld;
inherit clang-tools-extra_src;
};
clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang; # disabled until recommonmark supports sphinx 3
#Llvm-manpages = lowPrio (tools.llvm.override {
# enableManpages = true;
# python3 = pkgs.python3; # don't use python-boot
#});
libstdcxxClang = wrapCCWith rec { clang-manpages = lowPrio (tools.clang-unwrapped.override {
cc = tools.clang-unwrapped; enableManpages = true;
# libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper. python3 = pkgs.python3; # don't use python-boot
libcxx = null; });
extraPackages = [
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = mkExtraBuildCommands cc;
};
libcxxClang = wrapCCWith rec { # disabled until recommonmark supports sphinx 3
cc = tools.clang-unwrapped; # lldb-manpages = lowPrio (tools.lldb.override {
libcxx = targetLlvmLibraries.libcxx; # enableManpages = true;
extraPackages = [ # python3 = pkgs.python3; # don't use python-boot
targetLlvmLibraries.libcxxabi # });
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = mkExtraBuildCommands cc;
};
lld = callPackage ./lld.nix {}; libclang = tools.clang-unwrapped.lib;
lldb = callPackage ./lldb.nix {}; clang =
if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang;
# Below, is the LLVM bootstrapping logic. It handles building a libstdcxxClang = wrapCCWith rec {
# fully LLVM toolchain from scratch. No GCC toolchain should be
# pulled in. As a consequence, it is very quick to build different
# targets provided by LLVM and we can also build for what GCC
# doesnt support like LLVM. Probably we should move to some other
# file.
bintools = callPackage ./bintools.nix {};
lldClang = if stdenv.targetPlatform.isGenode then
wrapCCWith rec {
cc = tools.clang-unwrapped; cc = tools.clang-unwrapped;
gccForLibs = genodePackages.genodeSources.toolchain.cc; # libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper.
bintools = wrapBintoolsWith { inherit (tools) bintools; }; libcxx = null;
extraBuildCommands = with genodePackages.genodeSources; '' extraPackages = [ targetLlvmLibraries.compiler-rt ];
echo "--gcc-toolchain=${toolchain.cc}" >> $out/nix-support/cc-cflags extraBuildCommands = mkExtraBuildCommands cc;
echo "--sysroot=${genodeBase}" >> $out/nix-support/cc-cflags };
echo "-I${genodeBase}/include" >> $out/nix-support/cc-cflags
echo "-L ${genodeBase}" >> $out/nix-support/cc-ldflags
for dir in ${gccForLibs}/${stdenv.targetPlatform.config}/include/c++/*; do libcxxClang = wrapCCWith rec {
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
done
echo "-isystem ${genodePackages.genodeSources}/repos/libports/include/stdcxx" >> $out/nix-support/libcxx-cxxflags
for dir in ${genodePackages.genodeSources.ports.stdcxx}/*/include/stdcxx; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
echo "-isystem $dir/std" >> $out/nix-support/libcxx-cxxflags
echo "-isystem $dir/c_global" >> $out/nix-support/libcxx-cxxflags
done
echo "${genodePackages.stdcxx}/lib/stdcxx.lib.so" >> $out/nix-support/libcxx-ldflags
'';
}
else
wrapCCWith rec {
cc = tools.clang-unwrapped; cc = tools.clang-unwrapped;
libcxx = targetLlvmLibraries.libcxx; libcxx = targetLlvmLibraries.libcxx;
bintools = wrapBintoolsWith { inherit (tools) bintools; };
extraPackages = extraPackages =
[ targetLlvmLibraries.libcxxabi targetLlvmLibraries.compiler-rt ] [ targetLlvmLibraries.libcxxabi targetLlvmLibraries.compiler-rt ];
++ lib.optionals (!stdenv.targetPlatform.isWasm) extraBuildCommands = mkExtraBuildCommands cc;
[ targetLlvmLibraries.libunwind ]; };
lld = callPackage ./lld.nix { };
lldb = callPackage ./lldb.nix { };
# Below, is the LLVM bootstrapping logic. It handles building a
# fully LLVM toolchain from scratch. No GCC toolchain should be
# pulled in. As a consequence, it is very quick to build different
# targets provided by LLVM and we can also build for what GCC
# doesnt support like LLVM. Probably we should move to some other
# file.
bintools = callPackage ./bintools.nix { };
lldClang = if stdenv.targetPlatform.isGenode then
wrapCCWith rec {
cc = tools.clang-unwrapped;
gccForLibs = genodePackages.genodeSources.toolchain.cc;
bintools = wrapBintoolsWith { inherit (tools) bintools; };
extraBuildCommands = with genodePackages.genodeSources; ''
echo "--gcc-toolchain=${toolchain.cc}" >> $out/nix-support/cc-cflags
echo "--sysroot=${genodeBase}" >> $out/nix-support/cc-cflags
echo "-I${genodeBase}/include" >> $out/nix-support/cc-cflags
echo "-L ${genodeBase}" >> $out/nix-support/cc-ldflags
for dir in ${gccForLibs}/${stdenv.targetPlatform.config}/include/c++/*; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
done
echo "-isystem ${genodePackages.genodeSources}/repos/libports/include/stdcxx" >> $out/nix-support/libcxx-cxxflags
for dir in ${genodePackages.genodeSources.ports.stdcxx}/*/include/stdcxx; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
echo "-isystem $dir/std" >> $out/nix-support/libcxx-cxxflags
echo "-isystem $dir/c_global" >> $out/nix-support/libcxx-cxxflags
done
echo "${genodePackages.stdcxx}/lib/stdcxx.lib.so" >> $out/nix-support/libcxx-ldflags
'';
}
else
wrapCCWith rec {
cc = tools.clang-unwrapped;
libcxx = targetLlvmLibraries.libcxx;
bintools = wrapBintoolsWith { inherit (tools) bintools; };
extraPackages =
[ targetLlvmLibraries.libcxxabi targetLlvmLibraries.compiler-rt ]
++ lib.optionals (!stdenv.targetPlatform.isWasm)
[ targetLlvmLibraries.libunwind ];
extraBuildCommands = ''
echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
'' + lib.optionalString (!stdenv.targetPlatform.isWasm) ''
echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags
'' + lib.optionalString stdenv.targetPlatform.isWasm ''
echo "-fno-exceptions" >> $out/nix-support/cc-cflags
'' + mkExtraBuildCommands cc;
};
lldClangNoLibcxx = wrapCCWith rec {
cc = tools.clang-unwrapped;
libcxx = null;
bintools = wrapBintoolsWith { inherit (tools) bintools; };
extraPackages = [ targetLlvmLibraries.compiler-rt ];
extraBuildCommands = '' extraBuildCommands = ''
echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
'' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "-nostdlib++" >> $out/nix-support/cc-cflags
echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags
'' + lib.optionalString stdenv.targetPlatform.isWasm ''
echo "-fno-exceptions" >> $out/nix-support/cc-cflags
'' + mkExtraBuildCommands cc; '' + mkExtraBuildCommands cc;
}; };
lldClangNoLibcxx = wrapCCWith rec { lldClangNoLibc = wrapCCWith rec {
cc = tools.clang-unwrapped; cc = tools.clang-unwrapped;
libcxx = null; libcxx = null;
bintools = wrapBintoolsWith { bintools = wrapBintoolsWith {
inherit (tools) bintools; inherit (tools) bintools;
libc = null;
};
extraPackages = [ targetLlvmLibraries.compiler-rt ];
extraBuildCommands = ''
echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
'' + mkExtraBuildCommands cc;
}; };
extraPackages = [
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = ''
echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
echo "-nostdlib++" >> $out/nix-support/cc-cflags
'' + mkExtraBuildCommands cc;
};
lldClangNoLibc = wrapCCWith rec { lldClangNoCompilerRt = wrapCCWith {
cc = tools.clang-unwrapped; cc = tools.clang-unwrapped;
libcxx = null; libcxx = null;
bintools = wrapBintoolsWith { bintools = wrapBintoolsWith {
inherit (tools) bintools; inherit (tools) bintools;
libc = null; libc = null;
};
extraPackages = [ ];
extraBuildCommands = ''
echo "-nostartfiles" >> $out/nix-support/cc-cflags
'';
}; };
extraPackages = [
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = ''
echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
'' + mkExtraBuildCommands cc;
};
lldClangNoCompilerRt = wrapCCWith { });
cc = tools.clang-unwrapped;
libcxx = null;
bintools = wrapBintoolsWith {
inherit (tools) bintools;
libc = null;
};
extraPackages = [ ];
extraBuildCommands = ''
echo "-nostartfiles" >> $out/nix-support/cc-cflags
'';
};
}); libraries = lib.makeExtensible (libraries:
let
callPackage = newScope (libraries // buildLlvmTools // {
inherit stdenv cmake libxml2 python3 isl release_version version fetch;
});
in {
libraries = lib.makeExtensible (libraries: let compiler-rt = callPackage ./compiler-rt.nix ({ }
callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
in { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt;
}));
compiler-rt = callPackage ./compiler-rt.nix ({} // stdenv = overrideCC stdenv buildLlvmTools.clang;
(lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt;
}));
stdenv = overrideCC stdenv buildLlvmTools.clang; libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; libcxx = callPackage ./libc++ ({ }
// (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
}));
libcxx = callPackage ./libc++ ({} // libcxxabi = callPackage ./libc++abi.nix ({ }
(lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
})); libunwind = libraries.libunwind;
}));
libcxxabi = callPackage ./libc++abi.nix ({} // openmp = callPackage ./openmp.nix { };
(lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
libunwind = libraries.libunwind;
}));
openmp = callPackage ./openmp.nix {}; libunwind = callPackage ./libunwind.nix ({ }
// (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
}));
libunwind = callPackage ./libunwind.nix ({} // });
(lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
}));
});
in { inherit tools libraries; } // libraries // tools in { inherit tools libraries; } // libraries // tools

View File

@ -1,5 +1,5 @@
{ lib, stdenv, fetch, cmake, python3, libcxxabi, llvm, fixDarwinDylibNames, version { lib, stdenv, fetch, cmake, python3, libcxxabi, llvm, fixDarwinDylibNames
, enableShared ? true }: , version, enableShared ? true }:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "libc++"; pname = "libc++";
@ -23,11 +23,11 @@ stdenv.mkDerivation {
buildInputs = [ libcxxabi ]; buildInputs = [ libcxxabi ];
cmakeFlags = [ cmakeFlags = [ "-DLIBCXX_CXX_ABI=libcxxabi" ]
"-DLIBCXX_CXX_ABI=libcxxabi" ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi)
] ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" "-DLIBCXX_HAS_MUSL_LIBC=1"
++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" ++ lib.optional (stdenv.hostPlatform.useLLVM or false)
++ lib.optional stdenv.hostPlatform.isWasm [ "-DLIBCXX_USE_COMPILER_RT=ON" ++ lib.optional stdenv.hostPlatform.isWasm [
"-DLIBCXX_ENABLE_THREADS=OFF" "-DLIBCXX_ENABLE_THREADS=OFF"
"-DLIBCXX_ENABLE_FILESYSTEM=OFF" "-DLIBCXX_ENABLE_FILESYSTEM=OFF"
"-DLIBCXX_ENABLE_EXCEPTIONS=OFF" "-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
@ -35,13 +35,12 @@ stdenv.mkDerivation {
enableParallelBuilding = true; enableParallelBuilding = true;
passthru = { passthru = { isLLVM = true; };
isLLVM = true;
};
meta = { meta = {
homepage = "https://libcxx.llvm.org/"; homepage = "https://libcxx.llvm.org/";
description = "A new implementation of the C++ standard library, targeting C++11"; description =
"A new implementation of the C++ standard library, targeting C++11";
license = with lib.licenses; [ ncsa mit ]; license = with lib.licenses; [ ncsa mit ];
platforms = lib.platforms.all; platforms = lib.platforms.all;
}; };

View File

@ -5,10 +5,13 @@ stdenv.mkDerivation {
pname = "libc++abi"; pname = "libc++abi";
inherit version; inherit version;
src = fetch "libcxxabi" "05ac7rkjbla03bc0lf92f901dfjgxdvp8cr9fpn59a5p4x27ssaq"; src =
fetch "libcxxabi" "05ac7rkjbla03bc0lf92f901dfjgxdvp8cr9fpn59a5p4x27ssaq";
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; buildInputs = lib.optional
(!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm)
libunwind;
cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [ cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [
"-DLLVM_ENABLE_LIBCXX=ON" "-DLLVM_ENABLE_LIBCXX=ON"
@ -16,9 +19,7 @@ stdenv.mkDerivation {
] ++ lib.optionals stdenv.hostPlatform.isWasm [ ] ++ lib.optionals stdenv.hostPlatform.isWasm [
"-DLIBCXXABI_ENABLE_THREADS=OFF" "-DLIBCXXABI_ENABLE_THREADS=OFF"
"-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF"
] ++ lib.optionals (!enableShared) [ ] ++ lib.optionals (!enableShared) [ "-DLIBCXXABI_ENABLE_SHARED=OFF" ];
"-DLIBCXXABI_ENABLE_SHARED=OFF"
];
patches = [ ./libcxxabi-no-threads.patch ]; patches = [ ./libcxxabi-no-threads.patch ];
@ -35,20 +36,19 @@ stdenv.mkDerivation {
patch -p1 -d llvm -i ${./libcxxabi-wasm.patch} patch -p1 -d llvm -i ${./libcxxabi-wasm.patch}
''; '';
installPhase = if stdenv.isDarwin installPhase = if stdenv.isDarwin then ''
then '' for file in lib/*.dylib; do
for file in lib/*.dylib; do # this should be done in CMake, but having trouble figuring out
# this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables
# the magic combination of necessary CMake variables # if you fancy a try, take a look at
# if you fancy a try, take a look at # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling install_name_tool -id $out/$file $file
install_name_tool -id $out/$file $file done
done make install
make install install -d 755 $out/include
install -d 755 $out/include install -m 644 ../include/*.h $out/include
install -m 644 ../include/*.h $out/include '' else
'' ''
else ''
install -d -m 755 $out/include $out/lib install -d -m 755 $out/include $out/lib
install -m 644 lib/libc++abi.a $out/lib install -m 644 lib/libc++abi.a $out/lib
install -m 644 ../include/cxxabi.h $out/include install -m 644 ../include/cxxabi.h $out/include
@ -60,7 +60,8 @@ stdenv.mkDerivation {
meta = { meta = {
homepage = "https://libcxxabi.llvm.org/"; homepage = "https://libcxxabi.llvm.org/";
description = "A new implementation of low level support for a standard C++ library"; description =
"A new implementation of low level support for a standard C++ library";
license = with lib.licenses; [ ncsa mit ]; license = with lib.licenses; [ ncsa mit ];
maintainers = with lib.maintainers; [ vlstill ]; maintainers = with lib.maintainers; [ vlstill ];
platforms = lib.platforms.all; platforms = lib.platforms.all;

View File

@ -1,11 +1,4 @@
{ lib { lib, stdenv, fetch, cmake, libxml2, llvm, version }:
, stdenv
, fetch
, cmake
, libxml2
, llvm
, version
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "lld"; pname = "lld";
@ -29,8 +22,8 @@ stdenv.mkDerivation rec {
meta = { meta = {
description = "The LLVM Linker"; description = "The LLVM Linker";
homepage = "https://lld.llvm.org/"; homepage = "https://lld.llvm.org/";
license = lib.licenses.ncsa; license = lib.licenses.ncsa;
platforms = lib.platforms.all; platforms = lib.platforms.all;
}; };
} }

View File

@ -1,20 +1,5 @@
{ stdenv { stdenv, fetch, cmake, zlib, ncurses, swig, which, libedit, libxml2, llvm
, fetch , clang-unwrapped, python3, version, darwin, lit, enableManpages ? false }:
, cmake
, zlib
, ncurses
, swig
, which
, libedit
, libxml2
, llvm
, clang-unwrapped
, python3
, version
, darwin
, lit
, enableManpages ? false
}:
stdenv.mkDerivation (rec { stdenv.mkDerivation (rec {
pname = "lldb"; pname = "lldb";
@ -25,23 +10,20 @@ stdenv.mkDerivation (rec {
patches = [ ./lldb-procfs.patch ]; patches = [ ./lldb-procfs.patch ];
nativeBuildInputs = [ cmake python3 which swig lit ] nativeBuildInputs = [ cmake python3 which swig lit ]
++ lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; ++ lib.optionals enableManpages [
python3.pkgs.sphinx
python3.pkgs.recommonmark
];
buildInputs = [ buildInputs = [ ncurses zlib libedit libxml2 llvm ]
ncurses ++ lib.optionals stdenv.isDarwin [
zlib darwin.libobjc
libedit darwin.apple_sdk.libs.xpc
libxml2 darwin.apple_sdk.frameworks.Foundation
llvm darwin.bootstrap_cmds
] darwin.apple_sdk.frameworks.Carbon
++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa
darwin.libobjc ];
darwin.apple_sdk.libs.xpc
darwin.apple_sdk.frameworks.Foundation
darwin.bootstrap_cmds
darwin.apple_sdk.frameworks.Carbon
darwin.apple_sdk.frameworks.Cocoa
];
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
@ -49,15 +31,14 @@ stdenv.mkDerivation (rec {
"-DLLVM_ENABLE_RTTI=OFF" "-DLLVM_ENABLE_RTTI=OFF"
"-DClang_DIR=${clang-unwrapped}/lib/cmake" "-DClang_DIR=${clang-unwrapped}/lib/cmake"
"-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit"
] ++ lib.optionals stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [ "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" ]
"-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" ++ lib.optionals (!stdenv.isDarwin) [
] ++ lib.optionals (!stdenv.isDarwin) [ "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
"-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic ] ++ lib.optionals enableManpages [
] ++ lib.optionals enableManpages [ "-DLLVM_ENABLE_SPHINX=ON"
"-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON"
"-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF"
"-DSPHINX_OUTPUT_HTML=OFF" ];
];
enableParallelBuilding = true; enableParallelBuilding = true;
@ -82,7 +63,7 @@ stdenv.mkDerivation (rec {
make docs-lldb-man make docs-lldb-man
''; '';
propagatedBuildInputs = []; propagatedBuildInputs = [ ];
installPhase = '' installPhase = ''
# manually install lldb man page # manually install lldb man page

View File

@ -1,26 +1,10 @@
{ lib { lib, stdenv, fetch, cmake, python3, libffi, libbfd, libpfm, libxml2, ncurses
, stdenv , version, release_version, zlib, buildPackages, debugVersion ? false
, fetch , enableManpages ? false, enableSharedLibraries ? true, enablePFM ?
, cmake !(stdenv.isDarwin
, python3 || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245
, libffi || stdenv.isAarch32 # broken for the armv7l builder
, libbfd ), enablePolly ? false }:
, libpfm
, libxml2
, ncurses
, version
, release_version
, zlib
, buildPackages
, debugVersion ? false
, enableManpages ? false
, enableSharedLibraries ? true
, enablePFM ? !(stdenv.isDarwin
|| stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245
|| stdenv.isAarch32 # broken for the armv7l builder
)
, enablePolly ? false
}:
let let
inherit (lib) optional optionals optionalString; inherit (lib) optional optionals optionalString;
@ -34,7 +18,8 @@ in stdenv.mkDerivation (rec {
inherit version; inherit version;
src = fetch pname "0s94lwil98w7zb7cjrbnxli0z7gklb312pkw74xs1d6zk346hgwi"; src = fetch pname "0s94lwil98w7zb7cjrbnxli0z7gklb312pkw74xs1d6zk346hgwi";
polly_src = fetch "polly" "0h442ivcslr3dv3q3g1nw5avh77f8cxsp6zild1hgspj266xpynw"; polly_src =
fetch "polly" "0h442ivcslr3dv3q3g1nw5avh77f8cxsp6zild1hgspj266xpynw";
unpackPhase = '' unpackPhase = ''
unpackFile $src unpackFile $src
@ -45,14 +30,14 @@ in stdenv.mkDerivation (rec {
mv polly-* $sourceRoot/tools/polly mv polly-* $sourceRoot/tools/polly
''; '';
outputs = [ "out" "python" ] outputs = [ "out" "python" ] ++ optional enableSharedLibraries "lib";
++ optional enableSharedLibraries "lib";
nativeBuildInputs = [ cmake python3 ] nativeBuildInputs = [ cmake python3 ] ++ optionals enableManpages [
++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; python3.pkgs.sphinx
python3.pkgs.recommonmark
];
buildInputs = [ libxml2 libffi ] buildInputs = [ libxml2 libffi ] ++ optional enablePFM libpfm; # exegesis
++ optional enablePFM libpfm; # exegesis
propagatedBuildInputs = [ ncurses zlib ]; propagatedBuildInputs = [ ncurses zlib ];
@ -63,34 +48,34 @@ in stdenv.mkDerivation (rec {
--replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \
--replace 'set(_install_rpath "@loader_path/../lib''${LLVM_LIBDIR_SUFFIX}" ''${extra_libdir})' "" --replace 'set(_install_rpath "@loader_path/../lib''${LLVM_LIBDIR_SUFFIX}" ''${extra_libdir})' ""
'' ''
# Patch llvm-config to return correct library path based on --link-{shared,static}. # Patch llvm-config to return correct library path based on --link-{shared,static}.
+ optionalString (enableSharedLibraries) '' + optionalString (enableSharedLibraries) ''
substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
patch -p1 < ./llvm-outputs.patch patch -p1 < ./llvm-outputs.patch
'' + '' '' + ''
# FileSystem permissions tests fail with various special bits # FileSystem permissions tests fail with various special bits
substituteInPlace unittests/Support/CMakeLists.txt \ substituteInPlace unittests/Support/CMakeLists.txt \
--replace "Path.cpp" "" --replace "Path.cpp" ""
rm unittests/Support/Path.cpp rm unittests/Support/Path.cpp
'' + optionalString stdenv.hostPlatform.isMusl '' '' + optionalString stdenv.hostPlatform.isMusl ''
patch -p1 -i ${../TLI-musl.patch} patch -p1 -i ${../TLI-musl.patch}
substituteInPlace unittests/Support/CMakeLists.txt \ substituteInPlace unittests/Support/CMakeLists.txt \
--replace "add_subdirectory(DynamicLibrary)" "" --replace "add_subdirectory(DynamicLibrary)" ""
rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
# valgrind unhappy with musl or glibc, but fails w/musl only # valgrind unhappy with musl or glibc, but fails w/musl only
rm test/CodeGen/AArch64/wineh4.mir rm test/CodeGen/AArch64/wineh4.mir
'' + optionalString stdenv.hostPlatform.isAarch32 '' '' + optionalString stdenv.hostPlatform.isAarch32 ''
# skip failing X86 test cases on 32-bit ARM # skip failing X86 test cases on 32-bit ARM
rm test/DebugInfo/X86/convert-debugloc.ll rm test/DebugInfo/X86/convert-debugloc.ll
rm test/DebugInfo/X86/convert-inlined.ll rm test/DebugInfo/X86/convert-inlined.ll
rm test/DebugInfo/X86/convert-linked.ll rm test/DebugInfo/X86/convert-linked.ll
rm test/tools/dsymutil/X86/op-convert.test rm test/tools/dsymutil/X86/op-convert.test
'' + optionalString (stdenv.hostPlatform.system == "armv6l-linux") '' '' + optionalString (stdenv.hostPlatform.system == "armv6l-linux") ''
# Seems to require certain floating point hardware (NEON?) # Seems to require certain floating point hardware (NEON?)
rm test/ExecutionEngine/frem.ll rm test/ExecutionEngine/frem.ll
'' + '' '' + ''
patchShebangs test/BugPoint/compile-custom.ll.py patchShebangs test/BugPoint/compile-custom.ll.py
''; '';
# hacky fix: created binaries need to be run before installation # hacky fix: created binaries need to be run before installation
preBuild = '' preBuild = ''
@ -99,34 +84,35 @@ in stdenv.mkDerivation (rec {
''; '';
# E.g. mesa.drivers use the build-id as a cache key (see #93946): # E.g. mesa.drivers use the build-id as a cache key (see #93946):
LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1"; LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin)
"-Wl,--build-id=sha1";
cmakeFlags = with stdenv; [ cmakeFlags = with stdenv;
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" [
"-DLLVM_INSTALL_UTILS=ON" # Needed by rustc "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
"-DLLVM_BUILD_TESTS=ON" "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc
"-DLLVM_ENABLE_FFI=ON" "-DLLVM_BUILD_TESTS=ON"
"-DLLVM_ENABLE_RTTI=ON" "-DLLVM_ENABLE_FFI=ON"
"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_RTTI=ON"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_ENABLE_DUMP=ON" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
] ++ optionals enableSharedLibraries [ "-DLLVM_ENABLE_DUMP=ON"
"-DLLVM_LINK_LLVM_DYLIB=ON" ] ++ optionals enableSharedLibraries [ "-DLLVM_LINK_LLVM_DYLIB=ON" ]
] ++ optionals enableManpages [ ++ optionals enableManpages [
"-DLLVM_BUILD_DOCS=ON" "-DLLVM_BUILD_DOCS=ON"
"-DLLVM_ENABLE_SPHINX=ON" "-DLLVM_ENABLE_SPHINX=ON"
"-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_MAN=ON"
"-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_OUTPUT_HTML=OFF"
"-DSPHINX_WARNINGS_AS_ERRORS=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
] ++ optionals (!isDarwin) [ ]
"-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" ++ optionals (!isDarwin) [ "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" ]
] ++ optionals isDarwin [ ++ optionals isDarwin [
"-DLLVM_ENABLE_LIBCXX=ON" "-DLLVM_ENABLE_LIBCXX=ON"
"-DCAN_TARGET_i386=false" "-DCAN_TARGET_i386=false"
] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-DCMAKE_CROSSCOMPILING=True" "-DCMAKE_CROSSCOMPILING=True"
"-DLLVM_TABLEGEN=${buildPackages.llvm_10}/bin/llvm-tblgen" "-DLLVM_TABLEGEN=${buildPackages.llvm_10}/bin/llvm-tblgen"
]; ];
postBuild = '' postBuild = ''
rm -fR $out rm -fR $out
@ -139,17 +125,18 @@ in stdenv.mkDerivation (rec {
postInstall = '' postInstall = ''
mkdir -p $python/share mkdir -p $python/share
mv $out/share/opt-viewer $python/share/opt-viewer mv $out/share/opt-viewer $python/share/opt-viewer
'' '' + optionalString enableSharedLibraries ''
+ optionalString enableSharedLibraries ''
moveToOutput "lib/libLLVM-*" "$lib" moveToOutput "lib/libLLVM-*" "$lib"
moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib"
'' '' + optionalString (enableSharedLibraries && (!stdenv.isDarwin)) ''
+ optionalString (enableSharedLibraries && (!stdenv.isDarwin)) '' substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ if debugVersion then "debug" else "release"
}.cmake" \
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-" --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
'' '' + optionalString (stdenv.isDarwin && enableSharedLibraries) ''
+ optionalString (stdenv.isDarwin && enableSharedLibraries) '' substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ if debugVersion then "debug" else "release"
}.cmake" \
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib"
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
@ -163,11 +150,12 @@ in stdenv.mkDerivation (rec {
requiredSystemFeatures = [ "big-parallel" ]; requiredSystemFeatures = [ "big-parallel" ];
meta = { meta = {
description = "Collection of modular and reusable compiler and toolchain technologies"; description =
homepage = "https://llvm.org/"; "Collection of modular and reusable compiler and toolchain technologies";
license = lib.licenses.ncsa; homepage = "https://llvm.org/";
license = lib.licenses.ncsa;
maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ]; maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ];
platforms = lib.platforms.all; platforms = lib.platforms.all;
}; };
} // lib.optionalAttrs enableManpages { } // lib.optionalAttrs enableManpages {
pname = "llvm-manpages"; pname = "llvm-manpages";
@ -176,7 +164,7 @@ in stdenv.mkDerivation (rec {
make docs-llvm-man make docs-llvm-man
''; '';
propagatedBuildInputs = []; propagatedBuildInputs = [ ];
installPhase = '' installPhase = ''
make -C docs install make -C docs install

View File

@ -1,10 +1,4 @@
{ stdenv { stdenv, fetch, cmake, llvm, perl, version }:
, fetch
, cmake
, llvm
, perl
, version
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "openmp"; pname = "openmp";
@ -19,8 +13,8 @@ stdenv.mkDerivation rec {
meta = { meta = {
description = "Components required to build an executable OpenMP program"; description = "Components required to build an executable OpenMP program";
homepage = "https://openmp.llvm.org/"; homepage = "https://openmp.llvm.org/";
license = lib.licenses.mit; license = lib.licenses.mit;
platforms = lib.platforms.all; platforms = lib.platforms.all;
}; };
} }

View File

@ -1,7 +1,7 @@
From b361fa6da5a5892ada665dcabfc6a0327419db63 Mon Sep 17 00:00:00 2001 From 3ea8cfd1fb61baccd38118331adb0b8fe1e7c7a9 Mon Sep 17 00:00:00 2001
From: Emery Hemingway <ehmry@posteo.net> From: Emery Hemingway <ehmry@posteo.net>
Date: Wed, 2 Dec 2020 19:27:10 +0100 Date: Wed, 2 Dec 2020 19:27:10 +0100
Subject: [PATCH] Skip user/group checks for Genode hosts Subject: [PATCH 1/2] Skip user/group checks for Genode hosts
--- ---
src/app/main/main.c | 4 ++++ src/app/main/main.c | 4 ++++
@ -10,10 +10,10 @@ Subject: [PATCH] Skip user/group checks for Genode hosts
3 files changed, 18 insertions(+) 3 files changed, 18 insertions(+)
diff --git a/src/app/main/main.c b/src/app/main/main.c diff --git a/src/app/main/main.c b/src/app/main/main.c
index e7ffb31b4f..a1a9037f09 100644 index 589d365add..22b5cdf89a 100644
--- a/src/app/main/main.c --- a/src/app/main/main.c
+++ b/src/app/main/main.c +++ b/src/app/main/main.c
@@ -670,6 +670,10 @@ static tor_lockfile_t *lockfile = NULL; @@ -669,6 +669,10 @@ static tor_lockfile_t *lockfile = NULL;
int int
try_locking(const or_options_t *options, int err_if_locked) try_locking(const or_options_t *options, int err_if_locked)
{ {
@ -68,5 +68,31 @@ index 3cfd520a4f..bf1857ad2a 100644
const struct passwd *pw = NULL; const struct passwd *pw = NULL;
uid_t old_uid; uid_t old_uid;
-- --
2.29.2 2.31.0
From 453339560166101a6db53bb701d30184019d3bd9 Mon Sep 17 00:00:00 2001
From: Emery Hemingway <ehmry@posteo.net>
Date: Fri, 16 Apr 2021 15:17:43 +0200
Subject: [PATCH 2/2] scripts/build/combine_libs: use $AR rather than ar
---
scripts/build/combine_libs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/build/combine_libs b/scripts/build/combine_libs
index fb311552fe..9c87f68248 100755
--- a/scripts/build/combine_libs
+++ b/scripts/build/combine_libs
@@ -25,7 +25,7 @@ for input in "$@"; do
dir="$TMPDIR"/$(basename "$input" .a)
mkdir "$dir"
cd "$dir">/dev/null
- ar x "$abs"
+ "${AR:-ar}" x "$abs"
done
cd "$TMPDIR" >/dev/null
--
2.31.0

View File

@ -7,8 +7,8 @@ stdenv.mkDerivation rec {
src = fetchgit { src = fetchgit {
url = "https://git.sr.ht/~ehmry/${pname}"; url = "https://git.sr.ht/~ehmry/${pname}";
rev = "018ec1ccb109b275a54462d85eb006bc51ea04ac"; rev = "4ff7d47b83255a437d862d16b8424a3c05e3eab1";
sha256 = "1aiygypkjh2r397xwzpccav4mmkdhx7mc580javsm4cr3hhkhbvj"; sha256 = "0bmcl693w34ayrw77c6gicph43yfjfm800jwj57ryshr9fdh88dq";
}; };
nimFlags = with nimblePackages; nimFlags = with nimblePackages;

View File

@ -125,7 +125,7 @@ let
find $CONTRIB_DIR/* -name '*.zip' -exec rm -rf {} \; || true find $CONTRIB_DIR/* -name '*.zip' -exec rm -rf {} \; || true
mkdir $out mkdir $out
cp -a $CONTRIB_DIR/* $out/ cp -av $CONTRIB_DIR/* $out/
runHook postInstall runHook postInstall
''; '';

View File

@ -168,7 +168,7 @@ in {
pcre = { }; pcre = { };
pcre16 = { }; pcre16 = { };
pdf_view = { }; pdf_view = { };
platform_drv.patches = [ ./patches/platform_drv.patch ]; platform_drv = { }; # .patches = [ ./patches/platform_drv.patch ];
posix.depotInputs = with self; [ libc ]; posix.depotInputs = with self; [ libc ];
ps2_drv = { }; ps2_drv = { };
qt5_base = { }; qt5_base = { };
@ -292,7 +292,7 @@ in {
usb_block_drv = { }; usb_block_drv = { };
usb_drv = { usb_drv = {
portInputs = with ports; [ dde_linux ]; portInputs = with ports; [ dde_linux ];
meta.broken = builtins.trace "usb_drv is broken! Use usb_host_drv!" true; meta.broken = builtins.trace "usb_drv is broken! Use usb_host_drv!" false;
}; };
usb_hid_drv.portInputs = with ports; [ dde_linux ]; usb_hid_drv.portInputs = with ports; [ dde_linux ];
usb_host_drv = { usb_host_drv = {

View File

@ -1,4 +1,4 @@
From f747e139da4fda694363a27010cb6d62c3b1e941 Mon Sep 17 00:00:00 2001 From c6104cfcfb7c810fabb0fb26ec8162466ef9541b Mon Sep 17 00:00:00 2001
From: Emery Hemingway <ehmry@posteo.net> From: Emery Hemingway <ehmry@posteo.net>
Date: Tue, 10 Nov 2020 12:51:12 +0100 Date: Tue, 10 Nov 2020 12:51:12 +0100
Subject: [PATCH 1/2] drivers/platform/x86: move PCI capabilities to PCI report Subject: [PATCH 1/2] drivers/platform/x86: move PCI capabilities to PCI report
@ -9,10 +9,10 @@ Subject: [PATCH 1/2] drivers/platform/x86: move PCI capabilities to PCI report
1 file changed, 3 insertions(+), 1 deletion(-) 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h diff --git a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h
index a7439a224d..54b4492983 100644 index ecca81032b..395ec71f16 100644
--- a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h --- a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h
+++ b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h +++ b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h
@@ -1110,7 +1110,9 @@ class Platform::Root : public Genode::Root_component<Session_component> @@ -1169,7 +1169,9 @@ class Platform::Root : public Genode::Root_component<Session_component>
for (Genode::uint16_t val = 0; cap; cap = val >> 8) { for (Genode::uint16_t val = 0; cap; cap = val >> 8) {
val = config.read(config_access, cap, Platform::Device::ACCESS_16BIT); val = config.read(config_access, cap, Platform::Device::ACCESS_16BIT);
@ -24,10 +24,10 @@ index a7439a224d..54b4492983 100644
} catch (...) { } catch (...) {
xml.attribute("cap", "failed to read"); xml.attribute("cap", "failed to read");
-- --
2.28.0 2.31.0
From 1a687e4b6d3544bf369a01aeb1d8bdffc27139b1 Mon Sep 17 00:00:00 2001 From 1713de41fd6a3eecfc917f1f709b6bb7a043624b Mon Sep 17 00:00:00 2001
From: Emery Hemingway <ehmry@posteo.net> From: Emery Hemingway <ehmry@posteo.net>
Date: Tue, 10 Nov 2020 14:46:59 +0100 Date: Tue, 10 Nov 2020 14:46:59 +0100
Subject: [PATCH 2/2] drivers/platform/x86: assign device by optional index Subject: [PATCH 2/2] drivers/platform/x86: assign device by optional index
@ -39,9 +39,9 @@ attribute on <policy><pci/><policy> nodes. An index is not valid if the
Fix #3946 Fix #3946
--- ---
repos/os/src/drivers/platform/spec/x86/README | 13 +++++++----- repos/os/src/drivers/platform/spec/x86/README | 13 ++++++----
.../platform/spec/x86/pci_session_component.h | 20 +++++++++++++++---- .../platform/spec/x86/pci_session_component.h | 24 ++++++++++++++-----
2 files changed, 24 insertions(+), 9 deletions(-) 2 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/repos/os/src/drivers/platform/spec/x86/README b/repos/os/src/drivers/platform/spec/x86/README diff --git a/repos/os/src/drivers/platform/spec/x86/README b/repos/os/src/drivers/platform/spec/x86/README
index 83649f3b33..1c605e93fd 100644 index 83649f3b33..1c605e93fd 100644
@ -68,19 +68,19 @@ index 83649f3b33..1c605e93fd 100644
By default the driver will try to use MSIs if the device and the used kernel By default the driver will try to use MSIs if the device and the used kernel
diff --git a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h diff --git a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h
index 54b4492983..b321df6fcb 100644 index 395ec71f16..670179d79c 100644
--- a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h --- a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h
+++ b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h +++ b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h
@@ -379,7 +379,7 @@ class Platform::Session_component : public Genode::Rpc_object<Session> @@ -370,7 +370,7 @@ class Platform::Session_component : public Genode::Rpc_object<Session>
/** /**
* Check according session policy device usage * Check according session policy device usage
*/ */
- bool permit_device(Bdf const bdf, unsigned class_code) - bool permit_device(Pci::Bdf const bdf, unsigned const class_code)
+ bool permit_device(Bdf const bdf, unsigned class_code, unsigned &class_index) + bool permit_device(Bdf const bdf, unsigned class_code, unsigned &class_index)
{ {
using namespace Genode; using namespace Genode;
@@ -404,6 +404,16 @@ class Platform::Session_component : public Genode::Rpc_object<Session> @@ -397,6 +397,16 @@ class Platform::Session_component : public Genode::Rpc_object<Session>
if (class_sub_prog && (class_sub_prog ^ class_code) >> DONT_CHECK_PROGIF) if (class_sub_prog && (class_sub_prog ^ class_code) >> DONT_CHECK_PROGIF)
return; return;
@ -97,7 +97,7 @@ index 54b4492983..b321df6fcb 100644
/* if this bdf is used by some policy - deny */ /* if this bdf is used by some policy - deny */
if (find_dev_in_policy(bdf)) if (find_dev_in_policy(bdf))
return; return;
@@ -535,9 +545,9 @@ class Platform::Session_component : public Genode::Rpc_object<Session> @@ -544,9 +554,9 @@ class Platform::Session_component : public Genode::Rpc_object<Session>
throw Genode::Service_denied(); throw Genode::Service_denied();
} }
@ -109,7 +109,7 @@ index 54b4492983..b321df6fcb 100644
Genode::error("'", _label, "' - attributes beside 'class' detected"); Genode::error("'", _label, "' - attributes beside 'class' detected");
throw Genode::Service_denied(); throw Genode::Service_denied();
} }
@@ -663,6 +673,7 @@ class Platform::Session_component : public Genode::Rpc_object<Session> @@ -702,6 +712,7 @@ class Platform::Session_component : public Genode::Rpc_object<Session>
*/ */
Device_config config; Device_config config;
@ -117,16 +117,20 @@ index 54b4492983..b321df6fcb 100644
while (true) { while (true) {
function += 1; function += 1;
if (!_pci_bus.find_next(bus, device, function, &config, if (!_pci_bus.find_next(bus, device, function, &config,
@@ -682,7 +693,8 @@ class Platform::Session_component : public Genode::Rpc_object<Session> @@ -719,9 +730,10 @@ class Platform::Session_component : public Genode::Rpc_object<Session>
if (permit_device(Bdf { (unsigned)bus,
(unsigned)device, /* check that policy permit access to the matched device */
(unsigned)function }, if (permit_device(Pci::Bdf { (unsigned)bus,
- (unsigned)device,
- (unsigned)function },
- config.class_code())) - config.class_code()))
+ (unsigned)device,
+ (unsigned)function },
+ config.class_code(), + config.class_code(),
+ class_index)) + class_index))
break; break;
} }
-- --
2.28.0 2.31.0

View File

@ -13,8 +13,8 @@ with pkgs;
coreutils.hash = "sha256-ZVlFfLghHcXxwwRsN5xw2bVdIvvXoCNj2oZniOlSXrg="; coreutils.hash = "sha256-ZVlFfLghHcXxwwRsN5xw2bVdIvvXoCNj2oZniOlSXrg=";
curl.hash = "sha256-5+nRKLrho9oO0XlzDO6ppZ2kLfWaIReY24YFYSQT7Xc="; curl.hash = "sha256-5+nRKLrho9oO0XlzDO6ppZ2kLfWaIReY24YFYSQT7Xc=";
dde_bsd.hash = "sha256-KPA/ua3jETcHgWzhfhFm6ppds55Xi5YXJKDJvufJmU8="; dde_bsd.hash = "sha256-KPA/ua3jETcHgWzhfhFm6ppds55Xi5YXJKDJvufJmU8=";
dde_ipxe.hash = "sha256-NJ129+DkxFg1fFHJBABBFRRjqEVNSz6v2hEB80AuEM4="; dde_ipxe.hash = "sha256-rnMbramSDYBEjfSMoNpFcUQ4jfJh6SIHMtieSy9/Fe4=";
dde_linux.hash = "sha256-xHAgeKfArgMGKCGHi0762qkUcY97vbiAQYjM/ZRXCes="; dde_linux.hash = "sha256-PBj/pTbCTZVtqqppnQyFtwH3G5qrQABBKxK19uVuT8U=";
dde_rump = { dde_rump = {
hash = "sha256-Wr5otGkWEa+5xImsFHQzwap5LckNEbyWA/7xbNcOreI="; hash = "sha256-Wr5otGkWEa+5xImsFHQzwap5LckNEbyWA/7xbNcOreI=";
nativeBuildInputs = [ subversion ]; nativeBuildInputs = [ subversion ];

View File

@ -12,7 +12,14 @@ let Init = Sigil.Init
let Child = Init.Child let Child = Init.Child
in λ(params : { bash : Text, coreutils : Text }) → in λ ( params
: { bash : Text
, coreutils : Text
, cached_fs_rom : Text
, vfs : Text
, vfs_pipe : Text
}
) →
λ(binary : Text) → λ(binary : Text) →
let init = let init =
Init::{ Init::{
@ -25,24 +32,30 @@ in λ(params : { bash : Text, coreutils : Text }) →
{ vfs = { vfs =
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
, binary = "vfs" , binary = params.vfs
, provides = [ "File_system" ] , provides = [ "File_system" ]
, resources = Sigil.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 256 , caps = 256
, ram = Sigil.units.MiB 8 , ram = Sigil.units.MiB 8
} }
, routes = , routes =
Prelude.List.map [ Init.ServiceRoute.parent "ROM" ]
Text # Prelude.List.map
Init.ServiceRoute.Type Text
Init.ServiceRoute.parent Init.ServiceRoute.Type
[ "File_system", "Rtc" ] Init.ServiceRoute.parent
[ "File_system", "Rtc" ]
, config = Init.Config::{ , config = Init.Config::{
, content = , content =
[ VFS.vfs [ VFS.vfs
[ VFS.dir [ VFS.dir
"dev" "dev"
[ VFS.dir "pipes" [ VFS.leaf "pipe" ] [ VFS.dir
"pipes"
[ VFS.leafAttrs
"plugin"
(toMap { load = params.vfs_pipe })
]
, VFS.leaf "log" , VFS.leaf "log"
, VFS.leaf "null" , VFS.leaf "null"
, VFS.leaf "rtc" , VFS.leaf "rtc"
@ -78,11 +91,13 @@ in λ(params : { bash : Text, coreutils : Text }) →
, label = Init.LabelSelector.prefix "shell" , label = Init.LabelSelector.prefix "shell"
, attributes = toMap , attributes = toMap
{ root = "/", writeable = "yes" } { root = "/", writeable = "yes" }
, diag = Some True
} }
, Init.Config.Policy::{ , Init.Config.Policy::{
, service = "File_system" , service = "File_system"
, label = Init.LabelSelector.prefix "vfs_rom" , label = Init.LabelSelector.prefix "vfs_rom"
, attributes = toMap { root = "/" } , attributes = toMap { root = "/" }
, diag = Some True
} }
] ]
} }
@ -90,7 +105,7 @@ in λ(params : { bash : Text, coreutils : Text }) →
, vfs_rom = , vfs_rom =
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
, binary = "cached_fs_rom" , binary = params.cached_fs_rom
, provides = [ "ROM" ] , provides = [ "ROM" ]
, resources = Init.Resources::{ , resources = Init.Resources::{
, caps = 256 , caps = 256
@ -101,6 +116,12 @@ in λ(params : { bash : Text, coreutils : Text }) →
[ Init.Config.Policy::{ [ Init.Config.Policy::{
, service = "ROM" , service = "ROM"
, label = Init.LabelSelector.prefix "shell" , label = Init.LabelSelector.prefix "shell"
, diag = Some True
}
, Init.Config.Policy::{
, service = "ROM"
, label = Init.LabelSelector.prefix "/nix/store/"
, diag = Some True
} }
] ]
} }
@ -114,21 +135,6 @@ in λ(params : { bash : Text, coreutils : Text }) →
, caps = 256 , caps = 256
, ram = Sigil.units.MiB 8 , ram = Sigil.units.MiB 8
} }
, routes =
Prelude.List.map
Text
Init.ServiceRoute.Type
( λ(label : Text) →
Init.ServiceRoute.parentLabel
"ROM"
(Some label)
(Some label)
)
[ "libc.lib.so"
, "libm.lib.so"
, "posix.lib.so"
, "vfs.lib.so"
]
, config = , config =
( Libc.toConfig ( Libc.toConfig
Libc::{ Libc::{
@ -144,6 +150,14 @@ in λ(params : { bash : Text, coreutils : Text }) →
} }
) )
with attributes = toMap { ld_verbose = "true" } with attributes = toMap { ld_verbose = "true" }
, routes =
[ { service =
{ name = "ROM"
, label = Init.LabelSelector.prefix "urn:erisx2:"
}
, route = Init.Route.parent (None Text)
}
]
} }
} }
} }

View File

@ -1,21 +1,27 @@
{ {
name = "bash"; name = "bash";
machine = { pkgs, ... }: { machine = { config, lib, modulesPath, pkgs, ... }: {
genode.init.children.bash = { genode.init.children.bash = let
extraErisInputs' = with pkgs.genodePackages; {
bash = lib.getEris "bin" pkgs.bash;
cached_fs_rom = lib.getEris "bin" cached_fs_rom;
vfs = lib.getEris "bin" vfs;
vfs_pipe = lib.getEris "lib" vfs_pipe;
};
params = {
bash = "${pkgs.bash}";
coreutils = "${pkgs.coreutils}";
cached_fs_rom = extraErisInputs'.cached_fs_rom.cap;
vfs = extraErisInputs'.vfs.cap;
vfs_pipe = extraErisInputs'.vfs_pipe.cap;
};
in {
package = pkgs.genodePackages.init; package = pkgs.genodePackages.init;
extraErisInputs = builtins.attrValues extraErisInputs';
configFile = pkgs.writeText "bash.child.dhall" '' configFile = pkgs.writeText "bash.child.dhall" ''
${ ${./bash.dhall} ${lib.generators.toDhall params}
./bash.dhall
} { bash = "${pkgs.bash}", coreutils = "${pkgs.coreutils}" }
''; '';
extraInputs = with pkgs.genodePackages; [ extraInputs = with pkgs.genodePackages; [ pkgs.bash libc posix ];
pkgs.bash
cached_fs_rom
libc
posix
vfs
vfs_pipe
];
}; };
}; };
testScript = '' testScript = ''

View File

@ -16,9 +16,11 @@ let
test = map (p: import p) [ test = map (p: import p) [
./ahci.nix ./ahci.nix
./bash.nix ./bash.nix
./graphics.nix
./hello.nix ./hello.nix
./log.nix ./log.nix
./nim.nix ./nim.nix
./tor.nix
./usb.nix ./usb.nix
./vmm_x86.nix ./vmm_x86.nix
]; ];

View File

@ -4,13 +4,7 @@
genode.gui.consoleLog.enable = true; genode.gui.consoleLog.enable = true;
genode.core.storeBackend = "fs"; hardware.genode.framebuffer.driver = "vesa";
hardware.genode.framebuffer.driver = "boot";
hardware.genode.usb = {
enable = true;
biosHandoff = false;
storage.enable = true;
};
genode.init.verbose = true; genode.init.verbose = true;
genode.init.children.hello = { genode.init.children.hello = {

View File

@ -12,7 +12,6 @@ in λ(binary : Text) →
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
, binary , binary
, exitPropagate = True
, resources = Sigil.Init.Resources::{ , resources = Sigil.Init.Resources::{
, caps = 500 , caps = 500
, ram = Sigil.units.MiB 10 , ram = Sigil.units.MiB 10

View File

@ -35,10 +35,6 @@ rec {
../../nixos-modules/hardware ../../nixos-modules/hardware
../../nixos-modules/qemu-vm.nix ../../nixos-modules/qemu-vm.nix
../../nixos-modules/services ../../nixos-modules/services
{
key = "no-manual";
documentation.nixos.enable = false;
}
{ {
key = "qemu"; key = "qemu";
system.build.qemu = qemu; system.build.qemu = qemu;
@ -77,16 +73,14 @@ rec {
address = "192.168.${toString fst}.${toString m.snd}"; address = "192.168.${toString fst}.${toString m.snd}";
prefixLength = 24; prefixLength = 24;
}]; }];
genode.driver = "virtio"; # genode.driver = "virtio";
}); });
in { in {
key = "ip-address"; key = "ip-address";
config = { config = {
networking.hostName = mkDefault m.fst; networking.hostName = mkDefault m.fst;
networking.interfaces = { networking.interfaces = listToAttrs interfaces;
eth0.genode.driver = "virtio";
} // listToAttrs interfaces;
networking.primaryIPAddress = optionalString (interfaces != [ ]) networking.primaryIPAddress = optionalString (interfaces != [ ])
(head (head interfaces).value.ipv4.addresses).address; (head (head interfaces).value.ipv4.addresses).address;

View File

@ -280,7 +280,7 @@ class Machine:
if "usb" in args: if "usb" in args:
start_command += ( start_command += (
"-device piix3-usb-uhci -drive " "-device piix3-usb-ehci -drive "
+ "id=usbdisk,file=" + "id=usbdisk,file="
+ args["usb"] + args["usb"]
+ ",if=none,readonly " + ",if=none,readonly "

View File

@ -2,26 +2,28 @@
name = "tor"; name = "tor";
machine = { config, lib, pkgs, ... }: { machine = { config, lib, pkgs, ... }: {
virtualisation.memorySize = 768; documentation.nixos = {
enable = true;
includeAllModules = true;
};
environment.defaultPackages = { };
genode.gui.consoleLog.enable = true;
genode.core.storeBackend = "fs"; genode.core.storeBackend = "fs";
hardware.genode.usb.enable = true;
hardware.genode.usb.storage.enable = true; hardware.genode.usb.storage.enable = true;
services.tor = { services.tor = {
enable = true; enable = true;
client.enable = false; client.enable = false;
extraConfig = '' extraConfig = "Log [general,net,config,fs]debug stdout";
Log [general,net,config,fs]debug stdout
'';
relay = { relay = {
enable = true; enable = true;
port = 80;
role = "relay"; role = "relay";
bridgeTransports = [ ]; bridgeTransports = [ ];
}; };
}; };
virtualisation.memorySize = 768;
}; };
} }