From d57a144978bd58210c043975f0c18292dc700b49 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 28 Oct 2019 16:00:53 +0100 Subject: [PATCH 01/20] Update Genode sources, test Nix-built core --- tests/driver-linux.nix | 2 +- tests/driver-nova.nix | 7 +++++-- tests/nova-iso.nix | 2 ++ upstream/default.nix | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/driver-linux.nix b/tests/driver-linux.nix index fa9cf23..fb1a742 100644 --- a/tests/driver-linux.nix +++ b/tests/driver-linux.nix @@ -42,7 +42,7 @@ let bootModules' = { inherit testConfig; config = ./driver-config.xml; - core = "${depot.base-linux}/bin/core"; + core = "${genode.base-linux}/bin/core-linux"; init = "${genode.os}/bin/init"; "ld.lib.so" = "${depot.base-linux}/lib/ld.lib.so"; timer = "${genode.base-linux}/bin/linux_timer_drv"; diff --git a/tests/driver-nova.nix b/tests/driver-nova.nix index 86e3270..00ef105 100644 --- a/tests/driver-nova.nix +++ b/tests/driver-nova.nix @@ -38,13 +38,13 @@ let mkIso = import ./nova-iso.nix { inherit hostPkgs testPkgs; - coreNovaObj = "${testPkgs.depot.base-nova}/lib/core-nova.o"; + coreNovaObj = "${testPkgs.genode.base-nova}/lib/core-nova.o"; }; mkTest = { name ? "unamed", testScript, testConfig, bootModules, qemuMem ? 32 , ... }@t: let - iso = mkIso (with testPkgs; + bootModules' = (with testPkgs; { inherit testConfig; config = ./driver-config.xml; @@ -53,6 +53,8 @@ let timer = "${genode.base-nova}/bin/nova_timer_drv"; } // bootModules); + iso = mkIso bootModules'; + baseSetup = '' ## # Wait for a specific output of a already running spawned proce @@ -133,6 +135,7 @@ let in test // { inherit driver iso test; config = testConfig; + rom = bootModules'; }; in { diff --git a/tests/nova-iso.nix b/tests/nova-iso.nix index 9771bb6..cacab12 100644 --- a/tests/nova-iso.nix +++ b/tests/nova-iso.nix @@ -83,6 +83,8 @@ in hostPkgs.stdenv.mkDerivation { ${coreNovaObj} boot_modules.o \ -o boot/image.elf + strip boot/image.elf + # build ISO image cp ${testPkgs.nova}/hypervisor* boot/hypervisor cp ${./nova-isolinux.cfg} boot/syslinux/isolinux.cfg diff --git a/upstream/default.nix b/upstream/default.nix index 0abbe23..b307f0c 100644 --- a/upstream/default.nix +++ b/upstream/default.nix @@ -40,8 +40,8 @@ let src = fetchgit { url = "https://git.sr.ht/~ehmry/genode"; - rev = "dc0084cd5bebfdba74323bbe8f0a9dd1e8b7c524"; - sha256 = "12qwv6xq51dr5lps60c0r9dmxgk2agd8jgh0prafjk0wxq3xs95p"; + rev = "1dc25293b84fb3aed880bb4315adc7ce321c6343"; + sha256 = "1jqbc1i4hwi6aai728mz8wmbcpm864v2mlkyg36lm118b7cpp493"; fetchSubmodules = false; }; From 606b45b96aa3caaa36984478378ff516b66fdf91 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 28 Oct 2019 20:19:52 +0100 Subject: [PATCH 02/20] Initial Nix flake --- flake.lock | 30 ++++++++++++++ flake.nix | 40 +++++++++++++++++++ hydra/jobsets.json | 29 -------------- hydra/jobsets.nix | 78 ------------------------------------- hydra/solo5-jobs.nix | 44 --------------------- hydra/solo5.nix | 33 ---------------- default.nix => packages.nix | 26 +++++++------ pkgs/solo5/default.nix | 4 +- release.nix | 33 ---------------- tests/default.nix | 10 ++--- tests/driver-nova.nix | 8 ++-- tests/solo5/default.nix | 20 +++++----- 12 files changed, 106 insertions(+), 249 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix delete mode 100644 hydra/jobsets.json delete mode 100644 hydra/jobsets.nix delete mode 100644 hydra/solo5-jobs.nix delete mode 100644 hydra/solo5.nix rename default.nix => packages.nix (61%) delete mode 100644 release.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c943301 --- /dev/null +++ b/flake.lock @@ -0,0 +1,30 @@ +{ + "inputs": { + "dhall-haskell": { + "inputs": { + "nixpkgs": { + "inputs": {}, + "narHash": "sha256-wJg4DA700SoQbEz61448sR6BgxRa1R92K3vvCV1g+HY=", + "originalUri": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148", + "uri": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148" + }, + "nixpkgsStaticLinux": { + "inputs": {}, + "narHash": "sha256-famU3pJZ4vkElV9qc71HmyRVSvcrAhfMZ0UJKpmmKP8=", + "originalUri": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working", + "uri": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working&rev=925aac04f4ca58aceb83beef18cb7dae0715421b" + } + }, + "narHash": "sha256-NGbS2bymVuCQcanlBO41I6ZjSAZSLXhACK3qQU25zUs=", + "originalUri": "git+https://git.sr.ht/~ehmry/dhall-haskell?ref=flake", + "uri": "git+https://git.sr.ht/~ehmry/dhall-haskell?ref=flake&rev=256810cd5adf1ae5862eed0ffdaab4cf49f6fe67" + }, + "nixpkgs": { + "inputs": {}, + "narHash": "sha256-v6oDxjvJ7c0BWZJ/fd4L1gtnctQvkkFjL41lEt37vLg=", + "originalUri": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genodeFlake", + "uri": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genodeFlake&rev=28f37882fbb71230d6947af244a34cd3d42b280a" + } + }, + "version": 3 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..9fc2014 --- /dev/null +++ b/flake.nix @@ -0,0 +1,40 @@ +{ + edition = 201909; + + description = "Genode package overlay"; + + inputs = { + nixpkgs = { + uri = "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genodeFlake"; + flake = false; + }; + + dhall-haskell = { uri = "git+https://git.sr.ht/~ehmry/dhall-haskell?ref=flake"; }; + + }; + + outputs = { self, nixpkgs, dhall-haskell }: + let fullPkgs = import ./packages.nix { inherit nixpkgs; }; + in { + + packages = with fullPkgs; { + inherit stdenv nova genode-os genode-base genode-base-nova + genode-base-linux solo5; + }; + + defaultPackage = self.packages.solo5; + + hydraJobs = { + build.x86_64 = { + inherit (self.packages) + nova stdenv solo5 genode-base-linux genode-base-nova genode-os; + }; + tests = import ./tests { + inherit nixpkgs dhall-haskell; + genodepkgs = fullPkgs; + }; + }; + + checks = self.hydraJobs.tests.x86_64.nova.solo5; + }; +} diff --git a/hydra/jobsets.json b/hydra/jobsets.json deleted file mode 100644 index 352e97a..0000000 --- a/hydra/jobsets.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "enabled": 1, - "hidden": true, - "description": ".jobsets", - "nixexprinput": "genodepkgs", - "nixexprpath": "hydra/jobsets.nix", - "checkinterval": 300, - "schedulingshares": 100, - "enableemail": false, - "emailoverride": "ehmry@posteo.net", - "keepnr": 3, - "inputs": { - "genodepkgs": { - "type": "git", - "value": "https://gitea.c3d2.de/ehmry/genodepkgs.git master", - "emailresponsible": false - }, - "nixpkgs": { - "type": "git", - "value": "https://gitea.c3d2.de/ehmry/nixpkgs.git hybrid-19.09", - "emailresponsible": false - }, - "solo5PullRequests": { - "type": "githubpulls", - "value": "solo5 solo5", - "emailresponsible": false - } - } -} diff --git a/hydra/jobsets.nix b/hydra/jobsets.nix deleted file mode 100644 index 5f528bd..0000000 --- a/hydra/jobsets.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ genodepkgs ? ../default.nix -, nixpkgs ? import ../nixpkgs.nix -, solo5PullRequests -}: - -let - pkgs = import nixpkgs { }; - - mkJobSet = { description, nixexprpath, inputs }: { - inherit description nixexprpath inputs; - enabled = 1; - hidden = false; - nixexprinput = "genodepkgs"; - checkinterval = 300; - schedulingshares = 100; - enableemail = false; - emailoverride = ""; - keepnr = 8; - }; - - releaseInputs = { - - dhall-haskell = { - type = "git"; - value = "https://github.com/dhall-lang/dhall-haskell.git master"; - emailresponsible = false; - }; - - dhallNixpkgsStaticLinux = { - type = "git"; - value = - "https://github.com/nh2/nixpkgs.git 925aac04f4ca58aceb83beef18cb7dae0715421b"; - emailresponsible = false; - }; - - dhallNixpkgs = { - type = "git"; - value = - "https://gitea.c3d2.de/ehmry/nixpkgs.git 1d4de0d552ae9aa66a5b8dee5fb0650a4372d148"; - emailresponsible = false; - }; - - genodepkgs = { - type = "git"; - value = "https://gitea.c3d2.de/ehmry/genodepkgs.git master"; - emailresponsible = false; - }; - - nixpkgs = { - type = "git"; - value = "https://gitea.c3d2.de/ehmry/nixpkgs.git hybrid-19.09"; - emailresponsible = false; - }; - - nim-overlay = { - type = "git"; - value = "https://git.sr.ht/~ehmry/nim-overlay"; - emailresponsible = false; - }; - - }; - - solo5 = import ./solo5-jobs.nix { - inherit releaseInputs; - pullRequests = solo5PullRequests; - }; - - jobsets = ({ - - trunk = mkJobSet { - description = "Genodepkgs master branch"; - nixexprpath = "release.nix"; - inputs = releaseInputs; - }; - - } // solo5); - -in { jobsets = pkgs.writeText "jobsets.json" (builtins.toJSON jobsets); } diff --git a/hydra/solo5-jobs.nix b/hydra/solo5-jobs.nix deleted file mode 100644 index 22aec68..0000000 --- a/hydra/solo5-jobs.nix +++ /dev/null @@ -1,44 +0,0 @@ -# SPDX-FileCopyrightText: Emery Hemingway -# -# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 - -{ releaseInputs, pullRequests }: - -with builtins; - -let - pullRequests' = fromJSON (readFile pullRequests); - - prToJob = pr: { - name = "solo5-${toString pr.number}"; - value = { - - description = pr.title; - nixexprpath = "hydra/solo5.nix"; - enabled = 1; - hidden = false; - nixexprinput = "genodepkgs"; - checkinterval = 300; - schedulingshares = 100; - enableemail = false; - emailoverride = ""; - keepnr = 8; - - inputs = releaseInputs // { - - prSrc = { - type = "git"; - value = "https://github.com/Solo5/solo5.git pull/${ - toString pr.number - }/head"; - emailresponsible = false; - }; - - }; - - }; - }; - - jobs = map prToJob (attrValues pullRequests'); - -in listToAttrs jobs diff --git a/hydra/solo5.nix b/hydra/solo5.nix deleted file mode 100644 index 0c1e0b5..0000000 --- a/hydra/solo5.nix +++ /dev/null @@ -1,33 +0,0 @@ -# SPDX-FileCopyrightText: Emery Hemingway -# -# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 - -{ genodepkgs, nixpkgs, dhall-haskell, dhallNixpkgs, dhallNixpkgsStaticLinux -, nim-overlay, prSrc }: - -let - - prOverride = attrs: { - src = prSrc; - preConfigure = '' - cat <include/solo5/solo5_version.h.distrib - #ifndef __VERSION_H__ - #define __VERSION_H__ - #define SOLO5_VERSION "pull-request-test" - #endif - EOM - ''; - }; - - extraOverlays = - [ (self: super: { solo5 = super.solo5.overrideAttrs prOverride; }) ]; - - release = import ../release.nix { - inherit dhall-haskell dhallNixpkgs dhallNixpkgsStaticLinux nixpkgs - genodepkgs nim-overlay extraOverlays; - }; - -in { - build.x86_64.solo5 = release.build.x86_64.solo5; - tests.x86_64.nova.solo5 = release.tests.x86_64.nova.solo5; -} diff --git a/default.nix b/packages.nix similarity index 61% rename from default.nix rename to packages.nix index 39c74ac..37e3262 100644 --- a/default.nix +++ b/packages.nix @@ -5,13 +5,21 @@ let nativeOverlay = self: super: # Overlay of locally defined packages - with self; { - depot = callPackage ./depot { }; - dhallPackages = super.dhallPackages // (callPackage ./dhall { }); + with self; + let genode = (callPackage ./upstream { } // { libc = callPackage ./pkgs/libc { }; nic_bus = callPackage ./pkgs/nic_bus { }; }); + dhallPackages = super.dhallPackages // (callPackage ./dhall { }); + in { + genode-base = genode.base; + genode-base-linux = genode.base-linux; + genode-base-nova = genode.base-nova; + genode-os = genode.os; + depot = callPackage ./depot { }; + dhallGenode = dhallPackages.genode; + dhallPrelude = dhallPackages.prelude; nova = callPackage ./NOVA { }; solo5 = callPackage ./pkgs/solo5 { }; }; @@ -19,15 +27,11 @@ let toolchainOverlay = import ./toolchain-overlay; # Overlay of toolchain patches -in { nixpkgs ? ../nixpkgs, nim-overlay ? , extraOverlays ? [] }: +in { nixpkgs, extraOverlays ? [ ] }: import nixpkgs { # Evaluate an overlayed Nixpkgs for a Genode target - config.allowUnsupportedSystem = true; - crossSystem = { - isx86_64 = true; - isGenode = true; - imports = [ ./platform.nix ]; - }; - overlays = [ toolchainOverlay nativeOverlay (import nim-overlay) ] ++ extraOverlays; + localSystem = "x86_64-linux"; + crossSystem = "x86_64-genode"; + overlays = [ toolchainOverlay nativeOverlay ] ++ extraOverlays; } diff --git a/pkgs/solo5/default.nix b/pkgs/solo5/default.nix index cabedba..c8e328b 100644 --- a/pkgs/solo5/default.nix +++ b/pkgs/solo5/default.nix @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 -{ stdenv, buildPackages, fetchurl, llvmPackages, pkgconfig, genode }: +{ stdenv, buildPackages, fetchurl, llvmPackages, pkgconfig, genode-base, genode-os }: let version = "0.6.3"; in stdenv.mkDerivation { @@ -13,7 +13,7 @@ in stdenv.mkDerivation { nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ genode.base.dev genode.os.dev ]; + buildInputs = [ genode-base.dev genode-os.dev ]; src = fetchurl { url = "https://github.com/Solo5/solo5/releases/download/v${version}/solo5-v${version}.tar.gz"; diff --git a/release.nix b/release.nix deleted file mode 100644 index 5e92718..0000000 --- a/release.nix +++ /dev/null @@ -1,33 +0,0 @@ -# SPDX-FileCopyrightText: Emery Hemingway -# -# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 - -let dhallPinned = import ../dhall-haskell/nix/pinnedNixpkgs.nix; in - -{ genodepkgs ? ./default.nix -, nixpkgs ? import ./nixpkgs.nix -, dhall-haskell ? -, dhallNixpkgs ? dhallPinned.nixpkgs -, dhallNixpkgsStaticLinux ? dhallPinned.nixpkgsStaticLinux -, nim-overlay ? -, extraOverlays ? [] -}: - -let - pkgs = import genodepkgs { inherit nixpkgs nim-overlay extraOverlays; }; - dhall-haskell' = import (dhall-haskell + "/release.nix") { - nixpkgs = dhallNixpkgs; - nixpkgsStaticLinux = dhallNixpkgsStaticLinux; - }; -in { - build.x86_64 = { - inherit (pkgs) nova stdenv solo5; - genode = removeAttrs pkgs.genode [ "override" "overrideDerivation" ]; - }; - - tests = import ./tests { - inherit nixpkgs; - genodepkgs = pkgs; - dhall-haskell = dhall-haskell'; - }; -} diff --git a/tests/default.nix b/tests/default.nix index 62b69bf..8439fde 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -11,12 +11,12 @@ let solo5 = call ./solo5 { }; }; -in { genodepkgs ? import ./../default.nix { }, nixpkgs ? import ./../nixpkgs.nix -, dhall-haskell }: +in { genodepkgs, nixpkgs, dhall-haskell }: let hostPkgs = import nixpkgs { - overlays = [ (self: super: { dhall = dhall-haskell.linux-dhall; }) ]; + system = "x86_64-linux"; + overlays = [ (self: super: { inherit (dhall-haskell.packages) dhall; }) ]; }; testPkgs = genodepkgs; @@ -40,8 +40,8 @@ let buildInputs = [ hostPkgs.dhall ]; initConfig = path; initArgs = args; - DHALL_PRELUDE = "${testPkgs.dhallPackages.prelude}/package.dhall"; - DHALL_GENODE = "${testPkgs.dhallPackages.genode}/package.dhall"; + DHALL_PRELUDE = "${testPkgs.dhallPrelude}/package.dhall"; + DHALL_GENODE = "${testPkgs.dhallGenode}/package.dhall"; } '' export XDG_CACHE_HOME=$NIX_BUILD_TOP dhall text \ diff --git a/tests/driver-nova.nix b/tests/driver-nova.nix index 00ef105..76d6b66 100644 --- a/tests/driver-nova.nix +++ b/tests/driver-nova.nix @@ -38,7 +38,7 @@ let mkIso = import ./nova-iso.nix { inherit hostPkgs testPkgs; - coreNovaObj = "${testPkgs.genode.base-nova}/lib/core-nova.o"; + coreNovaObj = "${testPkgs.genode-base-nova}/lib/core-nova.o"; }; mkTest = { name ? "unamed", testScript, testConfig, bootModules, qemuMem ? 32 @@ -48,9 +48,9 @@ let { inherit testConfig; config = ./driver-config.xml; - init = "${genode.os}/bin/init"; + init = "${genode-os}/bin/init"; "ld.lib.so" = "${depot.base-nova}/lib/ld.lib.so"; - timer = "${genode.base-nova}/bin/nova_timer_drv"; + timer = "${genode-base-nova}/bin/nova_timer_drv"; } // bootModules); iso = mkIso bootModules'; @@ -94,7 +94,7 @@ let } global spawn_id - spawn ${hostPkgs.qemu}/bin/qemu-system-x86_64 -cdrom ${iso} -nographic \ + spawn ${hostPkgs.qemu_test}/bin/qemu-system-x86_64 -cdrom ${iso} -nographic \ -machine q35 -m size=${toString qemuMem} wait_for_output $wait_for_re $timeout_value $spawn_id } diff --git a/tests/solo5/default.nix b/tests/solo5/default.nix index 3ef5dd8..195e291 100644 --- a/tests/solo5/default.nix +++ b/tests/solo5/default.nix @@ -28,7 +28,7 @@ let name = "blk"; bootModules = { test = "${solo5.tests}/bin/solo5-test_blk"; - ram_block = "${genode.os}/bin/ram_block"; + ram_block = "${genode-os}/bin/ram_block"; }; testConfig = testEnv.lib.renderDhallInit ./blk.dhall "{=}"; } @@ -69,7 +69,7 @@ let name = "mft_maxdevices"; bootModules = { test = "${solo5.tests}/bin/solo5-test_mft_maxdevices"; - rom_block = "${genode.os}/bin/rom_block"; + rom_block = "${genode-os}/bin/rom_block"; }; testConfig = testEnv.lib.renderDhallInit ./mft_maxdevices.dhall "{=}"; } @@ -79,9 +79,9 @@ let name = "net"; bootModules = { test = "${solo5.tests}/bin/solo5-test_net"; - nic_bridge = "${genode.os}/bin/nic_bridge"; - nic_loopback = "${genode.os}/bin/nic_loopback"; - ping = "${genode.os}/bin/ping"; + nic_bridge = "${genode-os}/bin/nic_bridge"; + nic_loopback = "${genode-os}/bin/nic_loopback"; + ping = "${genode-os}/bin/ping"; }; testConfig = testEnv.lib.renderDhallInit ./net.dhall "{=}"; testScript = '' @@ -93,10 +93,10 @@ let name = "net_2if"; bootModules = { test = "${solo5.tests}/bin/solo5-test_net_2if"; - sequence = "${genode.os}/bin/sequence"; - nic_bridge = "${genode.os}/bin/nic_bridge"; - nic_loopback = "${genode.os}/bin/nic_loopback"; - ping = "${genode.os}/bin/ping"; + sequence = "${genode-os}/bin/sequence"; + nic_bridge = "${genode-os}/bin/nic_bridge"; + nic_loopback = "${genode-os}/bin/nic_loopback"; + ping = "${genode-os}/bin/ping"; }; testConfig = testEnv.lib.renderDhallInit ./net_2if.dhall "{=}"; testScript = '' @@ -151,7 +151,7 @@ let name = "time"; bootModules = { test = "${solo5.tests}/bin/solo5-test_time"; - rtc_drv = "${genode.os}/bin/rtc_drv"; + rtc_drv = "${genode-os}/bin/rtc_drv"; }; testConfig = testEnv.lib.renderDhallInit ./time.dhall "{=}"; } From 83904ca3e69b6e0da1009814a1a41226153a5764 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 5 Nov 2019 16:00:56 +0100 Subject: [PATCH 03/20] Update flake --- flake.lock | 10 +++++----- flake.nix | 17 +++++++---------- packages.nix | 4 ++-- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/flake.lock b/flake.lock index c943301..c4bfe37 100644 --- a/flake.lock +++ b/flake.lock @@ -16,14 +16,14 @@ } }, "narHash": "sha256-NGbS2bymVuCQcanlBO41I6ZjSAZSLXhACK3qQU25zUs=", - "originalUri": "git+https://git.sr.ht/~ehmry/dhall-haskell?ref=flake", - "uri": "git+https://git.sr.ht/~ehmry/dhall-haskell?ref=flake&rev=256810cd5adf1ae5862eed0ffdaab4cf49f6fe67" + "originalUri": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake", + "uri": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake&rev=256810cd5adf1ae5862eed0ffdaab4cf49f6fe67" }, "nixpkgs": { "inputs": {}, - "narHash": "sha256-v6oDxjvJ7c0BWZJ/fd4L1gtnctQvkkFjL41lEt37vLg=", - "originalUri": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genodeFlake", - "uri": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genodeFlake&rev=28f37882fbb71230d6947af244a34cd3d42b280a" + "narHash": "sha256-1pvSqpPbcREIGI7BF6A29b81bH/dZvywTPwYhrMaRa0=", + "originalUri": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git", + "uri": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=master&rev=ff59349d99ff0ff2496e85278c596df3a14ef3ec" } }, "version": 3 diff --git a/flake.nix b/flake.nix index 9fc2014..bd27d8d 100644 --- a/flake.nix +++ b/flake.nix @@ -4,17 +4,13 @@ description = "Genode package overlay"; inputs = { - nixpkgs = { - uri = "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genodeFlake"; - flake = false; - }; - - dhall-haskell = { uri = "git+https://git.sr.ht/~ehmry/dhall-haskell?ref=flake"; }; - + nixpkgs.uri = "git+https://gitea.c3d2.de/ehmry/nixpkgs.git"; + dhall-haskell.uri = + "git+https://github.com/dhall-lang/dhall-haskell?ref=flake"; }; outputs = { self, nixpkgs, dhall-haskell }: - let fullPkgs = import ./packages.nix { inherit nixpkgs; }; + let fullPkgs = import ./packages.nix { nixpkgs = import nixpkgs; }; in { packages = with fullPkgs; { @@ -22,7 +18,7 @@ genode-base-linux solo5; }; - defaultPackage = self.packages.solo5; + defaultPackage = self.packages.genode-os; hydraJobs = { build.x86_64 = { @@ -35,6 +31,7 @@ }; }; - checks = self.hydraJobs.tests.x86_64.nova.solo5; + checks = { inherit (self.hydraJobs.tests.x86_64.nova) pci; }; }; } + diff --git a/packages.nix b/packages.nix index 37e3262..826a8de 100644 --- a/packages.nix +++ b/packages.nix @@ -27,9 +27,9 @@ let toolchainOverlay = import ./toolchain-overlay; # Overlay of toolchain patches -in { nixpkgs, extraOverlays ? [ ] }: +in { nixpkgs ? import , extraOverlays ? [ ] }: -import nixpkgs { +nixpkgs { # Evaluate an overlayed Nixpkgs for a Genode target localSystem = "x86_64-linux"; crossSystem = "x86_64-genode"; From 7eda0b9f559d47f7eeabc8854889140c8acc405f Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 5 Nov 2019 16:01:32 +0100 Subject: [PATCH 04/20] Rename genode.os to genode-os --- tests/pci.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/pci.nix b/tests/pci.nix index b29e9e5..2e200ab 100644 --- a/tests/pci.nix +++ b/tests/pci.nix @@ -8,10 +8,10 @@ testEnv.mkTest { testConfig = testEnv.lib.renderDhallInit ./pci.dhall "{=}"; bootModules = { - acpi_drv = "${genode.os}/bin/acpi_drv"; - platform_drv = "${genode.os}/bin/platform_drv"; - report_rom = "${genode.os}/bin/report_rom"; - test-pci = "${genode.os}/bin/test-pci"; + acpi_drv = "${genode-os}/bin/acpi_drv"; + platform_drv = "${genode-os}/bin/platform_drv"; + report_rom = "${genode-os}/bin/report_rom"; + test-pci = "${genode-os}/bin/test-pci"; }; testScript = '' From 4aba5a4e85f22b22c4e7efb32c01d8aff7fa126c Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 5 Nov 2019 17:38:47 +0100 Subject: [PATCH 05/20] Convert flake to a attrset of systems --- flake.nix | 36 +++++++++++++--------------- packages.nix | 53 +++++++++++++++++++++--------------------- tests/default.nix | 27 ++++++++++++++------- tests/driver-linux.nix | 11 +++++---- tests/driver-nova.nix | 5 ++-- tests/fs_report.nix | 12 +++++----- tests/libc.nix | 4 ++-- tests/log.nix | 4 ++-- tests/pci.nix | 2 +- tests/signal.nix | 4 ++-- 10 files changed, 82 insertions(+), 76 deletions(-) diff --git a/flake.nix b/flake.nix index bd27d8d..d733b4d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { edition = 201909; - description = "Genode package overlay"; + description = "Genode packages"; inputs = { nixpkgs.uri = "git+https://gitea.c3d2.de/ehmry/nixpkgs.git"; @@ -10,28 +10,24 @@ }; outputs = { self, nixpkgs, dhall-haskell }: - let fullPkgs = import ./packages.nix { nixpkgs = import nixpkgs; }; + let + nixpkgs' = import nixpkgs; + systems = [ "x86_64-genode" ]; + + forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); + in { - packages = with fullPkgs; { - inherit stdenv nova genode-os genode-base genode-base-nova - genode-base-linux solo5; - }; + packages = forAllSystems (system: + import ./packages.nix { + inherit system; + nixpkgs = nixpkgs'; + }); - defaultPackage = self.packages.genode-os; - - hydraJobs = { - build.x86_64 = { - inherit (self.packages) - nova stdenv solo5 genode-base-linux genode-base-nova genode-os; - }; - tests = import ./tests { + checks = forAllSystems (system: + import ./tests { inherit nixpkgs dhall-haskell; - genodepkgs = fullPkgs; - }; - }; - - checks = { inherit (self.hydraJobs.tests.x86_64.nova) pci; }; + genodepkgs = builtins.getAttr system self.packages; + }); }; } - diff --git a/packages.nix b/packages.nix index 826a8de..3d08bd2 100644 --- a/packages.nix +++ b/packages.nix @@ -2,36 +2,35 @@ # # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 -let - nativeOverlay = self: super: - # Overlay of locally defined packages - with self; - let - genode = (callPackage ./upstream { } // { - libc = callPackage ./pkgs/libc { }; - nic_bus = callPackage ./pkgs/nic_bus { }; - }); - dhallPackages = super.dhallPackages // (callPackage ./dhall { }); - in { - genode-base = genode.base; - genode-base-linux = genode.base-linux; - genode-base-nova = genode.base-nova; - genode-os = genode.os; - depot = callPackage ./depot { }; - dhallGenode = dhallPackages.genode; - dhallPrelude = dhallPackages.prelude; - nova = callPackage ./NOVA { }; - solo5 = callPackage ./pkgs/solo5 { }; - }; +{ system ? "x86_64-genode", nixpkgs ? import , extraOverlays ? [ ] }: +let toolchainOverlay = import ./toolchain-overlay; # Overlay of toolchain patches -in { nixpkgs ? import , extraOverlays ? [ ] }: + super = nixpkgs { + # Evaluate an overlayed Nixpkgs for a Genode target + localSystem = "x86_64-linux"; + crossSystem = "x86_64-genode"; + overlays = [ toolchainOverlay ] ++ extraOverlays; + }; -nixpkgs { - # Evaluate an overlayed Nixpkgs for a Genode target - localSystem = "x86_64-linux"; - crossSystem = "x86_64-genode"; - overlays = [ toolchainOverlay nativeOverlay ] ++ extraOverlays; + inherit (super) callPackage; + + genode = (callPackage ./upstream { } // { + libc = callPackage ./pkgs/libc { }; + nic_bus = callPackage ./pkgs/nic_bus { }; + }); + dhallPackages = super.dhallPackages // (callPackage ./dhall { }); +in rec { + inherit (super) stdenv; + genode-base = genode.base; + genode-base-linux = genode.base-linux; + genode-base-nova = genode.base-nova; + genode-os = genode.os; + + dhallGenode = dhallPackages.genode; + dhallPrelude = dhallPackages.prelude; + nova = callPackage ./NOVA { }; + solo5 = callPackage ./pkgs/solo5 { inherit genode-base genode-os; }; } diff --git a/tests/default.nix b/tests/default.nix index 8439fde..effac0a 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -8,7 +8,7 @@ let libc = call ./libc.nix { }; log = call ./log.nix { }; signal = call ./signal.nix { }; - solo5 = call ./solo5 { }; + # solo5 = call ./solo5 { }; }; in { genodepkgs, nixpkgs, dhall-haskell }: @@ -18,6 +18,7 @@ let system = "x86_64-linux"; overlays = [ (self: super: { inherit (dhall-haskell.packages) dhall; }) ]; }; + depot = hostPkgs.callPackage ../depot { }; testPkgs = genodepkgs; lib = hostPkgs.lib // { @@ -50,11 +51,19 @@ let ''; }; -in { - x86_64 = { - linux = tests - (import ./driver-linux.nix { inherit testPkgs hostPkgs lib; }).callTest; - nova = (call: ((tests call) // { pci = call ./pci.nix { }; })) - (import ./driver-nova.nix { inherit testPkgs hostPkgs lib; }).callTest; - }; -} + linux = tests (import ./driver-linux.nix { + inherit testPkgs hostPkgs lib depot; + }).callTest; + + nova = (call: ((tests call) // { pci = call ./pci.nix { }; })) + (import ./driver-nova.nix { + inherit testPkgs hostPkgs lib depot; + }).callTest; + + testsToList = tests: + map (test: { + inherit (test) name; + value = test; + }) (builtins.attrValues tests); + +in with builtins; listToAttrs (concatLists (map (testsToList) [ linux nova ])) diff --git a/tests/driver-linux.nix b/tests/driver-linux.nix index fb1a742..8bfaa9c 100644 --- a/tests/driver-linux.nix +++ b/tests/driver-linux.nix @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 -{ testPkgs, hostPkgs, lib }: +{ testPkgs, hostPkgs, lib, depot }: let testDriver = with hostPkgs; @@ -23,7 +23,7 @@ let runTests = driver: hostPkgs.stdenv.mkDerivation { - name = "test-run-${driver.testName}"; + name = "linux-"+driver.testName; preferLocalBuild = true; buildCommand = '' @@ -42,10 +42,10 @@ let bootModules' = { inherit testConfig; config = ./driver-config.xml; - core = "${genode.base-linux}/bin/core-linux"; - init = "${genode.os}/bin/init"; + core = "${genode-base-linux}/bin/core-linux"; + init = "${genode-os}/bin/init"; "ld.lib.so" = "${depot.base-linux}/lib/ld.lib.so"; - timer = "${genode.base-linux}/bin/linux_timer_drv"; + timer = "${genode-base-linux}/bin/linux_timer_drv"; } // bootModules; baseSetup = with builtins; @@ -92,5 +92,6 @@ in { isNova = false; }; pkgs = testPkgs; + inherit depot; } // args)); } diff --git a/tests/driver-nova.nix b/tests/driver-nova.nix index 76d6b66..963aaaa 100644 --- a/tests/driver-nova.nix +++ b/tests/driver-nova.nix @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 -{ testPkgs, hostPkgs, lib }: +{ testPkgs, hostPkgs, lib, depot }: let testDriver = with hostPkgs; @@ -23,7 +23,7 @@ let runTests = driver: hostPkgs.stdenv.mkDerivation { - name = "test-run-${driver.testName}"; + name = "nova-"+driver.testName; preferLocalBuild = true; buildCommand = '' @@ -147,5 +147,6 @@ in { isNova = true; }; pkgs = testPkgs; + inherit depot; } // args)); } diff --git a/tests/fs_report.nix b/tests/fs_report.nix index d3ccc8d..b4f6a5b 100644 --- a/tests/fs_report.nix +++ b/tests/fs_report.nix @@ -1,4 +1,4 @@ -{ testEnv, pkgs }: +{ testEnv, pkgs, ... }: with pkgs; testEnv.mkTest { @@ -8,11 +8,11 @@ testEnv.mkTest { testConfig = ./fs_report.xml; bootModules = { - fs_report = "${genode.os}/bin/fs_report"; - fs_rom = "${genode.os}/bin/fs_rom"; - ram_fs = "${genode.os}/bin/ram_fs"; - test-fs_report = "${genode.os}/bin/test-fs_report"; - "vfs.lib.so" = "${genode.os}/lib/vfs.lib.so"; + fs_report = "${genode-os}/bin/fs_report"; + fs_rom = "${genode-os}/bin/fs_rom"; + ram_fs = "${genode-os}/bin/ram_fs"; + test-fs_report = "${genode-os}/bin/test-fs_report"; + "vfs.lib.so" = "${genode-os}/lib/vfs.lib.so"; }; testScript = '' diff --git a/tests/libc.nix b/tests/libc.nix index 2a3afb3..d7a6f2c 100644 --- a/tests/libc.nix +++ b/tests/libc.nix @@ -1,4 +1,4 @@ -{ testEnv, pkgs }: +{ testEnv, pkgs, depot }: with pkgs; testEnv.mkTest rec { @@ -12,7 +12,7 @@ testEnv.mkTest rec { "libm.lib.so" = "${depot.libc}/lib/libm.lib.so"; "posix.lib.so" = "${depot.posix}/lib/posix.lib.so"; "test-libc" = "${depot.test-libc}/bin/test-libc"; - "vfs.lib.so" = "${genode.os}/lib/vfs.lib.so"; + "vfs.lib.so" = "${genode-os}/lib/vfs.lib.so"; }; qemuMem = 384; diff --git a/tests/log.nix b/tests/log.nix index 486b2f6..ead29cc 100644 --- a/tests/log.nix +++ b/tests/log.nix @@ -1,4 +1,4 @@ -{ testEnv, pkgs }: +{ testEnv, pkgs, ... }: with pkgs; testEnv.mkTest rec { @@ -7,7 +7,7 @@ testEnv.mkTest rec { testConfig = testEnv.lib.renderDhallInit ./log.dhall "{=}"; - bootModules.test-log = "${genode.base}/bin/test-log"; + bootModules.test-log = "${genode-base}/bin/test-log"; testScript = "run_genode_until {Test done.} 10"; } diff --git a/tests/pci.nix b/tests/pci.nix index 2e200ab..5bf7bb9 100644 --- a/tests/pci.nix +++ b/tests/pci.nix @@ -1,4 +1,4 @@ -{ testEnv, pkgs }: +{ testEnv, pkgs, ... }: with pkgs; testEnv.mkTest { diff --git a/tests/signal.nix b/tests/signal.nix index 5c99b57..259126c 100644 --- a/tests/signal.nix +++ b/tests/signal.nix @@ -1,4 +1,4 @@ -{ testEnv, pkgs }: +{ testEnv, pkgs, ... }: with pkgs; testEnv.mkTest rec { @@ -7,7 +7,7 @@ testEnv.mkTest rec { testConfig = testEnv.lib.renderDhallInit ./signal.dhall "{=}"; - bootModules.test-signal = "${genode.os}/bin/test-signal"; + bootModules.test-signal = "${genode-os}/bin/test-signal"; testScript = "run_genode_until {--- Signalling test finished ---} 120"; } From 410a6522c533170a273373cba8b9900a16b0aade Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sun, 10 Nov 2019 09:42:12 +0100 Subject: [PATCH 06/20] Add 'lib' to flake top-level --- flake.nix | 4 +- lib/default.nix | 141 +++++++++++++++++++++++++++++++ {tests => lib}/genode.ld | 0 {tests => lib}/nova-bss.ld | 0 {tests => lib}/nova-isolinux.cfg | 0 tests/default.nix | 32 +------ tests/driver-nova.nix | 10 +-- 7 files changed, 150 insertions(+), 37 deletions(-) create mode 100644 lib/default.nix rename {tests => lib}/genode.ld (100%) rename {tests => lib}/nova-bss.ld (100%) rename {tests => lib}/nova-isolinux.cfg (100%) diff --git a/flake.nix b/flake.nix index d733b4d..04cd9a9 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,8 @@ in { + lib = import ./lib { genodepkgs = self; inherit nixpkgs dhall-haskell; }; + packages = forAllSystems (system: import ./packages.nix { inherit system; @@ -26,7 +28,7 @@ checks = forAllSystems (system: import ./tests { - inherit nixpkgs dhall-haskell; + inherit self nixpkgs dhall-haskell; genodepkgs = builtins.getAttr system self.packages; }); }; diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 0000000..c34b496 --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,141 @@ +{ genodepkgs, nixpkgs, dhall-haskell }: + +let + hostPkgs = import nixpkgs { + system = "x86_64-linux"; + overlays = [ (self: super: { inherit (dhall-haskell.packages) dhall; }) ]; + }; + depot = hostPkgs.callPackage ../depot { }; + testPkgs = genodepkgs.packages.x86_64-genode; + +in { + dhallText = name: source: + hostPkgs.runCommand name { + inherit name source; + preferLocalBuild = true; + buildInputs = [ hostPkgs.dhall ]; + DHALL_PRELUDE = "${testPkgs.dhallPackages.prelude}/package.dhall"; + DHALL_GENODE = "${testPkgs.dhallPackages.genode}/package.dhall"; + } '' + export XDG_CACHE_HOME=$NIX_BUILD_TOP + dhall text < $source > $out + ''; + + renderDhallInit = path: args: + hostPkgs.runCommand "init.xml" { + preferLocalBuild = true; + buildInputs = [ hostPkgs.dhall ]; + initConfig = path; + initArgs = args; + DHALL_PRELUDE = "${testPkgs.dhallPrelude}/package.dhall"; + DHALL_GENODE = "${testPkgs.dhallGenode}/package.dhall"; + } '' + export XDG_CACHE_HOME=$NIX_BUILD_TOP + dhall text \ + <<< 'let Prelude = env:DHALL_GENODE in Prelude.Init.render (Prelude.Init::{ children = toMap (env:initConfig env:initArgs) })' \ + > $out + ''; + + x86_64-genode.buildNovaIso = { name, rom }: + let + inherit (hostPkgs) cdrkit syslinux; + coreNovaObj = "${testPkgs.genode-base-nova}/lib/core-nova.o"; + + addressType = ".quad"; # TODO: 32 or 64 bit?! + + map' = with nixpkgs.lib; + l: f: + concatStrings (imap0 (i: v: (f (toString i) v)) l); + + mapNames = map' (builtins.attrNames rom); + mapValues = map' (builtins.attrValues rom); + + modulesAsm = '' + .set MIN_PAGE_SIZE_LOG2, 12 + .set DATA_ACCESS_ALIGNM_LOG2, 3 + + .section .data + + .p2align DATA_ACCESS_ALIGNM_LOG2 + .global _boot_modules_headers_begin + _boot_modules_headers_begin: + + '' + (mapNames (i: _: '' + ${addressType} _boot_module_${i}_name + ${addressType} _boot_module_${i}_begin + ${addressType} _boot_module_${i}_end - _boot_module_${i}_begin + + '')) + '' + .global _boot_modules_headers_end + _boot_modules_headers_end: + + '' + (mapNames (i: name: '' + .p2align DATA_ACCESS_ALIGNM_LOG2 + _boot_module_${i}_name: + .string "${name}" + .byte 0 + + '')) + '' + .section .data.boot_modules_binaries + + .global _boot_modules_binaries_begin + _boot_modules_binaries_begin: + + '' + (mapValues (i: path: '' + .p2align MIN_PAGE_SIZE_LOG2 + _boot_module_${i}_begin: + .incbin "${path}" + _boot_module_${i}_end: + + '')) + '' + .p2align MIN_PAGE_SIZE_LOG2 + .global _boot_modules_binaries_end + _boot_modules_binaries_end: + ''; + + syslinuxDir = "${syslinux}/share/syslinux"; + + in hostPkgs.stdenv.mkDerivation { + name = name + ".iso"; + preferLocalBuild = true; + buildInputs = [ testPkgs.stdenv.cc hostPkgs.cdrkit ]; + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + inherit modulesAsm; + installPhase = '' + mkdir -p boot/syslinux + + # compile the boot modules into one object file + $CC -c -x assembler -o boot_modules.o - <<< $modulesAsm + + # link final image + $LD -nostdlib \ + -T${./genode.ld} \ + -T${./nova-bss.ld} \ + -z max-page-size=0x1000 \ + -Ttext=0x100000 -gc-sections \ + ${coreNovaObj} boot_modules.o \ + -o boot/image.elf + + strip boot/image.elf + + # build ISO image + cp ${testPkgs.nova}/hypervisor* boot/hypervisor + cp ${./nova-isolinux.cfg} boot/syslinux/isolinux.cfg + cp \ + ${syslinuxDir}/isolinux.bin \ + ${syslinuxDir}/ldlinux.c32 \ + ${syslinuxDir}/libcom32.c32 \ + ${syslinuxDir}/mboot.c32 \ + boot/syslinux + chmod +w boot/syslinux/isolinux.bin + mkisofs -o $out \ + -b syslinux/isolinux.bin -c syslinux/boot.cat \ + -no-emul-boot -boot-load-size 4 -boot-info-table \ + -iso-level 2 \ + boot + ''; + }; + +} diff --git a/tests/genode.ld b/lib/genode.ld similarity index 100% rename from tests/genode.ld rename to lib/genode.ld diff --git a/tests/nova-bss.ld b/lib/nova-bss.ld similarity index 100% rename from tests/nova-bss.ld rename to lib/nova-bss.ld diff --git a/tests/nova-isolinux.cfg b/lib/nova-isolinux.cfg similarity index 100% rename from tests/nova-isolinux.cfg rename to lib/nova-isolinux.cfg diff --git a/tests/default.nix b/tests/default.nix index effac0a..cb2a114 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -11,7 +11,7 @@ let # solo5 = call ./solo5 { }; }; -in { genodepkgs, nixpkgs, dhall-haskell }: +in { self, genodepkgs, nixpkgs, dhall-haskell }: let hostPkgs = import nixpkgs { @@ -21,35 +21,7 @@ let depot = hostPkgs.callPackage ../depot { }; testPkgs = genodepkgs; - lib = hostPkgs.lib // { - - dhallText = name: source: - hostPkgs.runCommand name { - inherit name source; - preferLocalBuild = true; - buildInputs = [ hostPkgs.dhall ]; - DHALL_PRELUDE = "${testPkgs.dhallPackages.prelude}/package.dhall"; - DHALL_GENODE = "${testPkgs.dhallPackages.genode}/package.dhall"; - } '' - export XDG_CACHE_HOME=$NIX_BUILD_TOP - dhall text < $source > $out - ''; - - renderDhallInit = path: args: - hostPkgs.runCommand "init.xml" { - preferLocalBuild = true; - buildInputs = [ hostPkgs.dhall ]; - initConfig = path; - initArgs = args; - DHALL_PRELUDE = "${testPkgs.dhallPrelude}/package.dhall"; - DHALL_GENODE = "${testPkgs.dhallGenode}/package.dhall"; - } '' - export XDG_CACHE_HOME=$NIX_BUILD_TOP - dhall text \ - <<< 'let Prelude = env:DHALL_GENODE in Prelude.Init.render (Prelude.Init::{ children = toMap (env:initConfig env:initArgs) })' \ - > $out - ''; - }; + lib = hostPkgs.lib // self.lib; linux = tests (import ./driver-linux.nix { inherit testPkgs hostPkgs lib depot; diff --git a/tests/driver-nova.nix b/tests/driver-nova.nix index 963aaaa..461589c 100644 --- a/tests/driver-nova.nix +++ b/tests/driver-nova.nix @@ -36,11 +36,6 @@ let ''; }; - mkIso = import ./nova-iso.nix { - inherit hostPkgs testPkgs; - coreNovaObj = "${testPkgs.genode-base-nova}/lib/core-nova.o"; - }; - mkTest = { name ? "unamed", testScript, testConfig, bootModules, qemuMem ? 32 , ... }@t: let @@ -53,7 +48,10 @@ let timer = "${genode-base-nova}/bin/nova_timer_drv"; } // bootModules); - iso = mkIso bootModules'; + iso = lib.x86_64-genode.buildNovaIso { + inherit name; + rom = bootModules'; + }; baseSetup = '' ## From 20594a99624060856bdf5fbf8669bf5128f38227 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sun, 10 Nov 2019 10:19:32 +0100 Subject: [PATCH 07/20] Build QEMU script with ISO --- lib/default.nix | 64 ++++++++++++++++++++++------------- tests/driver-nova.nix | 77 ++++++++++++++++++++----------------------- 2 files changed, 78 insertions(+), 63 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index c34b496..130b1b6 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -38,17 +38,24 @@ in { x86_64-genode.buildNovaIso = { name, rom }: let + inherit (hostPkgs) cdrkit syslinux; coreNovaObj = "${testPkgs.genode-base-nova}/lib/core-nova.o"; - addressType = ".quad"; # TODO: 32 or 64 bit?! + rom' = (with testPkgs; { + init = "${genode-os}/bin/init"; + "ld.lib.so" = "${depot.base-nova}/lib/ld.lib.so"; + timer = "${genode-base-nova}/bin/nova_timer_drv"; + }) // rom; + + addressType = ".quad"; # TODO: 32bit?! map' = with nixpkgs.lib; l: f: concatStrings (imap0 (i: v: (f (toString i) v)) l); - mapNames = map' (builtins.attrNames rom); - mapValues = map' (builtins.attrValues rom); + mapNames = map' (builtins.attrNames rom'); + mapValues = map' (builtins.attrValues rom'); modulesAsm = '' .set MIN_PAGE_SIZE_LOG2, 12 @@ -96,27 +103,29 @@ in { syslinuxDir = "${syslinux}/share/syslinux"; in hostPkgs.stdenv.mkDerivation { - name = name + ".iso"; - preferLocalBuild = true; - buildInputs = [ testPkgs.stdenv.cc hostPkgs.cdrkit ]; - dontUnpack = true; - dontConfigure = true; - dontBuild = true; + name = name + "-iso"; + passthru = rom; + passAsFile = [ "modulesAsm" ]; inherit modulesAsm; - installPhase = '' + preferLocalBuild = true; + dontUnpack = true; + + buildInputs = [ testPkgs.stdenv.cc hostPkgs.cdrkit ]; + + buildPhase = '' mkdir -p boot/syslinux # compile the boot modules into one object file - $CC -c -x assembler -o boot_modules.o - <<< $modulesAsm + $CC -c -x assembler -o boot_modules.o $modulesAsmPath # link final image $LD -nostdlib \ - -T${./genode.ld} \ - -T${./nova-bss.ld} \ - -z max-page-size=0x1000 \ - -Ttext=0x100000 -gc-sections \ - ${coreNovaObj} boot_modules.o \ - -o boot/image.elf + -T${./genode.ld} \ + -T${./nova-bss.ld} \ + -z max-page-size=0x1000 \ + -Ttext=0x100000 -gc-sections \ + ${coreNovaObj} boot_modules.o \ + -o boot/image.elf strip boot/image.elf @@ -130,11 +139,22 @@ in { ${syslinuxDir}/mboot.c32 \ boot/syslinux chmod +w boot/syslinux/isolinux.bin - mkisofs -o $out \ - -b syslinux/isolinux.bin -c syslinux/boot.cat \ - -no-emul-boot -boot-load-size 4 -boot-info-table \ - -iso-level 2 \ - boot + mkisofs -o iso \ + -b syslinux/isolinux.bin -c syslinux/boot.cat \ + -no-emul-boot -boot-load-size 4 -boot-info-table \ + -iso-level 2 \ + boot + + # build test script + cat > boot-qemu << EOF + #!/bin/sh + ${hostPkgs.qemu_test}/bin/qemu-system-x86_64 -cdrom $out/iso -machine q35 \$@ + EOF + ''; + + installPhase = '' + install -Dm444 iso $out/iso + install -Dm555 boot-qemu $out/bin/boot-qemu ''; }; diff --git a/tests/driver-nova.nix b/tests/driver-nova.nix index 461589c..bd98c64 100644 --- a/tests/driver-nova.nix +++ b/tests/driver-nova.nix @@ -23,7 +23,7 @@ let runTests = driver: hostPkgs.stdenv.mkDerivation { - name = "nova-"+driver.testName; + name = "nova-" + driver.testName; preferLocalBuild = true; buildCommand = '' @@ -43,9 +43,6 @@ let { inherit testConfig; config = ./driver-config.xml; - init = "${genode-os}/bin/init"; - "ld.lib.so" = "${depot.base-nova}/lib/ld.lib.so"; - timer = "${genode-base-nova}/bin/nova_timer_drv"; } // bootModules); iso = lib.x86_64-genode.buildNovaIso { @@ -58,52 +55,50 @@ let # Wait for a specific output of a already running spawned proce # proc wait_for_output { wait_for_re timeout_value running_spawn_id } { - global output + global output - if {$wait_for_re == "forever"} { - set timeout -1 - interact { - \003 { - send_user "Expect: 'interact' received 'strg+c' and was cancelled\n"; - exit - } - -i $running_spawn_id - } - } else { - set timeout $timeout_value - } + if {$wait_for_re == "forever"} { + set timeout -1 + interact { + \003 { + send_user "Expect: 'interact' received 'strg+c' and was cancelled\n"; + exit + } + -i $running_spawn_id + } + } else { + set timeout $timeout_value + } - expect { - -i $running_spawn_id -re $wait_for_re { } - eof { puts stderr "Error: Spawned process died unexpectedly"; exit -1 } - timeout { puts stderr "Error: Test execution timed out"; exit -1 } - } - set output $expect_out(buffer) + expect { + -i $running_spawn_id -re $wait_for_re { } + eof { puts stderr "Error: Spawned process died unexpectedly"; exit -1 } + timeout { puts stderr "Error: Test execution timed out"; exit -1 } + } + set output $expect_out(buffer) } - proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { - # - # If a running_spawn_id is specified, wait for the expected output - # - if {$running_spawn_id != -1} { - wait_for_output $wait_for_re $timeout_value $running_spawn_id - return - } + # + # If a running_spawn_id is specified, wait for the expected output + # + if {$running_spawn_id != -1} { + wait_for_output $wait_for_re $timeout_value $running_spawn_id + return + } - global spawn_id - spawn ${hostPkgs.qemu_test}/bin/qemu-system-x86_64 -cdrom ${iso} -nographic \ - -machine q35 -m size=${toString qemuMem} - wait_for_output $wait_for_re $timeout_value $spawn_id + global spawn_id + spawn ${iso}/bin/boot-qemu -nographic -m size=${toString qemuMem} + wait_for_output $wait_for_re $timeout_value $spawn_id } - # TODO: not in TCL - global env - set out $env(out) + # TODO: not in TCL + global env + set out $env(out) - set fd [open "$out/nix-support/hydra-build-products" w] - puts $fd "file iso ${iso}" - close $fd + set fd [open "$out/nix-support/hydra-build-products" w] + puts $fd "file iso ${iso}" + close $fd ''; driver = with hostPkgs; From ef9f76744f5c30753212eedf2585753bf921991e Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sun, 10 Nov 2019 15:29:32 +0100 Subject: [PATCH 08/20] Bump dhall-genode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • update dhall-genode revision • render top-level init config with lib.renderDhallInit • convert Init.Start.config to optionals • lib.validate renderDhallInit XML --- dhall/genode.nix | 4 +- lib/default.nix | 5 +- tests/libc.dhall | 49 +++++++++++------- tests/log.dhall | 7 ++- tests/pci.dhall | 126 ++++++++++++++++++++++++--------------------- tests/signal.dhall | 17 +++--- 6 files changed, 119 insertions(+), 89 deletions(-) diff --git a/dhall/genode.nix b/dhall/genode.nix index c01ee34..59e5f96 100644 --- a/dhall/genode.nix +++ b/dhall/genode.nix @@ -6,6 +6,6 @@ fetchgit { url = "https://git.sr.ht/~ehmry/dhall-genode"; - rev = "4e05e7bf88e53c81a8f00460673fd48e858c6dfc"; - sha256 = "0y92jinqr26wlrychk8mi58kqwmy4y25c2ffks3r3m78i8andi8y"; + rev = "c9a9c18dc8dd45198dbf0a53732ca02079fee0fd"; + sha256 = "1fcfyfcnm6snpagf3ii70p8vdy7na9lv6c3izlckyp6gvgadyyjn"; } diff --git a/lib/default.nix b/lib/default.nix index 130b1b6..bba52b8 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -24,7 +24,7 @@ in { renderDhallInit = path: args: hostPkgs.runCommand "init.xml" { preferLocalBuild = true; - buildInputs = [ hostPkgs.dhall ]; + buildInputs = with hostPkgs; [ dhall libxml2 ]; initConfig = path; initArgs = args; DHALL_PRELUDE = "${testPkgs.dhallPrelude}/package.dhall"; @@ -32,8 +32,9 @@ in { } '' export XDG_CACHE_HOME=$NIX_BUILD_TOP dhall text \ - <<< 'let Prelude = env:DHALL_GENODE in Prelude.Init.render (Prelude.Init::{ children = toMap (env:initConfig env:initArgs) })' \ + <<< 'let Prelude = env:DHALL_GENODE in Prelude.Init.render (env:initConfig env:initArgs)' \ > $out + xmllint --noout $out ''; x86_64-genode.buildNovaIso = { name, rom }: diff --git a/tests/libc.dhall b/tests/libc.dhall index 6e5ec7f..93b9797 100644 --- a/tests/libc.dhall +++ b/tests/libc.dhall @@ -1,24 +1,33 @@ let Genode = env:DHALL_GENODE -in λ(_ : {}) - → { test-libc = - Genode.Init.Start::{ - , binary = "test-libc" - , resources = { caps = 200, ram = Genode.units.MiB 400 } - , routes = [ Genode.ServiceRoute.parent "Timer" ] - , config = - Genode.Prelude.XML.text - '' - - - - - 2019-08-20 15:01 - - - - - '' +in λ ( _ + : {} + ) + → Genode.Init::{ + , verbose = True + , children = + toMap + { test-libc = + Genode.Init.Start::{ + , binary = "test-libc" + , resources = { caps = 200, ram = Genode.units.MiB 400 } + , routes = [ Genode.ServiceRoute.parent "Timer" ] + , config = + Some + ( Genode.Prelude.XML.text + '' + + + + + 2019-08-20 15:01 + + + + + '' + ) + } + : Genode.Init.Start.Type } - : Genode.Init.Start.Type } diff --git a/tests/log.dhall b/tests/log.dhall index 3016eee..8050261 100644 --- a/tests/log.dhall +++ b/tests/log.dhall @@ -1,3 +1,8 @@ let Genode = env:DHALL_GENODE ? ../dhall-genode/package.dhall -in λ(_ : {}) → { test-log = Genode.Init.Start::{ binary = "test-log" } } +in λ(_ : {}) + → Genode.Init::{ + , verbose = True + , children = + toMap { test-log = Genode.Init.Start::{ binary = "test-log" } } + } diff --git a/tests/pci.dhall b/tests/pci.dhall index 1adbc45..abd04e8 100644 --- a/tests/pci.dhall +++ b/tests/pci.dhall @@ -3,62 +3,72 @@ let Genode = env:DHALL_GENODE in λ ( _ : {} ) - → { test-pci = - Genode.Init.Start::{ - , binary = "test-pci" - , resources = { caps = 96, ram = Genode.units.MiB 2 } - , routes = [ Genode.ServiceRoute.child "Platform" "platform_drv" ] - } - , acpi_report_rom = - Genode.Init.Start::{ - , binary = "report_rom" - , resources = { caps = 96, ram = Genode.units.MiB 2 } - , provides = [ "ROM", "Report" ] - , config = - Genode.Prelude.XML.text - '' - - - - - '' - } - , acpi_drv = - Genode.Init.Start::{ - , binary = "acpi_drv" - , resources = { caps = 400, ram = Genode.units.MiB 4 } - , constrainPhys = True - , provides = [ "Platform", "Acpi" ] - , routes = - [ Genode.ServiceRoute.child "Report" "acpi_report_rom" - , Genode.ServiceRoute.parent "IRQ" - , Genode.ServiceRoute.parent "IO_MEM" - , Genode.ServiceRoute.parent "IO_PORT" - ] - } - , platform_drv = - Genode.Init.Start::{ - , binary = "platform_drv" - , resources = { caps = 800, ram = Genode.units.MiB 4 } - , constrainPhys = True - , provides = [ "Platform", "Acpi" ] - , routes = - [ Genode.ServiceRoute.parent "Timer" - , Genode.ServiceRoute.parent "IRQ" - , Genode.ServiceRoute.parent "IO_MEM" - , Genode.ServiceRoute.parent "IO_PORT" - , Genode.ServiceRoute.childLabel - "ROM" - "acpi_report_rom" - (Some "acpi") - (None Text) - ] - , config = - Genode.Prelude.XML.text - '' - - - - '' - } + → Genode.Init::{ + , verbose = True + , children = + toMap + { test-pci = + Genode.Init.Start::{ + , binary = "test-pci" + , resources = { caps = 96, ram = Genode.units.MiB 2 } + , routes = + [ Genode.ServiceRoute.child "Platform" "platform_drv" ] + } + , acpi_report_rom = + Genode.Init.Start::{ + , binary = "report_rom" + , resources = { caps = 96, ram = Genode.units.MiB 2 } + , provides = [ "ROM", "Report" ] + , config = + Some + ( Genode.Prelude.XML.text + '' + + + + + '' + ) + } + , acpi_drv = + Genode.Init.Start::{ + , binary = "acpi_drv" + , resources = { caps = 400, ram = Genode.units.MiB 4 } + , constrainPhys = True + , provides = [ "Platform", "Acpi" ] + , routes = + [ Genode.ServiceRoute.child "Report" "acpi_report_rom" + , Genode.ServiceRoute.parent "IRQ" + , Genode.ServiceRoute.parent "IO_MEM" + , Genode.ServiceRoute.parent "IO_PORT" + ] + } + , platform_drv = + Genode.Init.Start::{ + , binary = "platform_drv" + , resources = { caps = 800, ram = Genode.units.MiB 4 } + , constrainPhys = True + , provides = [ "Platform", "Acpi" ] + , routes = + [ Genode.ServiceRoute.parent "Timer" + , Genode.ServiceRoute.parent "IRQ" + , Genode.ServiceRoute.parent "IO_MEM" + , Genode.ServiceRoute.parent "IO_PORT" + , Genode.ServiceRoute.childLabel + "ROM" + "acpi_report_rom" + (Some "acpi") + (None Text) + ] + , config = + Some + ( Genode.Prelude.XML.text + '' + + + + '' + ) + } + } } diff --git a/tests/signal.dhall b/tests/signal.dhall index d541262..6d11a24 100644 --- a/tests/signal.dhall +++ b/tests/signal.dhall @@ -1,11 +1,16 @@ let Genode = env:DHALL_GENODE ? ../dhall-genode/package.dhall in λ(_ : {}) - → { test-signal = - Genode.Init.Start::{ - , binary = "test-signal" - , resources = { caps = 500, ram = Genode.units.MiB 10 } - , routes = [ Genode.ServiceRoute.parent "Timer" ] + → Genode.Init::{ + , verbose = True + , children = + toMap + { test-signal = + Genode.Init.Start::{ + , binary = "test-signal" + , resources = { caps = 500, ram = Genode.units.MiB 10 } + , routes = [ Genode.ServiceRoute.parent "Timer" ] + } + : Genode.Init.Start.Type } - : Genode.Init.Start.Type } From bd1ac437ba7d3e66225ccd935c5d14b2d0aa84cc Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sun, 10 Nov 2019 16:55:33 +0100 Subject: [PATCH 09/20] Take pre-built binaries from a genode-depot flake --- depot/base-list.nix | 62 -------------------------- depot/default.nix | 43 ------------------ depot/gen-list.sh | 17 ------- depot/genodelabs-list.nix | 94 --------------------------------------- flake.lock | 29 ++++++++---- flake.nix | 6 +-- lib/default.nix | 4 +- tests/default.nix | 4 +- 8 files changed, 28 insertions(+), 231 deletions(-) delete mode 100644 depot/base-list.nix delete mode 100644 depot/default.nix delete mode 100755 depot/gen-list.sh delete mode 100644 depot/genodelabs-list.nix diff --git a/depot/base-list.nix b/depot/base-list.nix deleted file mode 100644 index 56f2856..0000000 --- a/depot/base-list.nix +++ /dev/null @@ -1,62 +0,0 @@ -/* DO NOT EDIT - this file generated by gen-list.sh */ [ -{name="base-fiasco";value={sha256="0w4kgmq3dd0r8vl51v9az9h74l85r3ci47xhhmk85g8ajw9mc33s";version="2019-09-30";};} -{name="base-foc-pc";value={sha256="0qjjfcyqkzd022vxwivinhabfaxbjapq3ksr2jdg5ic4nxf3dd56";version="2019-09-30";};} -{name="base-hw-pc";value={sha256="0z3fypafwc2vv9z330l43fyhvkvn765nf2qxa3xja0ahpnbsgwiv";version="2019-09-30";};} -{name="base-linux";value={sha256="1j5q0c8hsbsk7piz8pz75sy05pilbxv1df96mr3qxwwzv1mmg999";version="2019-09-30";};} -{name="base-okl4";value={sha256="01gl5cs54w9xz3ijaa62w7s0x0mmzffp1517qpv76bjn7vrv57cn";version="2019-09-30";};} -{name="base-pistachio";value={sha256="0wjy2wf21a342y7j95jahzrfv7jpk7apc3vi6ddnpz8mnfw9gs13";version="2019-09-30";};} -{name="base-sel4-x86";value={sha256="0rph0fddq1p9k9pb2zihfgzbbdpw3syfmn47rw4svhm65h95ifsc";version="2019-09-30";};} -{name="test-block";value={sha256="1mqi4vm66v8schz7ai97fz1daqqidlgfk6zc380p64zmlmzw09zb";version="2019-08-27";};} -{name="test-bomb";value={sha256="1zmr2h582542r4dd1bgxvfs2prrxq20ps6xzidwl74dwpjjj3z91";version="2019-08-27";};} -{name="test-clipboard";value={sha256="1239h11griqpmhmwrigqz4snzwaibvjhwv3w8wkv7v84a02z93i5";version="2019-08-27";};} -{name="test-ds_ownership";value={sha256="0146pjzqf5afcjfc9rv4p9n49nln1i1cwqgjg4x26lvrdj7rbrjj";version="2019-08-27";};} -{name="test-dynamic_config";value={sha256="0rkmbq5pg57gx15vm6n6g8zhmlhrrjv3pyhxz0qkcs32cfdfy620";version="2019-08-27";};} -{name="test-fault_detection";value={sha256="1hqp4xb0fyb7z9glq6m40yppgd4pxqf32216jlksvxvz2kkca7nv";version="2019-08-27";};} -{name="test-fs_packet";value={sha256="1vgiq5457hnwjnv36azpprxm2bq0sz0jqq3ip9wmwbs7gby35dn3";version="2019-08-27";};} -{name="test-fs_report";value={sha256="191dck9si0p6r3j48gg9zy2m1n9fh8yh32ygimw3j70ac4jgwksp";version="2019-08-27";};} -{name="test-immutable_rom";value={sha256="1fp5r6w60y7dkqahdpwddbw7afxp4knbi78dqb52vfjpsc45m5ba";version="2019-08-27";};} -{name="test-init";value={sha256="1d963rjqhklm5va3ndjpn31hjvbb173b5l8qzgvbk8m17lwya9pr";version="2019-08-27";};} -{name="test-init_loop";value={sha256="0kz2gvp20hplfihrzrqlsd1y84fh9nbsq6j9d10fv5j6y7zshk70";version="2019-08-27";};} -{name="test-ldso";value={sha256="09554ygjyi7bg9q3i2bl1swjx107an6i9ahncvl7jyhhls3kv5ns";version="2019-08-27";};} -{name="test-libc";value={sha256="1f468n4k1hdqas8dalg5an3ch2slsj5ckdz0lkc3h3666d1z6hwd";version="2019-08-27";};} -{name="test-libc_connect";value={sha256="0imcvilspr6n52zrc1dgprfanfg76y09i7salypqsi5wwqxa2fxj";version="2019-08-27";};} -{name="test-libc_counter";value={sha256="0qlpz385vkxp2gd18vzwzi84vgc6pzywy033l8wy3g4wdkldmpz3";version="2019-08-27";};} -{name="test-libc_getenv";value={sha256="1prl1al5kvhfvpcpdg9pfhmf98z8iw7p2m91p5ykdjv76w040lks";version="2019-08-27";};} -{name="test-libc_pipe";value={sha256="1wn44ysz16kzg6arwh9m81dwfqirsw01gwgp051g0y9vw3xp2j9m";version="2019-08-27";};} -{name="test-libc_vfs";value={sha256="04h4vsxp3gxpz71yy1yckvmqgyab5yn3mn3ywfyz3hjw65g361mw";version="2019-08-27";};} -{name="test-libc_vfs_block";value={sha256="19hbbsr5as1n0ffcqbc555jkabfa4kp9qsp76qpm7awksjyjnk7z";version="2019-08-27";};} -{name="test-log";value={sha256="0nh2i1ra95lrfnb0ak28cflz6pya6v2svdz071kyv9bvfvmwrn3m";version="2019-08-27";};} -{name="test-magic_ring_buffer";value={sha256="0z7lq4p7qchxw0bp7fm8v3b4x6vp5gy9ncj6ibwly0igbbdkks2k";version="2019-08-27";};} -{name="test-mmio";value={sha256="0s4wmla8x13px7qm1jvmfi89jxribfylahjpwyqcdc5p5yn9jzx3";version="2019-08-27";};} -{name="test-netty";value={sha256="1snj3mxyghp158lcxb85s5dr6zxxv8krz6c9cynqhig7gfljgyp1";version="2019-08-27";};} -{name="test-new_delete";value={sha256="0k6n40ywgs0wfhsi7vn7x7z52mpd31gnbyqyxhllrzslh03jxz3v";version="2019-08-27";};} -{name="test-nic_loopback";value={sha256="1hbvwh7r9650iskjhdbbjiir7afpj1rljxv3079xznrr2zbrr4c4";version="2019-08-27";};} -{name="test-pthread";value={sha256="0yv0xc965n266pm464nv4qcg3c9ni5dvg5693gmxwffwq3wsdcrq";version="2019-08-27";};} -{name="test-reconstructible";value={sha256="1r01k9r8zj96cw860rd1vkbnivdr1yql6baczm0wnrwa0rmmrnb9";version="2019-08-27";};} -{name="test-registry";value={sha256="1zgw7w34ai9isnqqj4wks8ch9b65m7gj95l6vxcngkc6vr7x7bjr";version="2019-08-27";};} -{name="test-report_rom";value={sha256="05qhxzdj9gxy61jmrvl196g5x4wzk3shk7i1k2yfpsf4slcji4n5";version="2019-08-27";};} -{name="test-resource_request";value={sha256="0rcbic1rfv4p7jp343yl3ws9f6rm409dzjd6nyk95x5lyn3cnhh2";version="2019-08-27";};} -{name="test-resource_yield";value={sha256="1ad4v54spmwz2gl0f620g26mm1al0dli4x671nnl7cc30adfv3qx";version="2019-08-27";};} -{name="test-rm_fault";value={sha256="0pxj0md4wb1v9kxbicbdfqdavprkj88c4v79x2x5vlpg5s4ms7c6";version="2019-08-27";};} -{name="test-rm_nested";value={sha256="0npjhabzq9x248q048rgakakhvvchykmbg012xnwf4vx7rzql8n1";version="2019-08-27";};} -{name="test-rom_block";value={sha256="0p4m5bp6xwkg78l2xm1ak3vay9fzk1f274xz68hj17gwhj9sc1gs";version="2019-08-27";};} -{name="test-rtc";value={sha256="0lrfwjgk22xnnk5sb90f2pmw5y1sfm9jj1db3qndfa552nw80dh5";version="2019-08-27";};} -{name="test-sanitizer";value={sha256="051hafrgi61l4f67l2vg7blmc711r7vbppvp8kg5jv8wzxxrxsrp";version="2019-08-27";};} -{name="test-segfault";value={sha256="06pf1k37qbgm1rzaqx12sgi368r4nc5yifvw3yhqijzsmdadrsi3";version="2019-08-27";};} -{name="test-signal";value={sha256="177w367lnls387k20p8k20va4vagpz9xhqw4hc6hj0615fxqz8qr";version="2019-08-27";};} -{name="test-slab";value={sha256="0gvg2lgy9nrwg5s9j5k8di90qw1jkcrkhjjdfgbycl3wn5zkc1m7";version="2019-08-27";};} -{name="test-solo5";value={sha256="1v4bh098wjvwcsgjwq1g3b9hgpswm90lsjh4q9ldk9ggr53c1ijk";version="2019-08-27";};} -{name="test-stack_smash";value={sha256="1n1r2a4q134lm60ls52sdhq2mqz5ykv849172x05vzfav3f2qi30";version="2019-08-27";};} -{name="test-stdcxx";value={sha256="11hr7nirz6fiwmziqpp2spxranbqf0riz228ryqhcbd1caag5if4";version="2019-08-27";};} -{name="test-synced_interface";value={sha256="0igb0fj2yg2hc01didfi18n8barvk8bvh28f8i2xa6pym77gkqbb";version="2019-08-27";};} -{name="test-tcp";value={sha256="107d58vqrc65nyjclg00fgd2bfgmviy5zxd3bjx3y82hiwgn4kwi";version="2019-08-27";};} -{name="test-timed_semaphore";value={sha256="0gv7s1q1l3068i571cjfrq7kmc1ar291xkamjnnn94hdsjhr36rb";version="2019-08-27";};} -{name="test-timer";value={sha256="1bjdddkvrbqk5caqg8qdg0xmq7byc361xg5zmfxdkhihja08ahcm";version="2019-08-27";};} -{name="test-trace";value={sha256="124xr442vh4b1jh523ayai2zcd96mmh947ii2yssnq738hl2qfbq";version="2019-08-27";};} -{name="test-trace_logger";value={sha256="1i89l58hrf9girdnln9vc3rzxqip8xjxzqfdmrwcy74pccxzg2vc";version="2019-08-27";};} -{name="test-utf8";value={sha256="0s98wq77322sq1rfrsc7fphzwkfkgykv5i2fvw5d13kxqyxq1zsl";version="2019-08-27";};} -{name="test-vfs_stress";value={sha256="071mc52fvmm2qzhrcs55f59y96xz15l360vrigxypq461h3hr3av";version="2019-08-27";};} -{name="test-weak_ptr";value={sha256="0kxi0pnzqm6g6bf6rarzczkixhmclvfwk82jlw22m085mwhi198g";version="2019-08-27";};} -{name="test-xml_generator";value={sha256="0g7gy0csmm5v0x2zifmxcw2b2pfzr1gyxg4z68ghpwkz4ynm9jn7";version="2019-08-27";};} -{name="test-xml_node";value={sha256="1g44v399v03szds5w6sxi0ywy50g30rfgr1cy5pgx7vnyakdwnds";version="2019-08-27";};} -] diff --git a/depot/default.nix b/depot/default.nix deleted file mode 100644 index d1a8eb5..0000000 --- a/depot/default.nix +++ /dev/null @@ -1,43 +0,0 @@ -# SPDX-FileCopyrightText: Emery Hemingway -# -# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 - -{ stdenvNoCC, fetchurl }: - -let - stdenv = stdenvNoCC; - unpack = baseUrl: { name, value }: { - inherit name; - value = stdenv.mkDerivation { - pname = name; - inherit (value) version; - preferLocalBuild = true; - src = fetchurl { - url = - "${baseUrl}${name}/${value.version}.tar.xz"; - inherit (value) sha256; - }; - phases = [ "unpackPhase" "installPhase" "fixupPhase" "distPhase" ]; - installPhase = '' - find . -type f | while read FILE; do - case $FILE in - *.a | *.o) install -Dm444 -t $out/lib $FILE;; - *.so) install -Dm555 -t $out/lib $FILE;; - *.tar) install -Dm444 -t $out/tar $FILE;; - *) install -Dm555 -t $out/bin $FILE;; - esac - done - ''; - meta = { - license = [ "LicenseRef-Genode" ]; - downloadPage = "${baseUrl}${name}/"; - }; - }; - }; - - expand = baseUrl: listing: builtins.listToAttrs (map (unpack baseUrl) listing); - - base = expand "http://depot.hq.c3d2.de/user/bin/x86_64/" (import ./base-list.nix); - genodelabs = expand "http://depot.genode.org/genodelabs/bin/x86_64/" (import ./genodelabs-list.nix); - -in (base // genodelabs) diff --git a/depot/gen-list.sh b/depot/gen-list.sh deleted file mode 100755 index cb32380..0000000 --- a/depot/gen-list.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# TODO: git clone shallow, fhs environment, make -f depot/whatever - -echo "/* DO NOT EDIT - this file generated by gen-list.sh */ [" - -find ../../genode/public/genodelabs/bin -name '*.tar.xz' -print \ - | sort \ - | awk --field-separator / '{print $8" "$9" "$0}' \ - | while read NAME VERSION LOCAL -do - TAR_PATH=`realpath $LOCAL` - SHA256=`nix-prefetch-url file://$TAR_PATH` - echo "{name=\"$NAME\";value={sha256=\"$SHA256\";version=\"${VERSION%%.tar.xz}\";};}" -done - -echo ']' diff --git a/depot/genodelabs-list.nix b/depot/genodelabs-list.nix deleted file mode 100644 index 98df69b..0000000 --- a/depot/genodelabs-list.nix +++ /dev/null @@ -1,94 +0,0 @@ -/* DO NOT EDIT - this file generated by gen-list.sh */ [ -{name="acpi_drv";value={sha256="0l8b5w3rv5fvx60qjp6mfjrdn3c37rinqadqksrqv46ix7sm5g7r";version="2019-08-27";};} -{name="acpica";value={sha256="19g0i2cixvn4smwykmr27a763njcyccjl1fh81pcqdygdqni56bp";version="2019-08-27";};} -{name="ahci_drv";value={sha256="1a7kb2ppf3ww2n65piinc0nrr8nkpdld2jv9iqn4ag2cj4g212qf";version="2019-08-27";};} -{name="backdrop";value={sha256="0jy9qwmjfy1zra9hd829fhnkp933yv798pzihqlhfbyf3zcf4m01";version="2019-08-27";};} -{name="base-nova";value={sha256="12249m7awh2hn9cwa4ck19cxgk6cv7m2bz996hs366lm70j69w9b";version="2019-08-27";};} -{name="bash-minimal";value={sha256="08rpnsvywrp2a7a464xza7mi89sw81qfrxr626phc5hfviiyjp5j";version="2019-08-27";};} -{name="boot_fb_drv";value={sha256="1dclzwl4m103vlzdr59yx22mq7y7cpm2yw0n3whbp4v1f237cm2r";version="2019-08-27";};} -{name="cached_fs_rom";value={sha256="0qxhvap6qsi8s34l0f1xkr8kkfllpjbxr53m289b8j5m3f902mhv";version="2019-08-27";};} -{name="chroot";value={sha256="1x0xzlsjvcrpj59kn487aa1hf892bwyy5ck25d2wd4j0nsin3rjd";version="2019-08-27";};} -{name="clipboard";value={sha256="1xrb1g5fqxxg3k6mw0h2s7xidma8vcdp0g89yzzplmcc2cyn278v";version="2019-08-27";};} -{name="coreutils-minimal";value={sha256="1hb385gnn1m5phjvfs5nkfkh8xn59k7gjw9ivh35czixkh2rp658";version="2019-08-27";};} -{name="coreutils";value={sha256="002lvh16kxgb41acksjrl0phsm8idaby0z7jcmddzpybgdjj60dx";version="2019-08-27";};} -{name="curl";value={sha256="0zavxvkw5cibk9pdjdahb6ywyniz2nhqxdw6f98vnhf623kp23kz";version="2019-08-27";};} -{name="decorator";value={sha256="057wf5i3vkq4l8s400zg0zs1qjf1mj29585b4fjjk23ml3kpr89j";version="2019-08-27";};} -{name="depot_download_manager";value={sha256="0mfgy76jzq2h8fff4y1lxia4bgxd63cabcwg15pqhcwlbc7bdww0";version="2019-08-27";};} -{name="depot_query";value={sha256="0kzmfkyia4qj2xi2cdja6661r9wqm6g884p7rbv75zm2v3hyv6lz";version="2019-08-27";};} -{name="driver_manager";value={sha256="0fy6ml64pj1nllqwlhwncyiwybsk2l0mwy1nc0q7xsf6k95szk1f";version="2019-08-27";};} -{name="e2fsprogs-minimal";value={sha256="1dlvvbn53klzz4aj34l8bw2x823ih7m7593g8dmm0hsw3yv4y71p";version="2019-08-27";};} -{name="expat";value={sha256="0qpiwv2klcgq61prrn7h5kwms4cmk0bqjcpkkpml2zrz17yzyg1p";version="2019-08-27";};} -{name="extract";value={sha256="0s4y0y4nkx90p5msgwjj3ap293ll5x4cva6s1cbasia13lk9r6nm";version="2019-08-27";};} -{name="fetchurl";value={sha256="0a53cq27g98zfdvc87brzrdwv58p656da9jyhqpjb24azkbdb1l5";version="2019-08-27";};} -{name="file_terminal";value={sha256="1k7752s7sps2xij3avzyjqxn2wqyrjjf59x9af1aq22xagivw4l8";version="2019-08-27";};} -{name="freetype";value={sha256="1851hladn19lps5fp2g31cps7620wi94cpz7c70baqw7n4j71xhc";version="2019-08-27";};} -{name="fs_query";value={sha256="185icsck6r5ax7rkbbr5r6wczy33kwigdch189al07b4dajddxk1";version="2019-08-27";};} -{name="fs_report";value={sha256="0mdxmhk5mw2q6gb46zxsdsw9zps5lpmqkmj5fmr3b9wa3mjlw2vq";version="2019-08-27";};} -{name="fs_rom";value={sha256="1lp2ssjbb0hbjymlr17xbpy2mncpi31hbf50ijn689hkbjggrv58";version="2019-08-27";};} -{name="fs_tool";value={sha256="1n9kn05sgwxbkdqb6h8s5g7dd4ph7kwgv3rv3p4l9aigr3ag4j4d";version="2019-08-27";};} -{name="global_keys_handler";value={sha256="14axqgqcivqxn5kxg1x6i463fbkan12j81q4hw4lmgs6wwrk0d73";version="2019-08-27";};} -{name="gpt_write";value={sha256="159fr0vr6zb28kj8asa0nhbmm4znw9jrz9vhi34qpwgjn3b2925y";version="2019-08-27";};} -{name="init";value={sha256="15z9fscqh91mapc28bpfbsh1dxb8k0vcq75x6f7v2hs11jb8r6xf";version="2019-08-27";};} -{name="input_filter";value={sha256="1jsrh3dydr1zs0g77xir9aw11icxj2f85yhdpbxvx15sa43907kh";version="2019-08-27";};} -{name="intel_fb_drv";value={sha256="04n1mq56fzlpjwrqiawzw1530qjd3q6r7nk2h8j4kyyks78js88b";version="2019-08-27";};} -{name="ipxe_nic_drv";value={sha256="0ai1yl2iz9j0lhxhi0lxc0qv9r1q9pyn1rkyb6l05ijxvwbcqma6";version="2019-08-27";};} -{name="jpeg";value={sha256="0261wahfx24gjfj5a34ggzqka4nzgnc19l9arypf4b2p1vmd4gwa";version="2019-08-27";};} -{name="libarchive";value={sha256="17jzm3rnmjxzbyxcjz4lczng1z7643dks95yvggsc3vqrx1g3hmr";version="2019-08-27";};} -{name="libc";value={sha256="0f2rcjsfb79zgs0v34w4qnf85i7d2p61p9wy2i0k9hq3d1yqb3fl";version="2019-08-27";};} -{name="libcrypto";value={sha256="1yya3pxbzg7m1zrip3vh5m44vx38ckmb5hqcs61dxqid71py7r6b";version="2019-08-27";};} -{name="libiconv";value={sha256="0kkc76vkv0hdgid6ygrfl88c957q21v2zpbvqqz0pjrmxwi98kly";version="2019-08-27";};} -{name="liblzma";value={sha256="1sqwlf1cnlssai2xka937gkz1rihxsk40260vqk55n9xd5arpjhg";version="2019-08-27";};} -{name="libpng";value={sha256="1y18g1ypdjiw43shcrjpvi0mn9055nnjmsnanaqxwvhfpi787aj6";version="2019-08-27";};} -{name="libssh";value={sha256="1z55zb52i866qjwl9rshhl2zfilq8g3rjpnxhh397racq18ay16s";version="2019-08-27";};} -{name="libssl";value={sha256="0kafqbpzvx9hvdcq91ksqw5s6ynyzf9c2kq2186sgwqdy8kgkq9r";version="2019-08-27";};} -{name="log_core";value={sha256="1d3in4a9y7c3flig8gkaqsd809j2p60fh8nmz4m675q1s4mvfrp2";version="2019-08-27";};} -{name="menu_view";value={sha256="105pdrs3ipdf2xh3413axkikwj0lqirlgrdragrf7abfx6h44qvz";version="2019-08-27";};} -{name="mesa";value={sha256="1sa9wlwbsldjvynh13i75c9np7rm914h3nksw710apm3js3yjkcg";version="2019-08-27";};} -{name="nano3d";value={sha256="0p0rkx49816d8n4jwnnpj09ndvjrixj36kk64m4x6j0f90icqj2v";version="2019-08-27";};} -{name="ncurses";value={sha256="0x912bf63iz28bjj4j9hz0ppvc365x5zg574g1ghi4xgcrm6rr0m";version="2019-08-27";};} -{name="nic_router";value={sha256="0y136w6y8y0vrmzi5nakvphxd3x1zmr8g4jxadj4s0s525rm3qgy";version="2019-08-27";};} -{name="nit_fader";value={sha256="078k0gilfx839h3lg24960ff4fmk6a0hi5832p249pb4if8dcfwr";version="2019-08-27";};} -{name="nit_fb";value={sha256="1c3xqyqppqwygfhnbvpgsy5j2dir1k7sdfb9s9ld5j0psav742iy";version="2019-08-27";};} -{name="nit_focus";value={sha256="109kzplshlday4z89an0pfpkaf42mxb7fj5ql2dbvmc8zb276185";version="2019-08-27";};} -{name="nitpicker";value={sha256="0by1hmkdihq9q8i24z5vwiav7fl26csg06vixzzk79936ll4lns8";version="2019-08-27";};} -{name="noux";value={sha256="1i9bxy7rmcn3hvl4n8wx9d2cla3xld4jqwawhs10iv0iv6c3apb1";version="2019-08-27";};} -{name="nvme_drv";value={sha256="1g3d6410jczx1kfdq5lzsak8dcg3j8sq36qi9f3fjas52sbw37yg";version="2019-08-27";};} -{name="part_block";value={sha256="0vr2giixh564xc34wc3n0233k59y3360p8vwnm6788yxlayd3c88";version="2019-08-27";};} -{name="platform_drv";value={sha256="0p4dmx0y79k65nfz22nnbk6dyylgx2cv3j5vzl90xp4vp5mmvz3z";version="2019-08-27";};} -{name="posix";value={sha256="1z08w7lwgq49crbjrim2dh5wi80czfxawwcq7cxbjbfap5nw8ak6";version="2019-08-27";};} -{name="ps2_drv";value={sha256="1ac7645g0jhppyanp54jlpyvcwb32i8jwcgwy6kr1mqb7ixd3dm6";version="2019-08-27";};} -{name="qt5_component";value={sha256="1jbr0fqai7mvwvdxmhngbbnya4ziwxkrnl0amv13k1nrxsgha4jg";version="2019-08-27";};} -{name="qt5_core";value={sha256="0abg9h99jkis9f57zcfq4mw97bwrczqichmnvg9kfwqy17limrgg";version="2019-08-28";};} -{name="qt5_gui";value={sha256="01g5qphkqn6a2rlcc5dmvrd1q7dvj2crbhasidjfpsiklb88736j";version="2019-08-28";};} -{name="qt5_printsupport";value={sha256="0rfvvafv2lh65hx17k6hn1kfrhsddzjrq0nhb2xc2q1nvr3wnpli";version="2019-08-28";};} -{name="qt5_qjpeg";value={sha256="1j2153rkf47qs7i9nkyg4dsr84yf8bdw66hi2nm8w7kvz8m5a6dd";version="2019-08-28";};} -{name="qt5_qpa_nitpicker";value={sha256="1svfmw768hxx1hpxvslazcs0czqv7ib88n5yb8cxalqdrmhaa3s6";version="2019-08-28";};} -{name="qt5_textedit";value={sha256="0lag3s9xkncy7s2vr5x2j4f0rnr7xylfc1f9281s34xk7vcyrv9i";version="2019-08-28";};} -{name="qt5_widgets";value={sha256="04xn5lrbskvw5lslfhqj46j5ihb6y1kw5p8br1dcsgc517nxvjdi";version="2019-08-28";};} -{name="ram_fs";value={sha256="1h55y7i74h1h6mixzd14pc81v41lyq2r7ay1ca9d2vc0s4dc4vad";version="2019-08-27";};} -{name="report_rom";value={sha256="1fc2qg8lfiznysn47m22c90v2z2kc6cdpnd8ny4j22rwmc5ya03l";version="2019-08-27";};} -{name="rom_filter";value={sha256="1s2xnklvwrmpfmynl44k5m0w3mwnhplxsfcgw8k2cap4vkh8vchr";version="2019-08-27";};} -{name="rom_reporter";value={sha256="1zvmi5mxcj2xxzj3ipsr3xh9qf43xplymcmmjjbapnswwhnqc9a8";version="2019-08-27";};} -{name="rtc_drv";value={sha256="0cbh616z5k3dgkb51xm3966vk66sr80jd6gxh324515rxhxk7rip";version="2019-08-27";};} -{name="rump";value={sha256="0165jz7c7dbs47bci1y7pn6qv6jv4h251h3mm41vkn97c31aryxx";version="2019-08-27";};} -{name="sculpt_manager";value={sha256="0fkydzdhb195wg8na8hfzy66rx0hd68g2cgp7hkm65lgcphg7l68";version="2019-08-27";};} -{name="stdcxx";value={sha256="0ahbj80kwblp0ll7gwn05krmfx0hgbmfjy9g1991d0ppabw52d8w";version="2019-08-27";};} -{name="terminal";value={sha256="1yw7gn22fyw65dn481rx1lph0bawrdcj72mr4kddjdf4hajk7n75";version="2019-08-27";};} -{name="terminal_log";value={sha256="1vmzflxca46n4bv14qybqq8v1mn2rsplvf69izvymx768gczhwq5";version="2019-08-27";};} -{name="themed_decorator";value={sha256="1vcvjfx5h94kzrvrfi3ybyl146f1c954xcf2m8yx7y1h7pvlady3";version="2019-08-27";};} -{name="usb_block_drv";value={sha256="1ldxdshb1gl5204grcinliyk821xgvfm0yawfcvh9yv49q526ksn";version="2019-08-27";};} -{name="usb_drv";value={sha256="0ljs7sb82w7am48mm48jgzq7mj3mi5hvj22j4y85bq3c22miq0kf";version="2019-08-27";};} -{name="vbox5-nova";value={sha256="00215vwxyc77q8s4kh7v1fn1cs120wm1l6dqd1jm4dxq6pq3fqfv";version="2019-08-27";};} -{name="verify";value={sha256="1s1ljsky8xm6gmmbsy1wspqra02jgsvbh2n5xz88c9r7s94zq6xa";version="2019-08-27";};} -{name="vesa_drv";value={sha256="14gw55byyasz2i0b871hpdp8vjizhhkd6p7dlrg4036qji3pbvd9";version="2019-08-27";};} -{name="vfs";value={sha256="0jqgj9zq10zy9gq2lzkprbq8pdy3v90jb61di09fdrsmc1y76pi1";version="2019-08-27";};} -{name="vfs_import";value={sha256="1d9mrjcs0iq0nb4dzwh6dw2iwqx25450c16ca3a5pg31k6w59fqn";version="2019-08-27";};} -{name="vfs_jitterentropy";value={sha256="1m9flx0n21wgkfqbvrghpn53rf4cfsziv848zawr9jk6ygns5rn1";version="2019-08-27";};} -{name="vfs_lxip";value={sha256="1ld2hqizs0hpy9bbfamkg52bbicdhi5a6v2b17c512yrdidb7hbg";version="2019-08-27";};} -{name="vfs_ttf";value={sha256="10ypnhk1r8yavmagpv3ylbyz3gw2nrgrplfabnap2nmavai03dff";version="2019-08-27";};} -{name="vim-minimal";value={sha256="18cj7dirg3kplj6277gajfbiv7in28dfxx7dxwzwlkhcppnm9v3y";version="2019-08-27";};} -{name="wifi_drv";value={sha256="1fmwwrp0w7iinn70h09imlmxqnd5x9kn6fagmj3ria6mqai8za8s";version="2019-08-27";};} -{name="window_layouter";value={sha256="0fbr5wfpbabzi1h1bwa9558m05hcgnwa5van9rxbzp934krmwch7";version="2019-08-27";};} -{name="wm";value={sha256="0y2v0frxhpkvw8mzn71xn8z4pap459r0bk8w14dnrw61fv8rxjkh";version="2019-08-27";};} -{name="zlib";value={sha256="160y5hl49hhjqy3132f0k8xi7c3x5yz4h29dsjrfb8sl1ccmsaca";version="2019-08-27";};} -] diff --git a/flake.lock b/flake.lock index c4bfe37..b6a0a67 100644 --- a/flake.lock +++ b/flake.lock @@ -5,25 +5,38 @@ "nixpkgs": { "inputs": {}, "narHash": "sha256-wJg4DA700SoQbEz61448sR6BgxRa1R92K3vvCV1g+HY=", - "originalUri": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148", - "uri": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148" + "originalUrl": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148", + "url": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148" }, "nixpkgsStaticLinux": { "inputs": {}, "narHash": "sha256-famU3pJZ4vkElV9qc71HmyRVSvcrAhfMZ0UJKpmmKP8=", - "originalUri": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working", - "uri": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working&rev=925aac04f4ca58aceb83beef18cb7dae0715421b" + "originalUrl": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working", + "url": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working&rev=925aac04f4ca58aceb83beef18cb7dae0715421b" } }, "narHash": "sha256-NGbS2bymVuCQcanlBO41I6ZjSAZSLXhACK3qQU25zUs=", - "originalUri": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake", - "uri": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake&rev=256810cd5adf1ae5862eed0ffdaab4cf49f6fe67" + "originalUrl": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake", + "url": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake&rev=256810cd5adf1ae5862eed0ffdaab4cf49f6fe67" + }, + "genode-depot": { + "inputs": { + "nixpkgs": { + "inputs": {}, + "narHash": "sha256-Y5ZOTgInrYYoas3vM8uTPLA2DvFI9YoI6haftIKl9go=", + "originalUrl": "nixpkgs", + "url": "github:edolstra/nixpkgs/015c9ec3372e328ea6742b409a1e9aa26dab2b31" + } + }, + "narHash": "sha256-bCKZSw8cBTJf5EPSXzuKPTaM8EAFXez27BCMZn+rUk0=", + "originalUrl": "genode-depot", + "url": "git+file:///home/repo/genode-depot?ref=master&rev=b9119fccb3114829900ae75886d3b5edb54bbd7f" }, "nixpkgs": { "inputs": {}, "narHash": "sha256-1pvSqpPbcREIGI7BF6A29b81bH/dZvywTPwYhrMaRa0=", - "originalUri": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git", - "uri": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=master&rev=ff59349d99ff0ff2496e85278c596df3a14ef3ec" + "originalUrl": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git", + "url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=master&rev=ff59349d99ff0ff2496e85278c596df3a14ef3ec" } }, "version": 3 diff --git a/flake.nix b/flake.nix index 04cd9a9..5a35770 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,7 @@ "git+https://github.com/dhall-lang/dhall-haskell?ref=flake"; }; - outputs = { self, nixpkgs, dhall-haskell }: + outputs = { self, nixpkgs, dhall-haskell, genode-depot }: let nixpkgs' = import nixpkgs; systems = [ "x86_64-genode" ]; @@ -18,7 +18,7 @@ in { - lib = import ./lib { genodepkgs = self; inherit nixpkgs dhall-haskell; }; + lib = import ./lib { genodepkgs = self; inherit nixpkgs dhall-haskell genode-depot; }; packages = forAllSystems (system: import ./packages.nix { @@ -28,7 +28,7 @@ checks = forAllSystems (system: import ./tests { - inherit self nixpkgs dhall-haskell; + inherit self nixpkgs dhall-haskell genode-depot; genodepkgs = builtins.getAttr system self.packages; }); }; diff --git a/lib/default.nix b/lib/default.nix index bba52b8..16708f7 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,12 +1,12 @@ -{ genodepkgs, nixpkgs, dhall-haskell }: +{ genodepkgs, nixpkgs, dhall-haskell, genode-depot }: let hostPkgs = import nixpkgs { system = "x86_64-linux"; overlays = [ (self: super: { inherit (dhall-haskell.packages) dhall; }) ]; }; - depot = hostPkgs.callPackage ../depot { }; testPkgs = genodepkgs.packages.x86_64-genode; + depot = genode-depot.packages.x86_64-genode; in { dhallText = name: source: diff --git a/tests/default.nix b/tests/default.nix index cb2a114..21645c8 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -11,14 +11,14 @@ let # solo5 = call ./solo5 { }; }; -in { self, genodepkgs, nixpkgs, dhall-haskell }: +in { self, genodepkgs, nixpkgs, dhall-haskell, genode-depot }: let hostPkgs = import nixpkgs { system = "x86_64-linux"; overlays = [ (self: super: { inherit (dhall-haskell.packages) dhall; }) ]; }; - depot = hostPkgs.callPackage ../depot { }; + depot = genode-depot.packages.x86_64-genode; testPkgs = genodepkgs; lib = hostPkgs.lib // self.lib; From 2269f1ec652e53a0ac7b30ca8a4f01f27c08b337 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sun, 10 Nov 2019 19:34:34 +0100 Subject: [PATCH 10/20] Flake simplification --- flake.nix | 4 +--- packages.nix | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 5a35770..1233661 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,6 @@ outputs = { self, nixpkgs, dhall-haskell, genode-depot }: let - nixpkgs' = import nixpkgs; systems = [ "x86_64-genode" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); @@ -22,8 +21,7 @@ packages = forAllSystems (system: import ./packages.nix { - inherit system; - nixpkgs = nixpkgs'; + inherit system nixpkgs; }); checks = forAllSystems (system: diff --git a/packages.nix b/packages.nix index 3d08bd2..4344648 100644 --- a/packages.nix +++ b/packages.nix @@ -2,17 +2,17 @@ # # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 -{ system ? "x86_64-genode", nixpkgs ? import , extraOverlays ? [ ] }: +{ system, nixpkgs }: let toolchainOverlay = import ./toolchain-overlay; # Overlay of toolchain patches - super = nixpkgs { + super = import nixpkgs { # Evaluate an overlayed Nixpkgs for a Genode target localSystem = "x86_64-linux"; crossSystem = "x86_64-genode"; - overlays = [ toolchainOverlay ] ++ extraOverlays; + overlays = [ toolchainOverlay ]; }; inherit (super) callPackage; From ace8d491639773f28e89ab91b95173014dcf7150 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 11 Nov 2019 20:20:10 +0100 Subject: [PATCH 11/20] Move toolchain overlay to Nixpkgs fork --- flake.lock | 6 +- flake.nix | 3 +- packages.nix | 7 +- toolchain-overlay/Genode.cmake | 32 - toolchain-overlay/binutils.patch | 83 -- toolchain-overlay/default.nix | 41 - toolchain-overlay/headers/default.nix | 56 - toolchain-overlay/libc/MB_CUR_MAX.patch | 24 - .../libc/_CurrentRuneLocale.patch | 23 - toolchain-overlay/libc/cdefs_no_hidden.patch | 63 - toolchain-overlay/libc/default.nix | 92 -- toolchain-overlay/libc/gdtoa.patch | 43 - toolchain-overlay/libc/genode_rel.ld | 261 ---- toolchain-overlay/libc/libc-builder.sh | 287 ----- toolchain-overlay/libc/libc.pc.in | 8 - toolchain-overlay/libc/libc.symbols | 1057 ----------------- toolchain-overlay/libc/log2.patch | 20 - toolchain-overlay/libc/mktime.patch | 44 - toolchain-overlay/libc/printfcommon.patch | 12 - toolchain-overlay/libc/rcmd.patch | 32 - toolchain-overlay/libc/res_init_c.patch | 125 -- toolchain-overlay/libc/runetype.patch | 15 - toolchain-overlay/libc/semaphore.patch | 11 - toolchain-overlay/libc/thread_local.patch | 23 - toolchain-overlay/libc/types.patch | 52 - toolchain-overlay/libc/vfwprintf_c_warn.patch | 31 - toolchain-overlay/libc/xlocale.patch | 35 - toolchain-overlay/libc/xlocale_private.patch | 59 - toolchain-overlay/libc/xprintf_float.patch | 12 - 29 files changed, 6 insertions(+), 2551 deletions(-) delete mode 100644 toolchain-overlay/Genode.cmake delete mode 100644 toolchain-overlay/binutils.patch delete mode 100644 toolchain-overlay/default.nix delete mode 100644 toolchain-overlay/headers/default.nix delete mode 100644 toolchain-overlay/libc/MB_CUR_MAX.patch delete mode 100644 toolchain-overlay/libc/_CurrentRuneLocale.patch delete mode 100644 toolchain-overlay/libc/cdefs_no_hidden.patch delete mode 100644 toolchain-overlay/libc/default.nix delete mode 100644 toolchain-overlay/libc/gdtoa.patch delete mode 100644 toolchain-overlay/libc/genode_rel.ld delete mode 100755 toolchain-overlay/libc/libc-builder.sh delete mode 100644 toolchain-overlay/libc/libc.pc.in delete mode 100644 toolchain-overlay/libc/libc.symbols delete mode 100644 toolchain-overlay/libc/log2.patch delete mode 100644 toolchain-overlay/libc/mktime.patch delete mode 100644 toolchain-overlay/libc/printfcommon.patch delete mode 100644 toolchain-overlay/libc/rcmd.patch delete mode 100644 toolchain-overlay/libc/res_init_c.patch delete mode 100644 toolchain-overlay/libc/runetype.patch delete mode 100644 toolchain-overlay/libc/semaphore.patch delete mode 100644 toolchain-overlay/libc/thread_local.patch delete mode 100644 toolchain-overlay/libc/types.patch delete mode 100644 toolchain-overlay/libc/vfwprintf_c_warn.patch delete mode 100644 toolchain-overlay/libc/xlocale.patch delete mode 100644 toolchain-overlay/libc/xlocale_private.patch delete mode 100644 toolchain-overlay/libc/xprintf_float.patch diff --git a/flake.lock b/flake.lock index b6a0a67..67d745d 100644 --- a/flake.lock +++ b/flake.lock @@ -34,9 +34,9 @@ }, "nixpkgs": { "inputs": {}, - "narHash": "sha256-1pvSqpPbcREIGI7BF6A29b81bH/dZvywTPwYhrMaRa0=", - "originalUrl": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git", - "url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=master&rev=ff59349d99ff0ff2496e85278c596df3a14ef3ec" + "narHash": "sha256-1bzVtI5qk3bFvAnf4ww3R4grNymC4EdZZsRncuKe/gQ=", + "originalUrl": "git+file:///home/repo/nixpkgs?ref=genode", + "url": "git+file:///home/repo/nixpkgs?ref=genode&rev=52db5235aa35b4e334a7187ba18517cb5dc6410d" } }, "version": 3 diff --git a/flake.nix b/flake.nix index 1233661..763179e 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ description = "Genode packages"; inputs = { - nixpkgs.uri = "git+https://gitea.c3d2.de/ehmry/nixpkgs.git"; + nixpkgs.uri = "git+file:///home/repo/nixpkgs?ref=genode"; dhall-haskell.uri = "git+https://github.com/dhall-lang/dhall-haskell?ref=flake"; }; @@ -29,5 +29,6 @@ inherit self nixpkgs dhall-haskell genode-depot; genodepkgs = builtins.getAttr system self.packages; }); + }; } diff --git a/packages.nix b/packages.nix index 4344648..f675b4d 100644 --- a/packages.nix +++ b/packages.nix @@ -8,12 +8,7 @@ let toolchainOverlay = import ./toolchain-overlay; # Overlay of toolchain patches - super = import nixpkgs { - # Evaluate an overlayed Nixpkgs for a Genode target - localSystem = "x86_64-linux"; - crossSystem = "x86_64-genode"; - overlays = [ toolchainOverlay ]; - }; + super = builtins.getAttr system nixpkgs.legacyPackages; inherit (super) callPackage; diff --git a/toolchain-overlay/Genode.cmake b/toolchain-overlay/Genode.cmake deleted file mode 100644 index 962da53..0000000 --- a/toolchain-overlay/Genode.cmake +++ /dev/null @@ -1,32 +0,0 @@ -set(GENODE 1) - -set(CMAKE_DL_LIBS "") -set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC") -set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE") -set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER YES) -set(CMAKE_C_LINK_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE} "-pie") -set(CMAKE_C_LINK_OPTIONS_NO_PIE "-no-pie") -set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") -set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") -set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") -set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") -set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,") -set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,") -set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic") - -# Disable the stack protector until a later stage of LLVM migration -set(CMAKE_C_FLAGS "-fno-stack-protector") -set(CMAKE_CXX_FLAGS "-fno-stack-protector") - -# Shared libraries with no builtin soname may not be linked safely by -# specifying the file path. -set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1) - -# Initialize C link type selection flags. These flags are used when -# building a shared library, shared module, or executable that links -# to other libraries to select whether to use the static or shared -# versions of the libraries. -foreach(type SHARED_LIBRARY SHARED_MODULE EXE) - set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic") - set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic") -endforeach() diff --git a/toolchain-overlay/binutils.patch b/toolchain-overlay/binutils.patch deleted file mode 100644 index a9f514f..0000000 --- a/toolchain-overlay/binutils.patch +++ /dev/null @@ -1,83 +0,0 @@ -diff --git a/bfd/config.bfd b/bfd/config.bfd -index 6391f35684..f2ab802fb5 100644 ---- a/bfd/config.bfd -+++ b/bfd/config.bfd -@@ -554,7 +554,7 @@ case "${targ}" in - targ_selvecs=hppa_elf32_vec - ;; - -- i[3-7]86-*-elf* | i[3-7]86-*-rtems*) -+ i[3-7]86-*-elf* | i[3-7]86-*-rtems* | i[3-7]86-*-genode*) - targ_defvec=i386_elf32_vec - targ_selvecs="iamcu_elf32_vec i386_coff_vec" - ;; -@@ -662,7 +662,7 @@ case "${targ}" in - targ_selvecs="i386_elf32_vec iamcu_elf32_vec l1om_elf64_vec k1om_elf64_vec" - want64=true - ;; -- x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia) -+ x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia | x86_64-*-genode*) - targ_defvec=x86_64_elf64_vec - targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec l1om_elf64_vec k1om_elf64_vec" - case "${targ}" in -diff --git a/config.sub b/config.sub -index c95acc681d..388c305636 100755 ---- a/config.sub -+++ b/config.sub -@@ -1376,7 +1376,7 @@ case $os in - | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ - | skyos* | haiku* | rdos* | toppers* | drops* | es* \ - | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ -- | midnightbsd*) -+ | midnightbsd* | genode*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - qnx*) -diff --git a/gas/configure.tgt b/gas/configure.tgt -index 3d0415c1aa..7cd96b6be4 100644 ---- a/gas/configure.tgt -+++ b/gas/configure.tgt -@@ -139,7 +139,8 @@ case ${generic_target} in - - arm-*-phoenix*) fmt=elf ;; - arm-*-elf) fmt=elf ;; -- arm-*-eabi* | arm-*-rtems*) fmt=elf em=armeabi ;; -+ arm-*-eabi* | arm-*-rtems* | arm-*-genode*) -+ fmt=elf em=armeabi ;; - arm-*-symbianelf*) fmt=elf em=symbian ;; - arm-*-kaos*) fmt=elf ;; - arm-*-conix*) fmt=elf ;; -@@ -213,6 +214,7 @@ case ${generic_target} in - i386-*-elfiamcu) fmt=elf arch=iamcu ;; - i386-*-elf*) fmt=elf ;; - i386-*-fuchsia*) fmt=elf ;; -+ i386-*-genode*) fmt=elf ;; - i386-*-kaos*) fmt=elf ;; - i386-*-bsd*) fmt=aout em=386bsd ;; - i386-*-nacl*) fmt=elf em=nacl -diff --git a/ld/configure.tgt b/ld/configure.tgt -index fad8b2e5c8..04f7fa0e70 100644 ---- a/ld/configure.tgt -+++ b/ld/configure.tgt -@@ -115,7 +115,7 @@ arm-*-nto*) targ_emul=armnto ;; - arm-*-phoenix*) targ_emul=armelf ;; - armeb-*-elf | armeb-*-eabi*) - targ_emul=armelfb ;; --arm-*-elf | arm*-*-eabi* | arm-*-rtems*) -+arm-*-elf | arm*-*-eabi* | arm-*-rtems* | arm-*-genode*) - targ_emul=armelf ;; - arm*-*-symbianelf*) targ_emul=armsymbian;; - arm-*-kaos*) targ_emul=armelf ;; -@@ -302,10 +302,10 @@ x86_64-*-netbsd*) targ_emul=elf_x86_64 - esac ;; - i[3-7]86-*-elfiamcu) targ_emul=elf_iamcu - targ_extra_emuls=elf_i386 ;; --i[3-7]86-*-elf* | i[3-7]86-*-rtems*) -+i[3-7]86-*-elf* | i[3-7]86-*-rtems* | i[3-7]86-*-genode*) - targ_emul=elf_i386 - targ_extra_emuls=elf_iamcu ;; --x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia*) -+x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia* | x86_64-*-genode*) - targ_emul=elf_x86_64 - targ_extra_emuls="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om" - targ_extra_libpath="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om" diff --git a/toolchain-overlay/default.nix b/toolchain-overlay/default.nix deleted file mode 100644 index 3425dec..0000000 --- a/toolchain-overlay/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -# SPDX-FileCopyrightText: Emery Hemingway -# -# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 - -self: super: - -let - inherit (super) lib; - - hasGenode = with super.stdenv; - (if hostPlatform ? isGenode then hostPlatform.isGenode else false) - || (if targetPlatform ? isGenode then targetPlatform.isGenode else false); - - genodelibc = self.callPackage ./libc { stdenv = self.crossLibcStdenv; }; - -in { - - binutils-unwrapped = super.binutils-unwrapped.overrideAttrs (attrs: { - patches = attrs.patches ++ (lib.optional hasGenode ./binutils.patch); - }); - - cmake = super.cmake.overrideAttrs (attrs: { - postInstall = if hasGenode then '' - local MODULE="$out/share/cmake-${ - lib.versions.majorMinor attrs.version - }/Modules/Platform/Genode.cmake" - if [ -e "$MODULE" ]; then - echo "Upstream provides $MODULE!" - exit 1 - fi - cp ${./Genode.cmake} $MODULE - '' else - null; - }); - - genodeHeaders = self.callPackage ./headers { }; - - inherit genodelibc; - libcCross = genodelibc; - -} diff --git a/toolchain-overlay/headers/default.nix b/toolchain-overlay/headers/default.nix deleted file mode 100644 index 39e2bb9..0000000 --- a/toolchain-overlay/headers/default.nix +++ /dev/null @@ -1,56 +0,0 @@ -# SPDX-FileCopyrightText: Emery Hemingway -# -# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 - -{ stdenvNoCC, lib, fetchurl }: - -let - stdenv = stdenvNoCC; - version = "19.08"; - platform = stdenv.targetPlatform; -in stdenv.mkDerivation { - pname = platform.system + "-headers"; - inherit version; - - src = fetchurl { - url = "https://github.com/genodelabs/genode/archive/${version}.tar.gz"; - sha256 = "1x5yjb4l36pfg87k389qyq3y3kv5yblzn9r6ikyqgam413bpxabi"; - }; - - specs = with platform; [] - ++ lib.optional is32bit "32bit" - ++ lib.optional is64bit "64bit" - ++ lib.optional isAarch32 "arm" - ++ lib.optional isAarch64 "arm_64" - ++ lib.optional isRiscV "riscv" - ++ lib.optional isx86 "x86" - ++ lib.optional isx86_32 "x86_32" - ++ lib.optional isx86_64 "x86_64"; - - builder = builtins.toFile "builder.sh" '' - source $stdenv/setup - - tar fx $src \ - --strip-components=2 \ - genode-$version/repos/base/include \ - genode-$version/repos/demo/include \ - genode-$version/repos/gems/include \ - genode-$version/repos/libports/include \ - genode-$version/repos/os/include \ - genode-$version/repos/ports/include \ - - includeDir=$out/include - mkdir -p $includeDir - - for DIR in */include; do - for SPEC in $specs; do - if [ -d $DIR/spec/$SPEC ]; then - cp -r $DIR/spec/$SPEC/* $includeDir/ - rm -r $DIR/spec/$SPEC - fi - done - rm -rf $DIR/spec - cp -r $DIR/* $includeDir - done - ''; -} diff --git a/toolchain-overlay/libc/MB_CUR_MAX.patch b/toolchain-overlay/libc/MB_CUR_MAX.patch deleted file mode 100644 index 7419fcc..0000000 --- a/toolchain-overlay/libc/MB_CUR_MAX.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- src/lib/libc/include/stdlib.h.orig 2019-04-18 13:26:58.781188866 +0200 -+++ src/lib/libc/include/stdlib.h 2019-04-18 13:27:46.100594001 +0200 -@@ -81,7 +81,8 @@ - #endif - extern int __mb_cur_max; - extern int ___mb_cur_max(void); --#define MB_CUR_MAX ((size_t)___mb_cur_max()) -+/* ASCII only */ -+#define MB_CUR_MAX 1 - - _Noreturn void abort(void); - int abs(int) __pure2; - ---- src/lib/libc/include/xlocale/_stdlib.h.orig 2019-04-18 13:28:52.691756865 +0200 -+++ src/lib/libc/include/xlocale/_stdlib.h 2019-04-18 13:29:13.079500565 +0200 -@@ -57,5 +57,6 @@ - int wctomb_l(char *, wchar_t, locale_t); - - int ___mb_cur_max_l(locale_t); --#define MB_CUR_MAX_L(x) ((size_t)___mb_cur_max_l(x)) -+/* ASCII only */ -+#define MB_CUR_MAX_L(x) 1 - - diff --git a/toolchain-overlay/libc/_CurrentRuneLocale.patch b/toolchain-overlay/libc/_CurrentRuneLocale.patch deleted file mode 100644 index 1420e84..0000000 --- a/toolchain-overlay/libc/_CurrentRuneLocale.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- src/lib/libc/include/runetype.h.orig 2019-04-16 11:51:27.954530199 +0200 -+++ src/lib/libc/include/runetype.h 2019-04-16 11:51:53.346901123 +0200 -@@ -88,19 +88,7 @@ - __BEGIN_DECLS - extern const _RuneLocale _DefaultRuneLocale; - extern const _RuneLocale *_CurrentRuneLocale; --#if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL) --extern const _RuneLocale *__getCurrentRuneLocale(void); --#else --extern _Thread_local const _RuneLocale *_ThreadRuneLocale; --static __inline const _RuneLocale *__getCurrentRuneLocale(void) --{ -- -- if (_ThreadRuneLocale) -- return _ThreadRuneLocale; -- return _CurrentRuneLocale; --} --#endif /* __NO_TLS || __RUNETYPE_INTERNAL */ --#define _CurrentRuneLocale (__getCurrentRuneLocale()) -+#define _CurrentRuneLocale (&_DefaultRuneLocale) - __END_DECLS - - #endif /* !_RUNETYPE_H_ */ diff --git a/toolchain-overlay/libc/cdefs_no_hidden.patch b/toolchain-overlay/libc/cdefs_no_hidden.patch deleted file mode 100644 index 67c691f..0000000 --- a/toolchain-overlay/libc/cdefs_no_hidden.patch +++ /dev/null @@ -1,63 +0,0 @@ -Prevent the use of the hidden attribute for symbols. In particular, -the attribute must not be applied to '__libc'-prefixed symbols to allow -overwriting the dummies defined in dummies.cc by other non-weak -implementations such as those in 'libc_noux.lib.so'. - -This attribute is applied inconsistently in -libc/lib/libc/include/libc_private.h anyway. - -Also, force i386 to call __libc_sigprocmask via PLT to prevent -R_386_PC32 relocations, which had to change the text segment. Other -architectures do this automatically. - ---- src/lib/libc/sys/sys/cdefs.h -+++ src/lib/libc/sys/sys/cdefs.h -@@ -447,7 +447,7 @@ - #if __GNUC_PREREQ__(4, 0) - #define __null_sentinel __attribute__((__sentinel__)) - #define __exported __attribute__((__visibility__("default"))) --#define __hidden __attribute__((__visibility__("hidden"))) -+#define __hidden - #else - #define __null_sentinel - #define __exported ---- src/lib/libc/lib/libc/i386/gen/setjmp.S -+++ src/lib/libc/lib/libc/i386/gen/setjmp.S -@@ -54,7 +54,7 @@ - pushl %eax /* (sigset_t*)oset */ - pushl $0 /* (sigset_t*)set */ - pushl $1 /* SIG_BLOCK */ -- call __libc_sigprocmask -+ call __i386_libc_sigprocmask - addl $12,%esp - movl 4(%esp),%ecx - movl 0(%esp),%edx -@@ -76,7 +76,7 @@ - leal 28(%edx), %eax - pushl %eax /* (sigset_t*)set */ - pushl $3 /* SIG_SETMASK */ -- call __libc_sigprocmask -+ call __i386_libc_sigprocmask - addl $12,%esp - movl 4(%esp),%edx - movl 8(%esp),%eax ---- src/lib/libc/lib/libc/i386/gen/sigsetjmp.S -+++ src/lib/libc/lib/libc/i386/gen/sigsetjmp.S -@@ -63,7 +63,7 @@ - pushl %eax /* (sigset_t*)oset */ - pushl $0 /* (sigset_t*)set */ - pushl $1 /* SIG_BLOCK */ -- call __libc_sigprocmask -+ call __i386_libc_sigprocmask - addl $12,%esp - movl 4(%esp),%ecx - 2: movl 0(%esp),%edx -@@ -87,7 +87,7 @@ - leal 28(%edx), %eax - pushl %eax /* (sigset_t*)set */ - pushl $3 /* SIG_SETMASK */ -- call __libc_sigprocmask -+ call __i386_libc_sigprocmask - addl $12,%esp - movl 4(%esp),%edx - 2: movl 8(%esp),%eax diff --git a/toolchain-overlay/libc/default.nix b/toolchain-overlay/libc/default.nix deleted file mode 100644 index 9e9e093..0000000 --- a/toolchain-overlay/libc/default.nix +++ /dev/null @@ -1,92 +0,0 @@ -# SPDX-FileCopyrightText: Emery Hemingway -# -# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 - -{ stdenv, fetchgit, fetchurl, genodeHeaders, bison, flex, glibc }: - -let - archInfo = with stdenv.hostPlatform; - if isAarch32 then { - inherit isArm isAarch32; - } else if isAarch64 then { - inherit isArm isAarch64; - } else if isx86_32 then { - inherit isx86 isx86_32; - } else if isx86_64 then { - inherit isx86 isx86_64; - } else - { }; -in stdenv.mkDerivation (archInfo // { - name = "genodelibc-12.0.0"; - outputs = [ "out" "dev" ]; - - builder = ./libc-builder.sh; - - inherit genodeHeaders; - - depsBuildBuild = [ - bison - flex - glibc # provides rpcgen - ]; - - src = fetchurl { - url = - "http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/12.0-RELEASE/src.txz"; - sha256 = "0da393ac2174168a71c1c527d1453e07372295187d05c288250800cb152a889b"; - }; - - unpackPhase = "tar xf $src $tarFlags"; - - tarFlags = [ - "--strip-components=2" - "usr/src/contrib/gdtoa" - "usr/src/contrib/libc-vis" - "usr/src/contrib/tzcode/stdtime" - "usr/src/include" - "usr/src/lib/libc" - "usr/src/lib/msun" - "usr/src/sys/amd64" - "usr/src/sys/arm" - "usr/src/sys/arm64" - "usr/src/sys/bsm" - "usr/src/sys/crypto/chacha20" - "usr/src/sys/i386" - "usr/src/sys/libkern" - "usr/src/sys/net" - "usr/src/sys/netinet" - "usr/src/sys/netinet6" - "usr/src/sys/riscv" - "usr/src/sys/rpc" - "usr/src/sys/sys" - "usr/src/sys/vm" - "usr/src/sys/x86" - ]; - - patches = [ - ./cdefs_no_hidden.patch - ./_CurrentRuneLocale.patch - ./gdtoa.patch - ./log2.patch - ./MB_CUR_MAX.patch - ./mktime.patch - ./printfcommon.patch - ./rcmd.patch - ./res_init_c.patch - ./runetype.patch - ./semaphore.patch - ./thread_local.patch - ./types.patch - ./vfwprintf_c_warn.patch - ./xlocale.patch - ./xlocale_private.patch - ./xprintf_float.patch - ]; - - patchFlags = "-p0 --strip 3"; - - ldScriptSo = ./genode_rel.ld; - - libcPcIn = ./libc.pc.in; - libcSymbols = ./libc.symbols; -}) diff --git a/toolchain-overlay/libc/gdtoa.patch b/toolchain-overlay/libc/gdtoa.patch deleted file mode 100644 index d9d6ae3..0000000 --- a/toolchain-overlay/libc/gdtoa.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- src/lib/libc/contrib/gdtoa/gdtoaimp.h.orig 2019-04-16 11:11:02.420833030 +0200 -+++ src/lib/libc/contrib/gdtoa/gdtoaimp.h 2019-04-16 11:11:17.704278981 +0200 -@@ -506,40 +506,6 @@ - #define Bcopy(x,y) memcpy(&x->sign,&y->sign,y->wds*sizeof(ULong) + 2*sizeof(int)) - #endif /* NO_STRING_H */ - --/* -- * Paranoia: Protect exported symbols, including ones in files we don't -- * compile right now. The standard strtof and strtod survive. -- */ --#define dtoa __dtoa --#define gdtoa __gdtoa --#define freedtoa __freedtoa --#define strtodg __strtodg --#define g_ddfmt __g_ddfmt --#define g_dfmt __g_dfmt --#define g_ffmt __g_ffmt --#define g_Qfmt __g_Qfmt --#define g_xfmt __g_xfmt --#define g_xLfmt __g_xLfmt --#define strtoId __strtoId --#define strtoIdd __strtoIdd --#define strtoIf __strtoIf --#define strtoIQ __strtoIQ --#define strtoIx __strtoIx --#define strtoIxL __strtoIxL --#define strtord_l __strtord_l --#define strtordd __strtordd --#define strtorf __strtorf --#define strtorQ_l __strtorQ_l --#define strtorx_l __strtorx_l --#define strtorxL __strtorxL --#define strtodI __strtodI --#define strtopd __strtopd --#define strtopdd __strtopdd --#define strtopf __strtopf --#define strtopQ __strtopQ --#define strtopx __strtopx --#define strtopxL __strtopxL -- - /* Protect gdtoa-internal symbols */ - #define Balloc __Balloc_D2A - #define Bfree __Bfree_D2A diff --git a/toolchain-overlay/libc/genode_rel.ld b/toolchain-overlay/libc/genode_rel.ld deleted file mode 100644 index a756ffa..0000000 --- a/toolchain-overlay/libc/genode_rel.ld +++ /dev/null @@ -1,261 +0,0 @@ -/* - * \brief Linker script for libraries - * \author Sebastian Sumpf - * \date 2009-11-05 - * - * Script for --shared -z combreloc: shared library, combine & sort relocs - */ - -/* - * Copyright (C) 2009-2017 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -PHDRS -{ - ro PT_LOAD; - rw PT_LOAD; - dynamic PT_DYNAMIC; - eh_frame PT_GNU_EH_FRAME; -} - -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - .note.gnu.build-id : { *(.note.gnu.build-id) } : ro - .hash : { *(.hash) } - .gnu.hash : { *(.gnu.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .gnu.version : { *(.gnu.version) } - .gnu.version_d : { *(.gnu.version_d) } - .gnu.version_r : { *(.gnu.version_r) } - .rel.dyn : - { - *(.rel.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rel.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rel.dtors) - *(.rel.got) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - } - .rela.dyn : - { - *(.rela.init) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rela.fini) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rela.ctors) - *(.rela.dtors) - *(.rela.got) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - } - .rel.plt : { *(.rel.plt) } - .rela.plt : { *(.rela.plt) } - .init : - { - KEEP (*(.init)) - } = 0x0 - .plt : { *(.plt) } - .text : - { - *(.text .stub .text.* .gnu.linkonce.t.*) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - } = 0x0 - .fini : - { - KEEP (*(.fini)) - } =0x0 - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } - .rodata1 : { *(.rodata1) } - - .eh_frame_hdr : { *(.eh_frame_hdr) } : eh_frame : ro - .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) } - - /* - * Adjust the address for the data segment. We want to adjust up to - * the same address within the page on the next page up. - */ - . = ALIGN(0x1000); - - .data : - { - /* - * Leave space for parent capability parameters at start of data - * section. The protection domain creator is reponsible for storing - * sane values here. - */ - _parent_cap = .; - _parent_cap_thread_id = .; - LONG(0xffffffff); - _parent_cap_local_name = .; - LONG(0xffffffff); - LONG(0xffffffff); - LONG(0xffffffff); - LONG(0xffffffff); - LONG(0xffffffff); - LONG(0xffffffff); - LONG(0xffffffff); - - /* - * Platform-specific entry for Fiasco.OC. - * - * PIC-code compiled for Fiasco.OC, needs some PIC-compatible - * way to enter the kernel, the fixed address of the kernel - * entry code address needs to be found here. - */ - __l4sys_invoke_indirect = .; - LONG(0xeacff000); - - *(.data .data.* .gnu.linkonce.d.*) - SORT(CONSTRUCTORS) - } : rw - - /* .ARM.exidx is sorted, so has to go in its own output section */ - .ARM.extab : { - *(.ARM.extab*) - } - __exidx_start = .; - .ARM.exidx : { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } - __exidx_end = .; - - /* Thread Local Storage sections */ - .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } - .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } - - .preinit_array : - { - KEEP (*(.preinit_array)) - } - .fini_array : - { - KEEP (*(.fini_array)) - KEEP (*(SORT(.fini_array.*))) - } - .ctors : - { - /* - * gcc uses crtbegin.o to find the start of the constructors, so we make - * sure it is first. Because this is a wildcard, it doesn't matter if the - * user does not actually link against crtbegin.o; the linker won't look - * for a file to match a wildcard. The wildcard also means that it - * doesn't matter which directory crtbegin.o is in. - * */ - /* KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors))*/ - /* - * We don't want to include the .ctor section from the crtend.o file until - * after the sorted ctors. The .ctor section from the crtend file contains - * the end of ctors marker and it must be last - */ - KEEP(*(_mark_ctors_start)); - _ctors_start = .; - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - KEEP (*(.init_array)) /* list of constructors specific for ARM eabi */ - _ctors_end = .; - KEEP(*(_mark_ctors_end)); - - } - .dtors : - { - PROVIDE(_dtors_start = .); - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - PROVIDE(_dtors_end = .); - } - .jcr : { KEEP (*(.jcr)) } - .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) } - - .data1 : { *(.data1) } - .dynamic : { *(.dynamic) } : dynamic : rw - /* See: genode_dyn.ld */ - .got : { *(.got.plt) *(.got) } - /* Exception handling */ - .eh_frame : - { - __eh_frame_start__ = .; - KEEP (*(.eh_frame)) - LONG(0) - } - _edata = .; PROVIDE (edata = .); - __bss_start = .; - .bss : - { - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - - /* - * Align here to ensure that the .bss section occupies space up to - * _end. Align after .bss to ensure correct alignment even if the - * .bss section disappears because there are no input sections. - * - * FIXME: Why do we need it? When there is no .bss section, we don't - * pad the .data section. - */ - . = ALIGN(. != 0 ? 32 / 8 : 1); - } - . = ALIGN(32 / 8); - . = ALIGN(32 / 8); - _end = .; PROVIDE (end = .); - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /* DWARF 3 */ - .debug_pubtypes 0 : { *(.debug_pubtypes) } - .debug_ranges 0 : { *(.debug_ranges) } - .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } - /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) } -} diff --git a/toolchain-overlay/libc/libc-builder.sh b/toolchain-overlay/libc/libc-builder.sh deleted file mode 100755 index 4c21dac..0000000 --- a/toolchain-overlay/libc/libc-builder.sh +++ /dev/null @@ -1,287 +0,0 @@ -source $stdenv/setup - -export includedir=${dev}/include -export pkgconfigdir=${out}/lib/pkgconfig - -compileStub() { - local ASM_SYM_DEPENDENCY="movq \1@GOTPCREL(%rip), %rax" - # TODO: .long \1 - - sed \ - -e "s/^\(\w\+\) D \(\w\+\)\$/.data; .global \1; .type \1,%object; .size \1,\2; \1:/" \ - -e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%object; \1:/" \ - -e "s/^\(\w\+\) T/.text; .global \1; .type \1,%function; \1:/" \ - -e "s/^\(\w\+\) R \(\w\+\)\$/.section .rodata; .global \1; .type \1,%object; .size \1,\2; \1:/" \ - -e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%function; \1:/" \ - -e "s/^\(\w\+\) B \(\w\+\)\$/.bss; .global \1; .type \1,%object; .size \1,\2; \1:/" \ - -e "s/^\(\w\+\) U/.text; .global \1; ${ASM_SYM_DEPENDENCY}/" \ - $1 > symbols.s - - $CC -x assembler -c symbols.s -o tmp.o - - $LD -o $2 \ - -shared \ - -T$ldScriptSo \ - tmp.o - - rm tmp.o symbols.s -} - - -# Add a prefix to the following arguments -# -addPrefix() { - local prefix=$1 - local files="" - - for (( i = 2; i <= $#; i++)); do - files="$files $prefix${!i}" - done - echo -n $files -} - -# -# Copy into dest the following arguments, -# rooted at $includedir -# -copyIncludes() { - local to=$1; shift - local from=$1; shift - - mkdir -p $to - for i in $*; do - cp $from/$i $to/ - done -} - - -# -# CPU-architecture-specific headers -# -# The 'common_include_*_content' functions take the CPU architecture as first -# argument. -# - -common_include_libc_arch_content() { - local content - for i in stdarg.h float.h - do content="$content sys/$1/include/$i"; done - - for i in arith.h _fpmath.h SYS.h gd_qnan.h - do content="$content lib/libc/$2/$i"; done - - echo -n $content -} - -common_include_libc_arch_machine_content() { - for i in \ - _types.h endian.h _limits.h signal.h trap.h _stdint.h \ - sysarch.h ieeefp.h frame.h vm.h \ - cpufunc.h vmparam.h atomic.h elf.h exec.h reloc.h pmap.h \ - ucontext.h setjmp.h asm.h param.h _inttypes.h _align.h float.h - do echo sys/$1/include/$i; done -} - -rpcgen_() { - rpcgen -C -h -DWANT_NFS3 $1 -o $2 -} - - -installPhase() { - mkdir -p $includedir/machine - - # - # CPU-architecture-specific headers - # - - # - # x86-specific headers - # - if [ -n "${isx86:-}" ]; then - cp lib/msun/x86/fenv.h $includedir - cp -r sys/x86/include $includedir/x86 - fi - - # - # i386-specific headers - # - if [ -n "${isx86_32:-}" ]; then - cp \ - $(common_include_libc_arch_content i386 i386) \ - $includedir - - cp \ - $(common_include_libc_arch_machine_content i386) \ - sys/i386/include/specialreg.h \ - sys/i386/include/npx.h \ - $includedir/machine - fi - - # - # AMD64-specific headers - # - if [ -n "${isx86_64:-}" ]; then - cp \ - $(common_include_libc_arch_content amd64 amd64) \ - $includedir - - cp \ - $(common_include_libc_arch_machine_content amd64) \ - sys/amd64/include/specialreg.h \ - sys/amd64/include/fpu.h \ - $includedir/machine - fi - - # - # ARM-specific headers - # - if [ -n "${isAarch32:-}" ]; then - cp \ - $(common_include_libc_arch_content arm arm) \ - lib/msun/arm/fenv.h \ - $includedir - - cp \ - $(common_include_libc_arch_machine_content arm) \ - $includedir/machine - - copyIncludes $includedir/machine sys/arm/include \ - armreg.h atomic-v6.h ieee.h sysreg.h - fi - - # - # ARM64-specific headers - # - if [ -n "${isAarch32:-}" ]; then - cp \ - $(common_include_libc_arch_content arm64 aarch64) \ - lib/msun/aarch64/fenv.h \ - $includedir - - cp \ - $(common_include_libc_arch_machine_content arm64) \ - $includedir/machine - - copyIncludes $includedir/machine sys/arm64/include/ \ - armreg.h - fi - - - ############################################################## - - flex -P_nsyy -t lib/libc/net/nslexer.l \ - | sed -e '/YY_BUF_SIZE/s/16384/1024/' \ - > lib/libc/net/nslexer.c - - bison -d -p_nsyy lib/libc/net/nsparser.y \ - --defines=lib/libc/net/nsparser.h \ - --output=lib/libc/net/nsparser.c - - local generated_files="include/rpc/rpcb_prot.h" - for h in \ - bootparam_prot.h nfs_prot.h nlm_prot.h rstat.h ypupdate_prot.h \ - crypt.h nis_cache.h pmap_prot.h rwall.h yp.h \ - key_prot.h nis_callback.h rex.h sm_inter.h ypxfrd.h \ - klm_prot.h nis_object.h rnusers.h spray.h \ - mount.h nis.h rquota.h yppasswd.h - do generated_files="$generated_files include/rpcsvc/$h"; done - - for file in $generated_files; do - rpcgen -C -h -DWANT_NFS3 ${file%h}x -o $file - done - - - # - # Generic headers - # - copyIncludes $includedir include \ - strings.h limits.h string.h ctype.h _ctype.h \ - stdlib.h stdio.h signal.h unistd.h wchar.h time.h sysexits.h \ - resolv.h wctype.h locale.h langinfo.h regex.h paths.h ieeefp.h \ - inttypes.h fstab.h netdb.h ar.h memory.h res_update.h \ - netconfig.h ifaddrs.h pthread.h err.h getopt.h search.h \ - varargs.h stddef.h stdbool.h assert.h monetary.h printf.h \ - libgen.h dirent.h dlfcn.h link.h fmtmsg.h fnmatch.h fts.h ftw.h \ - db.h grp.h nsswitch.h pthread_np.h pwd.h ttyent.h \ - stringlist.h glob.h a.out.h elf-hints.h nlist.h spawn.h \ - readpassphrase.h setjmp.h elf.h ulimit.h utime.h wordexp.h \ - complex.h semaphore.h uchar.h iconv.h termios.h \ - xlocale.h runetype.h \ - - copyIncludes $includedir sys/sys \ - syslog.h fcntl.h stdint.h sched.h ktrace.h _semaphore.h ucontext.h errno.h - - cp lib/msun/src/math.h $includedir - cp contrib/libc-vis/vis.h $includedir - - copyIncludes $includedir/rpc include/rpc \ - rpc.h xdr.h auth.h clnt_stat.h clnt.h clnt_soc.h rpc_msg.h \ - auth_unix.h auth_des.h svc.h svc_soc.h svc_auth.h pmap_clnt.h \ - pmap_prot.h rpcb_clnt.h rpcent.h des_crypt.h des.h nettype.h \ - rpcsec_gss.h raw.h rpc_com.h - - cp sys/rpc/rpcb_prot.h $includedir/rpc - - copyIncludes $includedir/rpcsvc include/rpcsvc \ - yp_prot.h ypclnt.h nis_tags.h nislib.h - - rpcgen_ include/rpcsvc/nis.x $includedir/rpcsvc/nis.h - rpcgen_ include/rpcsvc/crypt.x $includedir/rpcsvc/crypt.h - - mkdir $includedir/gssapi - cp include/gssapi/gssapi.h $includedir/gssapi - - copyIncludes $includedir/arpa include/arpa \ - inet.h ftp.h nameser.h nameser_compat.h telnet.h tftp.h - - copyIncludes $includedir/vm sys/vm vm_param.h vm.h pmap.h - - copyIncludes $includedir/net sys/net \ - if.h if_dl.h if_tun.h if_types.h radix.h route.h - - copyIncludes $includedir/netinet sys/netinet \ - in.h in_systm.h ip.h tcp.h - - mkdir -p $includedir/netinet6 - cp sys/netinet6/in6.h $includedir/netinet6 - - mkdir -p $includedir/bsm - cp sys/bsm/audit.h $includedir/bsm - - copyIncludes $includedir/sys sys/sys \ - _types.h limits.h cdefs.h _null.h types.h _pthreadtypes.h \ - syslimits.h select.h _sigset.h _timeval.h timespec.h \ - _timespec.h stat.h signal.h unistd.h time.h param.h stdint.h \ - event.h eventhandler.h disk.h errno.h poll.h queue.h mman.h \ - stddef.h sysctl.h uio.h _iovec.h ktrace.h ioctl.h ttycom.h \ - ioccom.h filio.h sockio.h wait.h file.h fcntl.h resource.h \ - disklabel.h link_elf.h endian.h mount.h ucred.h dirent.h \ - cpuset.h socket.h un.h ttydefaults.h imgact_aout.h elf32.h \ - elf64.h elf_generic.h elf_common.h nlist_aout.h ipc.h sem.h \ - exec.h _lock.h _mutex.h statvfs.h ucontext.h syslog.h times.h \ - utsname.h elf.h mtio.h _stdint.h atomic_common.h _ucontext.h \ - _cpuset.h _bitset.h bitset.h _stdarg.h _uio.h auxv.h random.h \ - _sockaddr_storage.h termios.h _termios.h _umtx.h kerneldump.h \ - conf.h disk_zone.h counter.h time.h \ - - mkdir $includedir/sys/rpc - cp sys/rpc/types.h $includedir/sys/rpc - - cp -r include/xlocale $includedir/ - - ln -s sys/poll.h $includedir/poll.h - - rm -r include # Don't need this anymore - - cp -r $genodeHeaders/include/* $includedir/ - - mkdir -p $pkgconfigdir - substituteAll $libcPcIn $pkgconfigdir/libc.pc - compileStub $libcSymbols $out/lib/libc.lib.so - ln -s $out/lib/libc.lib.so $out/lib/libc.so - ln -s $out/lib $out/lib64 - -} - - -genericBuild diff --git a/toolchain-overlay/libc/libc.pc.in b/toolchain-overlay/libc/libc.pc.in deleted file mode 100644 index 5f3521f..0000000 --- a/toolchain-overlay/libc/libc.pc.in +++ /dev/null @@ -1,8 +0,0 @@ -Name: libc -Description: Genode C runtime library -URL: https://genode.org/ -Version: @version@ -Requires: genode-libports -Requires.private: vfs -Cflags: -D__FreeBSD__=12 -D__GENODE__ -fno-builtin-sin -fno-builtin-cos -fno-builtin-sinf -fno-builtin-cosf -I@includedir@ -Libs: -l:libc.lib.so diff --git a/toolchain-overlay/libc/libc.symbols b/toolchain-overlay/libc/libc.symbols deleted file mode 100644 index 4b8fd9b..0000000 --- a/toolchain-overlay/libc/libc.symbols +++ /dev/null @@ -1,1057 +0,0 @@ -___runetype T -___tolower T -___toupper T -__assert T -__dn_expand T -__error T -__flt_rounds T -__fpclassifyd T -__fpclassifyf T -__has_sse D 4 -__h_errno T -__h_errno_set T -__inet_addr T -__inet_aton T -__inet_nsap_ntoa T -__inet_ntoa T -__inet_ntop T -__inet_pton T -__isthreaded B 4 -__mb_cur_max D 8 -___mb_cur_max D 50 -__res_init T -__res_query T -__res_state T -__srget T -__stderrp D 8 -__stdinp D 8 -__stdoutp D 8 -__swbuf T -__test_sse T -__xuname T -_exit T -_getlong T -_getshort T -a64l T -abort T -abs T -accept T -accept4 T -access T -alarm T -alphasort T -arc4random T -arc4random_addrandom T -arc4random_buf T -arc4random_stir T -arc4random_uniform T -asctime T -asctime_r T -asprintf T -atexit T -atof T -atoi T -atol T -atoll T -basename T -bcmp T -bcopy T -bind T -bsearch T -btowc T -bzero T -calloc T -cfgetispeed T -cfgetospeed T -cfmakeraw T -cfsetispeed T -cfsetospeed T -cfsetspeed T -cgetcap T -cgetclose T -cgetent T -cgetfirst T -cgetmatch T -cgetnext T -cgetnum T -cgetset T -cgetstr T -cgetustr T -chdir T -check_utility_compat T -chmod W -chown W -chroot W -clearerr T -clearerr_unlocked T -clock T -clock_gettime W -clock_getres W -close T -closedir T -closelog T -confstr T -connect T -creat W -crypt W -ctermid T -ctermid_r T -ctime T -ctime_r T -daemon T -dbopen W -des_cipher T -des_setkey T -difftime T -digittoint T -dirname T -div T -dl_iterate_phdr W -dladdr T -dlclose T -dlerror T -dlfunc T -dlinfo T -dllockinit W -dlopen T -dlsym T -dlvsym T -dprintf T -drand48 T -dup T -dup2 T -encrypt T -endfsent T -endgrent T -endnetgrent T -endpwent W -endttyent T -endusershell T -environ B 8 -erand48 T -err W -err_set_exit T -err_set_file T -errc T -errx T -execl T -execle T -execlp T -execv T -execvP T -execve T -execvp T -exit T -f_prealloc T -fchdir T -fchmod W -fchown W -fclose T -fcloseall W -fcntl T -fdatasync W -fdevname T -fdevname_r T -fdopen T -fdopendir T -feof T -feof_unlocked T -ferror T -ferror_unlocked T -fflagstostr T -fflush T -ffs T -ffsl T -ffsll T -fgetc T -fgetln T -fgetpos T -fgets T -fgetwc T -fgetwln T -fgetws T -fileno T -fileno_unlocked T -flock W -flockfile W -fls T -flsl T -flsll T -fmtcheck W -fmtmsg T -fnmatch T -fopen T -fork W -fpathconf W -fprintf T -fpurge T -fputc T -fputs T -fputwc T -fputws T -fread T -free T -freeaddrinfo T -freebsd7___semctl W -freebsd7_semctl T -freelocale T -freopen T -fscanf T -fseek T -fseeko T -fsetpos T -fstat T -fstatat T -fstatfs T -fstatvfs T -fsync T -ftell T -ftello T -ftok T -ftruncate T -ftrylockfile W -fts_children T -fts_close T -fts_get_clientptr T -fts_get_stream T -fts_open T -fts_read T -fts_set T -fts_set_clientptr T -ftw T -funlockfile W -funopen T -fwide T -fwprintf T -fwrite T -fwscanf T -gai_strerror T -getaddrinfo T -getbootfile T -getbsize T -getc T -getc_unlocked T -getchar T -getchar_unlocked T -getcontext W -getcwd T -getdelim T -getdirentries T -getdiskbyname T -getdomainname T -getdtablesize W -getegid W -getentropy W -getenv T -geteuid W -getfsent T -getfsfile T -getfsspec T -getfsstat W -getfstab T -getgid W -getgrent T -getgrent_r T -getgrgid T -getgrgid_r T -getgrnam T -getgrnam_r T -getgrouplist T -getgroups W -gethostbyaddr T -gethostbyaddr_r T -gethostbyname W -gethostid T -gethostname T -getline T -getloadavg T -getlogin T -getlogin_r T -getmntinfo T -getmode T -getnameinfo W -getnetgrent T -getopt T -getopt_long T -getopt_long_only T -getpagesize T -getpass T -getpeereid T -getpeername T -getpgrp W -getpid W -getppid W -getpriority W -getprogname W -getprotobyname T -getprotobyname_r T -getpwent W -getpwent_r W -getpwnam W -getpwnam_r W -getpwuid W -getpwuid_r W -getrandom W -getrlimit W -getrusage W -gets T -getservbyname W -getservbyport T -getservbyport_r T -getsid W -getsockname T -getsockopt T -getsubopt T -gettimeofday W -getttyent T -getttynam T -getuid W -getusershell T -getw T -getwc T -getwchar T -getwd T -glob T -globfree T -gmtime T -gmtime_r T -grantpt T -group_from_gid T -hcreate T -hdestroy T -heapsort T -hsearch T -imaxabs T -imaxdiv T -in6addr_any R 16 -in6addr_linklocal_allnodes R 16 -in6addr_loopback R 16 -in6addr_nodelocal_allnodes R 16 -index T -inet_addr W -inet_aton W -inet_lnaof W -inet_makeaddr W -inet_net_ntop W -inet_net_pton W -inet_neta W -inet_netof W -inet_network W -inet_nsap_addr W -inet_nsap_ntoa W -inet_ntoa W -inet_ntoa_r W -inet_ntop W -inet_pton W -initgroups T -initstate T -innetgr T -insque T -ioctl T -isalnum T -isalpha T -isascii T -isatty T -isblank T -iscntrl T -isdialuptty T -isdigit T -isgraph T -ishexnumber T -isideogram T -isinf W -islower T -isnan W -isnanf W -isnettty T -isnumber T -isphonogram T -isprint T -ispunct T -isrune T -issetugid T -isspace T -isspecial T -isupper T -iswalnum T -iswalpha T -iswascii T -iswblank T -iswcntrl T -iswctype T -iswdigit T -iswgraph T -iswhexnumber T -iswideogram T -iswlower T -iswnumber T -iswphonogram T -iswprint T -iswpunct T -iswrune T -iswspace T -iswspecial T -iswupper T -iswxdigit T -isxdigit T -jrand48 T -kill W -killpg T -ksem_init T -l64a T -l64a_r T -labs T -lcong48 T -ldexp T -ldiv T -lfind T -libc_select_notify V -link W -listen T -llabs T -lldiv T -localeconv T -localtime T -localtime_r T -lockf T -longjmp W -longjmperror T -lrand48 T -lsearch T -lseek T -lstat T -madvise W -makecontext W -malloc T -mblen T -mbrlen T -mbrtowc T -mbsinit T -mbsnrtowcs T -mbsrtowcs T -mbstowcs T -mbtowc T -memccpy T -memchr T -memcmp T -memcpy T -memmem T -memmove T -memrchr T -memset T -mergesort T -mkdir T -mkdtemp T -mkfifo W -mknod W -mkstemp T -mkstemps T -mktemp T -mktime T -mmap T -mprotect W -mrand48 T -msync T -munmap T -nanosleep W -clock_nanosleep W -newlocale T -nextwctype T -nftw T -nice T -nl_langinfo T -nlist T -nrand48 T -offtime T -open T -openat T -opendir T -openlog T -optarg B 8 -opterr D 4 -optind D 4 -optopt B 4 -optreset B 4 -pathconf W -pause W -pclose T -perror T -pipe T -poll W -ppoll W -popen T -posix2time T -posix_fadvise T -posix_madvise T -posix_spawn T -posix_spawn_file_actions_addclose T -posix_spawn_file_actions_adddup2 T -posix_spawn_file_actions_addopen T -posix_spawn_file_actions_destroy T -posix_spawn_file_actions_init T -posix_spawnattr_destroy T -posix_spawnattr_getflags T -posix_spawnattr_getpgroup T -posix_spawnattr_getschedparam T -posix_spawnattr_getschedpolicy T -posix_spawnattr_getsigdefault T -posix_spawnattr_getsigmask T -posix_spawnattr_init T -posix_spawnattr_setflags T -posix_spawnattr_setpgroup T -posix_spawnattr_setschedparam T -posix_spawnattr_setschedpolicy T -posix_spawnattr_setsigdefault T -posix_spawnattr_setsigmask T -posix_spawnp T -pread T -printf T -pselect W -psignal T -pthread_atfork T -pthread_attr_destroy T -pthread_attr_getdetachstate T -pthread_attr_getguardsize T -pthread_attr_getinheritsched T -pthread_attr_get_np T -pthread_attr_getschedparam T -pthread_attr_getschedpolicy T -pthread_attr_getscope T -pthread_attr_getstack T -pthread_attr_getstackaddr T -pthread_attr_getstacksize T -pthread_attr_init T -pthread_attr_setdetachstate T -pthread_attr_setguardsize T -pthread_attr_setinheritsched T -pthread_attr_setschedparam T -pthread_attr_setschedpolicy T -pthread_attr_setscope T -pthread_attr_setstackaddr T -pthread_attr_setstacksize T -pthread_cancel T -pthread_cleanup_pop T -pthread_cleanup_push T -pthread_cond_broadcast T -pthread_cond_destroy T -pthread_cond_init T -pthread_cond_signal T -pthread_cond_timedwait T -pthread_cond_wait T -pthread_condattr_destroy T -pthread_condattr_init T -pthread_condattr_setclock T -pthread_create W -pthread_detach T -pthread_equal T -pthread_exit T -pthread_getspecific T -pthread_join T -pthread_key_create T -pthread_key_delete T -pthread_kill T -pthread_main_np T -pthread_mutex_destroy T -pthread_mutex_init T -pthread_mutex_lock T -pthread_mutex_trylock T -pthread_mutex_unlock T -pthread_mutexattr_destroy T -pthread_mutexattr_init T -pthread_mutexattr_settype T -pthread_once T -pthread_rwlock_destroy T -pthread_rwlock_init T -pthread_rwlock_rdlock T -pthread_rwlock_tryrdlock T -pthread_rwlock_trywrlock T -pthread_rwlock_unlock T -pthread_rwlock_wrlock T -pthread_self T -pthread_setcancelstate T -pthread_setcanceltype T -pthread_setspecific T -pthread_sigmask T -pthread_testcancel T -ptsname T -putc T -putc_unlocked T -putchar T -putchar_unlocked T -putenv T -puts T -putw T -putwc T -putwchar T -pwrite T -qsort T -qsort_r T -radixsort T -raise W -rand T -rand_r T -random T -read T -readdir T -readdir_r T -readlink T -readpassphrase T -readv T -realloc T -reallocf T -realpath T -recv T -recvfrom T -recvmsg T -regcomp T -regerror T -regexec T -regfree T -register_printf_function T -register_printf_render T -register_printf_render_std T -remove T -remque T -rename T -rewind T -rewinddir T -rindex T -rmdir T -rpmatch T -sbrk W -scandir T -scanf T -sched_setparam W -sched_setscheduler W -sched_yield W -seed48 T -seekdir T -select W -sem_close T -semctl T -sem_destroy T -sem_getvalue T -semget W -sem_init T -sem_open T -semop W -sem_post T -sem_timedwait T -sem_trywait T -sem_unlink T -sem_wait T -send T -sendmsg W -sendto T -setbuf T -setbuffer T -setcontext W -setdomainname T -setegid W -setenv T -seteuid W -setfsent T -setfstab T -setgid W -setgrent T -setgroupent T -setgroups W -sethostid T -sethostname T -setitimer W -setjmp T -setkey T -setlinebuf T -setlocale T -setlogmask T -setmode T -setnetgrent T -setpassent W -setpgid W -setpgrp T -setpriority W -setprogname T -setpwent W -setregid W -setreuid W -setrgid T -setrlimit W -setruid T -setsid W -setsockopt T -setstate T -setttyent T -setuid W -setusershell T -setvbuf T -shutdown T -sigaction W -sigaddset T -sigblock T -sigdelset T -sigemptyset T -sigfillset T -sighold T -sigignore T -siginterrupt T -sigismember T -siglongjmp W -signal T -sigpause T -sigprocmask W -sigrelse T -sigset T -sigsetjmp T -sigsetmask T -sigsuspend W -sigvec T -sl_add T -sl_find T -sl_free T -sl_init T -sleep W -snprintf T -socket T -socketpair W -sprintf T -sradixsort T -srand T -srand48 T -sranddev T -srandom T -srandomdev T -sscanf T -stat T -statfs W -statvfs T -stpcpy T -stpncpy T -strcasecmp T -strcasestr T -strcat T -strchr T -strcmp T -strcoll T -strcpy T -strcspn T -strdup T -strerror T -strerror_r T -strfmon T -strftime T -strlcat T -strlcpy T -strlen T -strmode T -strncasecmp T -strncat T -strncmp T -strncpy T -strndup T -strnlen T -strnstr T -strpbrk T -strptime T -strrchr T -strsep T -strsignal T -strspn T -strstr T -strtod T -strtof T -strtofflags T -strtoimax T -strtok T -strtok_r W -strtol T -strtold T -strtoll T -strtonum T -strtoq T -strtoul T -strtoull T -strtoumax T -strtouq T -strunvis T -strunvisx T -strvis T -strvisx T -strxfrm T -suboptarg B 8 -swab T -swapcontext W -swprintf T -swscanf T -symlink T -sync W -sys_errlist D 776 -sys_nerr R 4 -sys_nsig R 4 -sys_siglist D 256 -sys_signame D 256 -syscall T -sysconf T -sysctl T -sysctlbyname T -sysctlnametomib T -syslog T -system W -tcdrain W -tcflow T -tcflush T -tcgetattr T -tcgetpgrp T -tcgetsid T -tcsendbreak T -tcsetattr T -tcsetpgrp T -tcsetsid T -tdelete T -telldir T -tempnam T -tfind T -time T -time2posix T -timegm T -timelocal T -timeoff T -times T -timezone T -tmpfile T -tmpnam T -toascii T -tolower T -toupper T -towctrans T -towlower T -towupper T -truncate W -tsearch T -ttyname T -ttyname_r T -ttyslot T -twalk T -tzname D 16 -tzset T -tzsetwall T -ualarm T -ulimit T -umask W -uname T -ungetc T -ungetwc T -unlink T -unlockpt T -unsetenv T -unvis T -uselocale T -user_from_uid T -usleep W -utimes W -utime W -vasprintf T -vdprintf T -verr T -verrc T -verrx T -vfork W -vfprintf T -vfscanf W -vfwprintf T -vfwscanf T -vis T -vprintf T -vscanf T -vsnprintf T -vsprintf T -vsscanf T -vswprintf T -vswscanf T -vsyslog T -vwarn T -vwarnc T -vwarnx T -vwprintf T -vwscanf T -wait W -wait3 T -waitpid W -warn W -warnc T -warnx T -wcpcpy T -wcpncpy T -wcrtomb T -wcscasecmp T -wcscat T -wcschr T -wcscmp T -wcscoll T -wcscpy T -wcscspn T -wcsdup T -wcsftime T -wcslcat T -wcslcpy T -wcslen T -wcsncasecmp T -wcsncat T -wcsncmp T -wcsncpy T -wcsnlen T -wcsnrtombs T -wcspbrk T -wcsrchr T -wcsrtombs T -wcsspn T -wcsstr T -wcstod T -wcstof T -wcstoimax T -wcstok T -wcstol T -wcstold T -wcstoll T -wcstombs T -wcstoul T -wcstoull T -wcstoumax T -wcswidth T -wcsxfrm T -wctob T -wctomb T -wctrans T -wctype T -wcwidth T -wmemchr T -wmemcmp T -wmemcpy T -wmemmove T -wmemset T -wordexp T -wordfree T -wprintf T -write T -writev T -wscanf T -xsi_sigpause T - - -# -# Symbols needed by libm -# -__mb_sb_limit D 4 -_DefaultRuneLocale D 4224 -_CurrentRuneLocale D 8 -__isinf T - - -# -# Public interface between Genode-component code and the libc runtime -# -_ZN4Libc9Component9constructERNS_3EnvE U -_ZN4Libc9Component10stack_sizeEv W -_ZN4Libc30execute_in_application_contextERNS_16Application_codeE T -_ZN4Libc19Select_handler_base6selectEiR6fd_setS2_S2_ T -_ZN4Libc19Select_handler_baseC1Ev T -_ZN4Libc19Select_handler_baseC2Ev T -_ZN4Libc19Select_handler_baseD1Ev T -_ZN4Libc19Select_handler_baseD2Ev T -_ZN4Libc10resume_allEv T -_ZN4Libc7suspendERNS_15Suspend_functorEm T -_Z16pthread_registryv T -_ZN16Pthread_registry6insertEP7pthread T -_ZN16Pthread_registry6removeEP7pthread T -_ZN16Pthread_registry8containsEP7pthread T -_ZN4Libc14pthread_createEPP7pthreadPFPvS3_ES3_mPKcPN6Genode11Cpu_sessionENS8_8Affinity8LocationE T -_ZN4Libc14pthread_createEPP7pthreadRN6Genode6ThreadE T - -# -# Libc plugin interface -# -_ZN4Libc16schedule_suspendEPFvvE T -_ZN4Libc25File_descriptor_allocator15find_by_libc_fdEi T -_ZN4Libc25File_descriptor_allocator4freeEPNS_15File_descriptorE T -_ZN4Libc25File_descriptor_allocator5allocEPNS_6PluginEPNS_14Plugin_contextEi T -_ZN4Libc25file_descriptor_allocatorEv T -_ZN4Libc6Plugin10getsockoptEPNS_15File_descriptorEiiPvPj T -_ZN4Libc6Plugin10setsockoptEPNS_15File_descriptorEiiPKvj T -_ZN4Libc6Plugin11getpeernameEPNS_15File_descriptorEP8sockaddrPj T -_ZN4Libc6Plugin11getsocknameEPNS_15File_descriptorEP8sockaddrPj T -_ZN4Libc6Plugin13getdirentriesEPNS_15File_descriptorEPcmPx T -_ZN4Libc6Plugin13getdirentriesEPNS_15File_descriptorEPcmPl T -_ZN4Libc6Plugin13supports_mmapEv T -_ZN4Libc6Plugin13supports_openEPKci T -_ZN4Libc6Plugin13supports_pipeEv T -_ZN4Libc6Plugin13supports_pollEv T -_ZN4Libc6Plugin13supports_statEPKc T -_ZN4Libc6Plugin14supports_mkdirEPKct T -_ZN4Libc6Plugin14supports_rmdirEPKc T -_ZN4Libc6Plugin15supports_accessEPKci T -_ZN4Libc6Plugin15supports_execveEPKcPKPcS5_ T -_ZN4Libc6Plugin15supports_renameEPKcS2_ T -_ZN4Libc6Plugin15supports_selectEiP6fd_setS2_S2_P7timeval T -_ZN4Libc6Plugin15supports_socketEiii T -_ZN4Libc6Plugin15supports_unlinkEPKc T -_ZN4Libc6Plugin16supports_symlinkEPKcS2_ T -_ZN4Libc6Plugin17supports_readlinkEPKcPcj T -_ZN4Libc6Plugin17supports_readlinkEPKcPcm T -_ZN4Libc6Plugin3dupEPNS_15File_descriptorE T -_ZN4Libc6Plugin4bindEPNS_15File_descriptorEPK8sockaddrj T -_ZN4Libc6Plugin4dup2EPNS_15File_descriptorES2_ T -_ZN4Libc6Plugin4mmapEPvmiiPNS_15File_descriptorEx T -_ZN4Libc6Plugin4mmapEPvmiiPNS_15File_descriptorEl T -_ZN4Libc6Plugin4openEPKci T -_ZN4Libc6Plugin4pipeEPPNS_15File_descriptorE T -_ZN4Libc6Plugin4pollERNS_15File_descriptorER6pollfd T -_ZN4Libc6Plugin4readEPNS_15File_descriptorEPvj T -_ZN4Libc6Plugin4readEPNS_15File_descriptorEPvm T -_ZN4Libc6Plugin4recvEPNS_15File_descriptorEPvji T -_ZN4Libc6Plugin4recvEPNS_15File_descriptorEPvmi T -_ZN4Libc6Plugin4sendEPNS_15File_descriptorEPKvji T -_ZN4Libc6Plugin4sendEPNS_15File_descriptorEPKvmi T -_ZN4Libc6Plugin4statEPKcP4stat T -_ZN4Libc6Plugin5closeEPNS_15File_descriptorE T -_ZN4Libc6Plugin5fcntlEPNS_15File_descriptorEil T -_ZN4Libc6Plugin5fstatEPNS_15File_descriptorEP4stat T -_ZN4Libc6Plugin5fsyncEPNS_15File_descriptorE T -_ZN4Libc6Plugin5ioctlEPNS_15File_descriptorEiPc T -_ZN4Libc6Plugin5lseekEPNS_15File_descriptorEli T -_ZN4Libc6Plugin5lseekEPNS_15File_descriptorExi T -_ZN4Libc6Plugin5mkdirEPKct T -_ZN4Libc6Plugin5msyncEPvmi T -_ZN4Libc6Plugin5rmdirEPKc T -_ZN4Libc6Plugin5writeEPNS_15File_descriptorEPKvj T -_ZN4Libc6Plugin5writeEPNS_15File_descriptorEPKvm T -_ZN4Libc6Plugin6acceptEPNS_15File_descriptorEP8sockaddrPj T -_ZN4Libc6Plugin6accessEPKci T -_ZN4Libc6Plugin6execveEPKcPKPcS5_ T -_ZN4Libc6Plugin6listenEPNS_15File_descriptorEi T -_ZN4Libc6Plugin6munmapEPvj T -_ZN4Libc6Plugin6munmapEPvm T -_ZN4Libc6Plugin6renameEPKcS2_ T -_ZN4Libc6Plugin6selectEiP6fd_setS2_S2_P7timeval T -_ZN4Libc6Plugin6sendtoEPNS_15File_descriptorEPKvjiPK8sockaddrj T -_ZN4Libc6Plugin6sendtoEPNS_15File_descriptorEPKvmiPK8sockaddrj T -_ZN4Libc6Plugin6socketEiii T -_ZN4Libc6Plugin6unlinkEPKc T -_ZN4Libc6Plugin7connectEPNS_15File_descriptorEPK8sockaddrj T -_ZN4Libc6Plugin7fstatfsEPNS_15File_descriptorEP6statfs T -_ZN4Libc6Plugin7recvmsgEPNS_15File_descriptorEP6msghdri T -_ZN4Libc6Plugin7symlinkEPKcS2_ T -_ZN4Libc6Plugin8priorityEv T -_ZN4Libc6Plugin8readlinkEPKcPcj T -_ZN4Libc6Plugin8readlinkEPKcPcm T -_ZN4Libc6Plugin8recvfromEPNS_15File_descriptorEPvjiP8sockaddrPj T -_ZN4Libc6Plugin8recvfromEPNS_15File_descriptorEPvmiP8sockaddrPj T -_ZN4Libc6Plugin8shutdownEPNS_15File_descriptorEi T -_ZN4Libc6Plugin9ftruncateEPNS_15File_descriptorEl T -_ZN4Libc6Plugin9ftruncateEPNS_15File_descriptorEx T -_ZN4Libc6Plugin10resume_allEv T -_ZN4Libc6PluginC1Ei T -_ZN4Libc6PluginC2Ei T -_ZN4Libc6PluginD0Ev T -_ZN4Libc6PluginD1Ev T -_ZN4Libc6PluginD2Ev T -_ZN4Libc9mem_allocEv T -_ZTIN4Libc6PluginE D 40 diff --git a/toolchain-overlay/libc/log2.patch b/toolchain-overlay/libc/log2.patch deleted file mode 100644 index 950e558..0000000 --- a/toolchain-overlay/libc/log2.patch +++ /dev/null @@ -1,20 +0,0 @@ -- add 'log2()' and 'log2f()' declarations -- this patch is only needed for FreeBSD libc versions < 9 - -+++ src/lib/libc/lib/msun/src/math.h -@@ -204,6 +204,7 @@ - double ldexp(double, int); - double log(double); - double log10(double); -+double log2(double); - double modf(double, double *); /* fundamentally !__pure2 */ - - double pow(double, double); -@@ -317,6 +318,7 @@ - int ilogbf(float) __pure2; - float ldexpf(float, int); - float log10f(float); -+float log2f(float); - float log1pf(float); - float logf(float); - float modff(float, float *); /* fundamentally !__pure2 */ diff --git a/toolchain-overlay/libc/mktime.patch b/toolchain-overlay/libc/mktime.patch deleted file mode 100644 index 0860f3e..0000000 --- a/toolchain-overlay/libc/mktime.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/src/lib/libc/contrib/tzcode/stdtime/localtime.c b/src/lib/libc/contrib/tzcode/stdtime/localtime.c -index 3c66924..05c01ae 100644 ---- src/lib/libc/contrib/tzcode/stdtime/localtime.c -+++ src/lib/libc/contrib/tzcode/stdtime/localtime.c -@@ -1935,6 +1935,10 @@ time2sub(struct tm *const tmp, - lo *= 2; - hi = -(lo + 1); - } -+ -+ lo = TIME_T_MIN; -+ hi = TIME_T_MAX; -+ - for ( ; ; ) { - t = lo / 2 + hi / 2; - if (t < lo) -diff --git a/src/lib/libc/contrib/tzcode/stdtime/private.h b/src/lib/libc/contrib/tzcode/stdtime/private.h -index 354a78b..8300ba0 100644 ---- src/lib/libc/contrib/tzcode/stdtime/private.h -+++ src/lib/libc/contrib/tzcode/stdtime/private.h -@@ -251,6 +251,24 @@ const char * scheck(const char * string, const char * format); - 1 + TYPE_SIGNED(type)) - #endif /* !defined INT_STRLEN_MAXIMUM */ - -+#define TWOS_COMPLEMENT(t) ((t) ~ (t) 0 < 0) -+ -+/* Max and min values of the integer type T, of which only the bottom -+ B bits are used, and where the highest-order used bit is considered -+ to be a sign bit if T is signed. */ -+#define MAXVAL(t, b) \ -+ ((t) (((t) 1 << ((b) - 1 - TYPE_SIGNED(t))) \ -+ - 1 + ((t) 1 << ((b) - 1 - TYPE_SIGNED(t))))) -+#define MINVAL(t, b) \ -+ ((t) (TYPE_SIGNED(t) ? - TWOS_COMPLEMENT(t) - MAXVAL(t, b) : 0)) -+ -+/* The extreme time values, assuming no padding. */ -+#define TIME_T_MIN_NO_PADDING MINVAL(time_t, TYPE_BIT(time_t)) -+#define TIME_T_MAX_NO_PADDING MAXVAL(time_t, TYPE_BIT(time_t)) -+ -+# define TIME_T_MIN TIME_T_MIN_NO_PADDING -+# define TIME_T_MAX TIME_T_MAX_NO_PADDING -+ - /* - ** INITIALIZE(x) - */ diff --git a/toolchain-overlay/libc/printfcommon.patch b/toolchain-overlay/libc/printfcommon.patch deleted file mode 100644 index 301d5af..0000000 --- a/toolchain-overlay/libc/printfcommon.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- src/lib/libc/lib/libc/stdio/printfcommon.h.orig 2019-04-16 12:35:21.549592905 +0200 -+++ src/lib/libc/lib/libc/stdio/printfcommon.h 2019-04-16 12:35:34.163738398 +0200 -@@ -47,9 +47,6 @@ - - #ifndef NO_FLOATING_POINT - --#define dtoa __dtoa --#define freedtoa __freedtoa -- - #include - #include - #include "floatio.h" diff --git a/toolchain-overlay/libc/rcmd.patch b/toolchain-overlay/libc/rcmd.patch deleted file mode 100644 index c69adf2..0000000 --- a/toolchain-overlay/libc/rcmd.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- src/lib/libc/include/unistd.h -+++ src/lib/libc/include/unistd.h -@@ -510,8 +510,6 @@ - int getresuid(uid_t *, uid_t *, uid_t *); - char *getusershell(void); - int initgroups(const char *, gid_t); --int iruserok(unsigned long, int, const char *, const char *); --int iruserok_sa(const void *, int, int, const char *, const char *); - int issetugid(void); - long lpathconf(const char *, int); - #ifndef _MKDTEMP_DECLARED -@@ -533,20 +531,12 @@ - #endif - int nfssvc(int, void *); - int profil(char *, size_t, vm_offset_t, int); --int rcmd(char **, int, const char *, const char *, const char *, int *); --int rcmd_af(char **, int, const char *, -- const char *, const char *, int *, int); --int rcmdsh(char **, int, const char *, -- const char *, const char *, const char *); - char *re_comp(const char *); - int re_exec(const char *); - int reboot(int); - int revoke(const char *); - pid_t rfork(int); - pid_t rfork_thread(int, void *, int (*)(void *), void *); --int rresvport(int *); --int rresvport_af(int *, int); --int ruserok(const char *, int, const char *, const char *); - #if __BSD_VISIBLE - #ifndef _SELECT_DECLARED - #define _SELECT_DECLARED diff --git a/toolchain-overlay/libc/res_init_c.patch b/toolchain-overlay/libc/res_init_c.patch deleted file mode 100644 index 4eb8d7b..0000000 --- a/toolchain-overlay/libc/res_init_c.patch +++ /dev/null @@ -1,125 +0,0 @@ ---- src/lib/libc/lib/libc/resolv/res_init.c.old 2019-05-07 11:26:07.854155106 +0200 -+++ src/lib/libc/lib/libc/resolv/res_init.c 2019-05-07 11:26:18.499341340 +0200 -@@ -93,18 +93,7 @@ - #include - #include - --#ifndef HAVE_MD5 --# include "../dst/md5.h" --#else --# ifdef SOLARIS2 --# include --# elif _LIBC --# include --# endif --#endif --#ifndef _MD5_H_ --# define _MD5_H_ 1 /*%< make sure we do not include rsaref md5.h file */ --#endif -+#include - - #include "un-namespace.h" - -@@ -169,6 +158,10 @@ - return (__res_vinit(statp, 0)); - } - -+ -+extern char const *libc_resolv_path; -+ -+ - /*% This function has to be reachable by res_data.c but not publicly. */ - int - __res_vinit(res_state statp, int preinit) { -@@ -325,7 +318,7 @@ - line[sizeof(name) - 1] == '\t')) - - nserv = 0; -- if ((fp = fopen(_PATH_RESCONF, "re")) != NULL) { -+ if ((fp = fopen(libc_resolv_path, "re")) != NULL) { - struct stat sb; - struct timespec now; - -@@ -339,6 +332,45 @@ - } - - /* read the config file */ -+#if 1 -+ if (fgets(buf, sizeof(buf), fp) != NULL) { -+ /* read nameservers to query */ -+ struct addrinfo hints, *ai; -+ char sbuf[NI_MAXSERV]; -+ const size_t minsiz = sizeof(statp->_u._ext.ext->nsaddrs[0]); -+ -+ cp = buf; -+ cp[strcspn(cp, "\n")] = '\0'; -+ -+ if ((*cp != '\0') && (*cp != '\n')) { -+ -+ memset(&hints, 0, sizeof(hints)); -+ hints.ai_family = PF_UNSPEC; -+ hints.ai_socktype = SOCK_DGRAM; /*dummy*/ -+ hints.ai_flags = AI_NUMERICHOST; -+ sprintf(sbuf, "%u", NAMESERVER_PORT); -+ -+ if (getaddrinfo(cp, sbuf, &hints, &ai) == 0 && -+ ai->ai_addrlen <= minsiz) { -+ if (statp->_u._ext.ext != NULL) { -+ memcpy(&statp->_u._ext.ext->nsaddrs[nserv], -+ ai->ai_addr, ai->ai_addrlen); -+ } -+ -+ if (ai->ai_addrlen <= -+ sizeof(statp->nsaddr_list[nserv])) { -+ memcpy(&statp->nsaddr_list[nserv], -+ ai->ai_addr, ai->ai_addrlen); -+ } else { -+ statp->nsaddr_list[nserv].sin_family = 0; -+ } -+ -+ freeaddrinfo(ai); -+ nserv++; -+ } -+ } -+ } -+#else - while (fgets(buf, sizeof(buf), fp) != NULL) { - /* skip comments */ - if (*buf == ';' || *buf == '#') -@@ -536,6 +568,7 @@ - continue; - } - } -+#endif /* 1 */ - if (nserv > 0) - statp->nscount = nserv; - #ifdef RESOLVSORT -@@ -777,25 +810,9 @@ - - u_int - res_nrandomid(res_state statp) { -- struct timeval now; -- u_int16_t u16; -- MD5_CTX ctx; -- u_char *rnd = statp->_rnd == NULL ? srnd : statp->_rnd; -- -- gettimeofday(&now, NULL); -- u16 = (u_int16_t) (now.tv_sec ^ now.tv_usec); -- memcpy(rnd + 14, &u16, 2); --#ifndef HAVE_MD5 -- MD5_Init(&ctx); -- MD5_Update(&ctx, rnd, 16); -- MD5_Final(rnd, &ctx); --#else -- MD5Init(&ctx); -- MD5Update(&ctx, rnd, 16); -- MD5Final(rnd, &ctx); --#endif -- memcpy(&u16, rnd + 14, 2); -- return ((u_int) u16); -+ u_int val; -+ getrandom(&val, sizeof(val), 0); -+ return val; - } - - /*% diff --git a/toolchain-overlay/libc/runetype.patch b/toolchain-overlay/libc/runetype.patch deleted file mode 100644 index 1e8dbec..0000000 --- a/toolchain-overlay/libc/runetype.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- src/lib/libc/lib/libc/locale/runetype.c.orig 2019-04-18 15:12:08.961502991 +0200 -+++ src/lib/libc/lib/libc/locale/runetype.c 2019-04-18 15:13:44.287945177 +0200 -@@ -82,10 +82,9 @@ - - int ___mb_cur_max(void) - { -- return XLOCALE_CTYPE(__get_locale())->__mb_cur_max; -+ return MB_CUR_MAX; - } - int ___mb_cur_max_l(locale_t locale) - { -- FIX_LOCALE(locale); -- return XLOCALE_CTYPE(locale)->__mb_cur_max; -+ return MB_CUR_MAX; - } diff --git a/toolchain-overlay/libc/semaphore.patch b/toolchain-overlay/libc/semaphore.patch deleted file mode 100644 index 495f080..0000000 --- a/toolchain-overlay/libc/semaphore.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/lib/libc/include/semaphore.h 2019-04-09 14:12:29.619185765 +0200 -+++ src/lib/libc/include/semaphore.h.new 2019-04-09 14:31:35.913650094 +0200 -@@ -46,7 +46,7 @@ - __uint32_t _padding; /* Preserve structure size */ - }; - --typedef struct _sem sem_t; -+typedef struct sem* sem_t; - - #define SEM_FAILED ((sem_t *)0) - #define SEM_VALUE_MAX __INT_MAX diff --git a/toolchain-overlay/libc/thread_local.patch b/toolchain-overlay/libc/thread_local.patch deleted file mode 100644 index 89fa01b..0000000 --- a/toolchain-overlay/libc/thread_local.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- src/lib/libc/sys/sys/cdefs.h.orig 2019-04-16 10:50:14.382883576 +0200 -+++ src/lib/libc/sys/sys/cdefs.h 2019-04-16 10:50:34.008444965 +0200 -@@ -298,20 +298,6 @@ - #endif - #endif - --#if !__has_extension(c_thread_local) --/* -- * XXX: Some compilers (Clang 3.3, GCC 4.7) falsely announce C++11 mode -- * without actually supporting the thread_local keyword. Don't check for -- * the presence of C++11 when defining _Thread_local. -- */ --#if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \ -- __has_extension(cxx_thread_local) --#define _Thread_local thread_local --#else --#define _Thread_local __thread --#endif --#endif -- - #endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */ - - /* diff --git a/toolchain-overlay/libc/types.patch b/toolchain-overlay/libc/types.patch deleted file mode 100644 index e401f6e..0000000 --- a/toolchain-overlay/libc/types.patch +++ /dev/null @@ -1,52 +0,0 @@ -Use the unified size types provided by the Genode tool chain. - -diff --git src/lib/libc/sys/arm/include/_types.h src/lib/libc/sys/arm/include/_types.h -index 3012f97..3ec5a24 100644 ---- src/lib/libc/sys/arm/include/_types.h -+++ src/lib/libc/sys/arm/include/_types.h -@@ -85,11 +85,11 @@ typedef __int8_t __int_least8_t; - typedef __int16_t __int_least16_t; - typedef __int32_t __int_least32_t; - typedef __int64_t __int_least64_t; --typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */ -+typedef __PTRDIFF_TYPE__ __ptrdiff_t; /* ptr1 - ptr2 */ - typedef __int32_t __register_t; - typedef __int32_t __segsz_t; /* segment size (in pages) */ --typedef __uint32_t __size_t; /* sizeof() */ --typedef __int32_t __ssize_t; /* byte count or error */ -+typedef __SIZE_TYPE__ __size_t; /* sizeof() */ -+typedef __PTRDIFF_TYPE__ __ssize_t; /* byte count or error */ - typedef __int64_t __time_t; /* time()... */ - typedef __uint32_t __uintfptr_t; - typedef __uint64_t __uintmax_t; -diff --git src/lib/libc/sys/x86/include/_types.h src/lib/libc/sys/x86/include/_types.h -index 07893c6..abd2ea4 100644 ---- src/lib/libc/sys/x86/include/_types.h -+++ src/lib/libc/sys/x86/include/_types.h -@@ -100,20 +100,20 @@ typedef __int16_t __int_least16_t; - typedef __int32_t __int_least32_t; - typedef __int64_t __int_least64_t; - #ifdef __LP64__ --typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ -+typedef __PTRDIFF_TYPE__ __ptrdiff_t; /* ptr1 - ptr2 */ - typedef __int64_t __register_t; - typedef __int64_t __segsz_t; /* segment size (in pages) */ --typedef __uint64_t __size_t; /* sizeof() */ --typedef __int64_t __ssize_t; /* byte count or error */ -+typedef __SIZE_TYPE__ __size_t; /* sizeof() */ -+typedef __PTRDIFF_TYPE__ __ssize_t; /* byte count or error */ - typedef __int64_t __time_t; /* time()... */ - typedef __uint64_t __uintfptr_t; - typedef __uint64_t __uintptr_t; - #else --typedef __int32_t __ptrdiff_t; -+typedef __PTRDIFF_TYPE__ __ptrdiff_t; - typedef __int32_t __register_t; - typedef __int32_t __segsz_t; --typedef __uint32_t __size_t; --typedef __int32_t __ssize_t; -+typedef __SIZE_TYPE__ __size_t; -+typedef __PTRDIFF_TYPE__ __ssize_t; - typedef __int32_t __time_t; - typedef __uint32_t __uintfptr_t; - typedef __uint32_t __uintptr_t; diff --git a/toolchain-overlay/libc/vfwprintf_c_warn.patch b/toolchain-overlay/libc/vfwprintf_c_warn.patch deleted file mode 100644 index 0fd446a..0000000 --- a/toolchain-overlay/libc/vfwprintf_c_warn.patch +++ /dev/null @@ -1,31 +0,0 @@ -+++ src/lib/libc/lib/libc/stdio/vfwprintf.c -@@ -838,10 +838,10 @@ - sign = '-'; - if (expt == INT_MAX) { /* inf or nan */ - if (*cp == 'N') { -- cp = (ch >= 'a') ? L"nan" : L"NAN"; -+ cp = (wchar_t *)((ch >= 'a') ? L"nan" : L"NAN"); - sign = '\0'; - } else -- cp = (ch >= 'a') ? L"inf" : L"INF"; -+ cp = (wchar_t *)((ch >= 'a') ? L"inf" : L"INF"); - size = 3; - flags &= ~ZEROPAD; - break; -@@ -953,14 +953,14 @@ - case 's': - if (flags & LONGINT) { - if ((cp = GETARG(wchar_t *)) == NULL) -- cp = L"(null)"; -+ cp = (wchar_t *)(L"(null)"); - } else { - char *mbp; - - if (convbuf != NULL) - free(convbuf); - if ((mbp = GETARG(char *)) == NULL) -- cp = L"(null)"; -+ cp = (wchar_t *)(L"(null)"); - else { - convbuf = __mbsconv(mbp, prec); - if (convbuf == NULL) { diff --git a/toolchain-overlay/libc/xlocale.patch b/toolchain-overlay/libc/xlocale.patch deleted file mode 100644 index 9753875..0000000 --- a/toolchain-overlay/libc/xlocale.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- src/lib/libc/lib/libc/locale/setrunelocale.c -+++ src/lib/libc/lib/libc/locale/setrunelocale.c -@@ -60,7 +60,7 @@ extern _RuneLocale const *_CurrentRuneLocale; - /* - * A cached version of the runes for this thread. Used by ctype.h - */ --_Thread_local const _RuneLocale *_ThreadRuneLocale; -+const _RuneLocale *_ThreadRuneLocale; - #endif - - extern int __mb_sb_limit; - ---- src/lib/libc/lib/libc/locale/xlocale.c -+++ src/lib/libc/lib/libc/locale/xlocale.c -@@ -59,7 +59,7 @@ extern struct xlocale_component __xlocale_C_ctype; - /* - * The locale for this thread. - */ --_Thread_local locale_t __thread_locale; -+locale_t __thread_locale; - #endif - /* - * Flag indicating that one or more per-thread locales exist. - ---- src/lib/libc/lib/libc/locale/xlocale_private.h -+++ src/lib/libc/lib/libc/locale/xlocale_private.h -@@ -213,7 +213,7 @@ extern int __has_thread_locale; - * The per-thread locale. Avoids the need to use pthread lookup functions when - * getting the per-thread locale. - */ --extern _Thread_local locale_t __thread_locale; -+extern locale_t __thread_locale; - - /** - * Returns the current locale for this thread, or the global locale if none is diff --git a/toolchain-overlay/libc/xlocale_private.patch b/toolchain-overlay/libc/xlocale_private.patch deleted file mode 100644 index b355704..0000000 --- a/toolchain-overlay/libc/xlocale_private.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- src/lib/libc/lib/libc/locale/xlocale_private.h.orig 2019-04-18 14:31:34.331373088 +0200 -+++ src/lib/libc/lib/libc/locale/xlocale_private.h 2019-04-18 14:31:57.418620988 +0200 -@@ -166,24 +166,16 @@ - __attribute__((unused)) static void* - xlocale_retain(void *val) - { -- struct xlocale_refcounted *obj = val; -- atomic_add_long(&(obj->retain_count), 1); - return (val); - } -+ - /** - * Decrements the reference count of a reference-counted structure, freeing it - * if this is the last reference, calling its destructor if it has one. - */ - __attribute__((unused)) static void - xlocale_release(void *val) --{ -- struct xlocale_refcounted *obj = val; -- long count; -- -- count = atomic_fetchadd_long(&(obj->retain_count), -1) - 1; -- if (count < 0 && obj->destructor != NULL) -- obj->destructor(obj); --} -+{ } - - /** - * Load functions. Each takes the name of a locale and a pointer to the data -@@ -223,27 +215,15 @@ - */ - static inline locale_t __get_locale(void) - { -- -- if (!__has_thread_locale) { -- return (&__xlocale_global_locale); -- } -- return (__thread_locale ? __thread_locale : &__xlocale_global_locale); -+ return (&__xlocale_global_locale); - } - #else - locale_t __get_locale(void); - #endif - --/** -- * Two magic values are allowed for locale_t objects. NULL and -1. This -- * function maps those to the real locales that they represent. -- */ - static inline locale_t get_real_locale(locale_t locale) - { -- switch ((intptr_t)locale) { -- case 0: return (&__xlocale_C_locale); -- case -1: return (&__xlocale_global_locale); -- default: return (locale); -- } -+ return &__xlocale_global_locale; - } - - /** diff --git a/toolchain-overlay/libc/xprintf_float.patch b/toolchain-overlay/libc/xprintf_float.patch deleted file mode 100644 index f44cb7a..0000000 --- a/toolchain-overlay/libc/xprintf_float.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- src/lib/libc/lib/libc/stdio/xprintf_float.c.orig 2019-04-16 12:34:20.167688219 +0200 -+++ src/lib/libc/lib/libc/stdio/xprintf_float.c 2019-04-16 12:34:01.986830677 +0200 -@@ -42,9 +42,6 @@ - #include - #include - --#define dtoa __dtoa --#define freedtoa __freedtoa -- - #include - #include - #include "gdtoa.h" From 2a8398984e3d6504b1475bbb687100c4406043a3 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 11 Nov 2019 21:41:37 +0100 Subject: [PATCH 12/20] Add libc to flake --- flake.nix | 6 +++++- packages.nix | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 763179e..9fb1569 100644 --- a/flake.nix +++ b/flake.nix @@ -17,11 +17,15 @@ in { - lib = import ./lib { genodepkgs = self; inherit nixpkgs dhall-haskell genode-depot; }; + lib = import ./lib { + genodepkgs = self; + inherit nixpkgs dhall-haskell genode-depot; + }; packages = forAllSystems (system: import ./packages.nix { inherit system nixpkgs; + depot = builtins.getAttr system genode-depot.packages; }); checks = forAllSystems (system: diff --git a/packages.nix b/packages.nix index f675b4d..3d2f6a5 100644 --- a/packages.nix +++ b/packages.nix @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 -{ system, nixpkgs }: +{ system, nixpkgs, depot }: let toolchainOverlay = import ./toolchain-overlay; @@ -13,7 +13,6 @@ let inherit (super) callPackage; genode = (callPackage ./upstream { } // { - libc = callPackage ./pkgs/libc { }; nic_bus = callPackage ./pkgs/nic_bus { }; }); dhallPackages = super.dhallPackages // (callPackage ./dhall { }); @@ -23,6 +22,7 @@ in rec { genode-base-linux = genode.base-linux; genode-base-nova = genode.base-nova; genode-os = genode.os; + libc = callPackage ./pkgs/libc { inherit depot; }; dhallGenode = dhallPackages.genode; dhallPrelude = dhallPackages.prelude; From 4d96688e0b6a866844e936e92410c38be8601e88 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 12 Nov 2019 21:05:25 +0100 Subject: [PATCH 13/20] Add stdcxx package --- packages.nix | 1 + pkgs/stdcxx/default.nix | 26 ++++++++++++++++++++++++++ pkgs/stdcxx/stdcxx.pc | 5 +++++ 3 files changed, 32 insertions(+) create mode 100644 pkgs/stdcxx/default.nix create mode 100644 pkgs/stdcxx/stdcxx.pc diff --git a/packages.nix b/packages.nix index 3d2f6a5..ae7aee7 100644 --- a/packages.nix +++ b/packages.nix @@ -23,6 +23,7 @@ in rec { genode-base-nova = genode.base-nova; genode-os = genode.os; libc = callPackage ./pkgs/libc { inherit depot; }; + stdcxx = callPackage ./pkgs/stdcxx { inherit depot; }; dhallGenode = dhallPackages.genode; dhallPrelude = dhallPackages.prelude; diff --git a/pkgs/stdcxx/default.nix b/pkgs/stdcxx/default.nix new file mode 100644 index 0000000..937a647 --- /dev/null +++ b/pkgs/stdcxx/default.nix @@ -0,0 +1,26 @@ +# SPDX-FileCopyrightText: Emery Hemingway +# +# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 + +{ stdenvNoCC, llvmPackages }: + +let + stdenv = stdenvNoCC; + inherit (llvmPackages) libcxx; +in stdenv.mkDerivation rec { + pname = "stdcxx"; + inherit (libcxx) version meta; + + buildInputs = [ libcxx ]; + + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + + installPhase = '' + cflags=$NIX_CXXSTDLIB_COMPILE \ + substituteAll ${./stdcxx.pc} ${pname}.pc + mkdir -p $out/lib/pkgconfig + install -Dm444 *.pc $out/lib/pkgconfig + ''; +} diff --git a/pkgs/stdcxx/stdcxx.pc b/pkgs/stdcxx/stdcxx.pc new file mode 100644 index 0000000..e2d0ca2 --- /dev/null +++ b/pkgs/stdcxx/stdcxx.pc @@ -0,0 +1,5 @@ +Name: stdcxx +Description: Genode Standard C++ library +Version: @version@ +Requires: libc libm +Cflags: @cflags@ From c3f716aafc036da88057c39dfc194335340a893e Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Fri, 15 Nov 2019 08:26:22 +0100 Subject: [PATCH 14/20] Use LLVM C++ standard library --- packages.nix | 2 +- pkgs/stdcxx/default.nix | 4 ++-- pkgs/stdcxx/stdcxx.pc | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages.nix b/packages.nix index ae7aee7..37a60b3 100644 --- a/packages.nix +++ b/packages.nix @@ -23,7 +23,7 @@ in rec { genode-base-nova = genode.base-nova; genode-os = genode.os; libc = callPackage ./pkgs/libc { inherit depot; }; - stdcxx = callPackage ./pkgs/stdcxx { inherit depot; }; + stdcxx = callPackage ./pkgs/stdcxx { }; dhallGenode = dhallPackages.genode; dhallPrelude = dhallPackages.prelude; diff --git a/pkgs/stdcxx/default.nix b/pkgs/stdcxx/default.nix index 937a647..f64c241 100644 --- a/pkgs/stdcxx/default.nix +++ b/pkgs/stdcxx/default.nix @@ -18,8 +18,8 @@ in stdenv.mkDerivation rec { dontBuild = true; installPhase = '' - cflags=$NIX_CXXSTDLIB_COMPILE \ - substituteAll ${./stdcxx.pc} ${pname}.pc + cflags=$NIX_CXXSTDLIB_COMPILE libs=$NIX_CXXSTDLIB_LINK \ + substituteAll ${./stdcxx.pc} ${pname}.pc mkdir -p $out/lib/pkgconfig install -Dm444 *.pc $out/lib/pkgconfig ''; diff --git a/pkgs/stdcxx/stdcxx.pc b/pkgs/stdcxx/stdcxx.pc index e2d0ca2..1329cd3 100644 --- a/pkgs/stdcxx/stdcxx.pc +++ b/pkgs/stdcxx/stdcxx.pc @@ -3,3 +3,4 @@ Description: Genode Standard C++ library Version: @version@ Requires: libc libm Cflags: @cflags@ +Libs: @libs@ From 206b86a5ae91daacb4d58a13fe8f095665898115 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Fri, 15 Nov 2019 08:59:46 +0100 Subject: [PATCH 15/20] Flatten upstream source --- upstream/default.nix | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/upstream/default.nix b/upstream/default.nix index b307f0c..db1b143 100644 --- a/upstream/default.nix +++ b/upstream/default.nix @@ -18,8 +18,7 @@ let ++ lib.optional isx86_32 "x86_32" ++ lib.optional isx86_64 "x86_64"; - buildRepo = repo: - + buildRepo = { repo, repoInputs }: let tupArch = with stdenv.targetPlatform; if isAarch32 then "arm" else @@ -40,13 +39,18 @@ let src = fetchgit { url = "https://git.sr.ht/~ehmry/genode"; - rev = "1dc25293b84fb3aed880bb4315adc7ce321c6343"; - sha256 = "1jqbc1i4hwi6aai728mz8wmbcpm864v2mlkyg36lm118b7cpp493"; + rev = "c6c7870a2956e8120bf5333a8588e5603540b136"; + sha256 = "0xw0dhybjgj5y2cyw06i9hmjkn6ryl7pjrx5r9b3f659yn195f5q"; fetchSubmodules = false; }; setupHook = ./../tool/setup-hooks.sh; + nativeBuildInputs = repoInputs; + # This is wrong, why does pkg-config not collect buildInputs? + + propagatedNativeBuildInputs = repoInputs; + depsBuildBuild = with buildPackages; [ llvm pkgconfig tup ]; tupConfig = toTupConfig { @@ -135,11 +139,23 @@ let }; in rec { - base = buildRepo "base"; - base-linux = (buildRepo "base-linux").overrideAttrs - (attrs: { nativeBuildInputs = [ base ]; }); - base-nova = (buildRepo "base-nova").overrideAttrs - (attrs: { nativeBuildInputs = [ base ]; }); - os = - (buildRepo "os").overrideAttrs (attrs: { nativeBuildInputs = [ base ]; }); + base = buildRepo { + repo = "base"; + repoInputs = [ ]; + }; + + base-linux = buildRepo { + repo = "base-linux"; + repoInputs = [ base ]; + }; + + base-nova = buildRepo { + repo = "base-nova"; + repoInputs = [ base ]; + }; + + os = buildRepo { + repo = "os"; + repoInputs = [ base ]; + }; } From 0263e06fbea13631a176b0cec87ebd56300717ce Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 19 Nov 2019 16:31:11 +0100 Subject: [PATCH 16/20] stdcxx: do not pass -stdlib=libc++ to the linker --- pkgs/stdcxx/default.nix | 4 ++-- pkgs/stdcxx/stdcxx.pc | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/stdcxx/default.nix b/pkgs/stdcxx/default.nix index f64c241..937a647 100644 --- a/pkgs/stdcxx/default.nix +++ b/pkgs/stdcxx/default.nix @@ -18,8 +18,8 @@ in stdenv.mkDerivation rec { dontBuild = true; installPhase = '' - cflags=$NIX_CXXSTDLIB_COMPILE libs=$NIX_CXXSTDLIB_LINK \ - substituteAll ${./stdcxx.pc} ${pname}.pc + cflags=$NIX_CXXSTDLIB_COMPILE \ + substituteAll ${./stdcxx.pc} ${pname}.pc mkdir -p $out/lib/pkgconfig install -Dm444 *.pc $out/lib/pkgconfig ''; diff --git a/pkgs/stdcxx/stdcxx.pc b/pkgs/stdcxx/stdcxx.pc index 1329cd3..e2d0ca2 100644 --- a/pkgs/stdcxx/stdcxx.pc +++ b/pkgs/stdcxx/stdcxx.pc @@ -3,4 +3,3 @@ Description: Genode Standard C++ library Version: @version@ Requires: libc libm Cflags: @cflags@ -Libs: @libs@ From 41d52bbd351d254c632d57c67472f22441eff3d4 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Wed, 20 Nov 2019 10:51:18 +0100 Subject: [PATCH 17/20] Do not link to the fullpaths of libc and libm --- pkgs/libc/libc.pc | 2 +- pkgs/libc/libm.pc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/libc/libc.pc b/pkgs/libc/libc.pc index 439bade..d6dd745 100644 --- a/pkgs/libc/libc.pc +++ b/pkgs/libc/libc.pc @@ -6,4 +6,4 @@ URL: https://genode.org/ Version: @version@ Requires: vfs Cflags: -D__FreeBSD__=8 -D__ISO_C_VISIBLE=1999 -fno-builtin-sin -fno-builtin-cos -fno-builtin-sinf -fno-builtin-cosf -Libs: ${libdir}/libc.lib.so +Libs: -L${libdir} -l:libc.lib.so diff --git a/pkgs/libc/libm.pc b/pkgs/libc/libm.pc index 2140811..78e41ba 100644 --- a/pkgs/libc/libm.pc +++ b/pkgs/libc/libm.pc @@ -5,4 +5,4 @@ Description: Genode math library URL: https://genode.org/ Version: @version@ Requires: libc -Libs: ${libdir}/libm.lib.so +Libs: -L${libdir} -l:libm.lib.so From 15360a0ff52f9f226606eab6ffae54984d5b773c Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 19 Nov 2019 16:36:52 +0100 Subject: [PATCH 18/20] Move upstream build to external flake --- flake.lock | 29 +++++-- flake.nix | 14 ++-- lib/default.nix | 6 +- packages.nix | 13 +--- pkgs/nic_bus/default.nix | 6 +- pkgs/solo5/default.nix | 4 +- tests/driver-linux.nix | 6 +- tests/fs_report.nix | 10 +-- tests/libc.nix | 2 +- tests/log.nix | 2 +- tests/pci.nix | 8 +- tests/signal.nix | 2 +- upstream/default.nix | 161 --------------------------------------- 13 files changed, 56 insertions(+), 207 deletions(-) delete mode 100644 upstream/default.nix diff --git a/flake.lock b/flake.lock index 67d745d..0365841 100644 --- a/flake.lock +++ b/flake.lock @@ -19,24 +19,37 @@ "originalUrl": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake", "url": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake&rev=256810cd5adf1ae5862eed0ffdaab4cf49f6fe67" }, + "genode": { + "inputs": { + "nixpkgs": { + "inputs": {}, + "narHash": "sha256-HYX9rCn1dweN+L3ecNy4BiCGw4WEt1zgdIiAeYNY5GM=", + "originalUrl": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode", + "url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode&rev=12e31ac07c6d337760b3f59dc64c03f26cdd2009" + } + }, + "narHash": "sha256-9/RR/CwvB1M2VSR7CrSVexYXN1YSSSE4WG4siDh0LE0=", + "originalUrl": "git+https://gitea.c3d2.de/ehmry/genode.git", + "url": "git+https://gitea.c3d2.de/ehmry/genode.git?ref=master&rev=2a9178fced42cac986de07b6944afd4422d28976" + }, "genode-depot": { "inputs": { "nixpkgs": { "inputs": {}, - "narHash": "sha256-Y5ZOTgInrYYoas3vM8uTPLA2DvFI9YoI6haftIKl9go=", + "narHash": "sha256-HYX9rCn1dweN+L3ecNy4BiCGw4WEt1zgdIiAeYNY5GM=", "originalUrl": "nixpkgs", - "url": "github:edolstra/nixpkgs/015c9ec3372e328ea6742b409a1e9aa26dab2b31" + "url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode&rev=12e31ac07c6d337760b3f59dc64c03f26cdd2009" } }, - "narHash": "sha256-bCKZSw8cBTJf5EPSXzuKPTaM8EAFXez27BCMZn+rUk0=", - "originalUrl": "genode-depot", - "url": "git+file:///home/repo/genode-depot?ref=master&rev=b9119fccb3114829900ae75886d3b5edb54bbd7f" + "narHash": "sha256-be9whulZ8unz1sq9PiFr+tuUAXlwiPEhIe0Z6jmfZiU=", + "originalUrl": "git+https://gitea.c3d2.de/ehmry/genode-depot.git", + "url": "git+https://gitea.c3d2.de/ehmry/genode-depot.git?ref=master&rev=2f3162d88220bd6fa6b6fbc7c6d9fed68533a761" }, "nixpkgs": { "inputs": {}, - "narHash": "sha256-1bzVtI5qk3bFvAnf4ww3R4grNymC4EdZZsRncuKe/gQ=", - "originalUrl": "git+file:///home/repo/nixpkgs?ref=genode", - "url": "git+file:///home/repo/nixpkgs?ref=genode&rev=52db5235aa35b4e334a7187ba18517cb5dc6410d" + "narHash": "sha256-HYX9rCn1dweN+L3ecNy4BiCGw4WEt1zgdIiAeYNY5GM=", + "originalUrl": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode", + "url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode&rev=12e31ac07c6d337760b3f59dc64c03f26cdd2009" } }, "version": 3 diff --git a/flake.nix b/flake.nix index 9fb1569..f88abae 100644 --- a/flake.nix +++ b/flake.nix @@ -4,12 +4,14 @@ description = "Genode packages"; inputs = { - nixpkgs.uri = "git+file:///home/repo/nixpkgs?ref=genode"; dhall-haskell.uri = "git+https://github.com/dhall-lang/dhall-haskell?ref=flake"; + genode-depot.uri = "git+https://gitea.c3d2.de/ehmry/genode-depot.git"; + genode.uri = "git+https://gitea.c3d2.de/ehmry/genode.git"; + nixpkgs.uri = "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode"; }; - outputs = { self, nixpkgs, dhall-haskell, genode-depot }: + outputs = { self, dhall-haskell, genode-depot, genode, nixpkgs }: let systems = [ "x86_64-genode" ]; @@ -23,10 +25,12 @@ }; packages = forAllSystems (system: - import ./packages.nix { + let thisSystem = builtins.getAttr system; + in import ./packages.nix { inherit system nixpkgs; - depot = builtins.getAttr system genode-depot.packages; - }); + depot = thisSystem genode-depot.packages; + genode = thisSystem genode.packages; + } // builtins.getAttr system genode.packages); checks = forAllSystems (system: import ./tests { diff --git a/lib/default.nix b/lib/default.nix index 16708f7..4df4384 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -41,12 +41,12 @@ in { let inherit (hostPkgs) cdrkit syslinux; - coreNovaObj = "${testPkgs.genode-base-nova}/lib/core-nova.o"; + coreNovaObj = "${testPkgs.base-nova}/lib/core-nova.o"; rom' = (with testPkgs; { - init = "${genode-os}/bin/init"; + init = "${os}/bin/init"; "ld.lib.so" = "${depot.base-nova}/lib/ld.lib.so"; - timer = "${genode-base-nova}/bin/nova_timer_drv"; + timer = "${base-nova}/bin/nova_timer_drv"; }) // rom; addressType = ".quad"; # TODO: 32bit?! diff --git a/packages.nix b/packages.nix index 37a60b3..2004720 100644 --- a/packages.nix +++ b/packages.nix @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 -{ system, nixpkgs, depot }: +{ system, nixpkgs, depot, genode }: let toolchainOverlay = import ./toolchain-overlay; @@ -12,21 +12,14 @@ let inherit (super) callPackage; - genode = (callPackage ./upstream { } // { - nic_bus = callPackage ./pkgs/nic_bus { }; - }); dhallPackages = super.dhallPackages // (callPackage ./dhall { }); in rec { inherit (super) stdenv; - genode-base = genode.base; - genode-base-linux = genode.base-linux; - genode-base-nova = genode.base-nova; - genode-os = genode.os; libc = callPackage ./pkgs/libc { inherit depot; }; stdcxx = callPackage ./pkgs/stdcxx { }; - + nic_bus = callPackage ./pkgs/nic_bus { inherit (genode) base os; }; dhallGenode = dhallPackages.genode; dhallPrelude = dhallPackages.prelude; nova = callPackage ./NOVA { }; - solo5 = callPackage ./pkgs/solo5 { inherit genode-base genode-os; }; + solo5 = callPackage ./pkgs/solo5 { inherit (genode) base os; }; } diff --git a/pkgs/nic_bus/default.nix b/pkgs/nic_bus/default.nix index 7bc21cd..c59168a 100644 --- a/pkgs/nic_bus/default.nix +++ b/pkgs/nic_bus/default.nix @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 -{ stdenv, buildPackages, fetchgit, genode, pkgconfig, tup }: +{ stdenv, buildPackages, fetchgit, base, os, pkgconfig, tup }: let tupArch = with stdenv.targetPlatform; @@ -28,7 +28,7 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig tup ]; - buildInputs = [ genode.base genode.os ]; + buildInputs = [ base os ]; tupConfig = toTupConfig { TUP_ARCH = tupArch; @@ -36,7 +36,7 @@ in stdenv.mkDerivation rec { }; configurePhase = '' - cp -v ${genode.base.src}/Tuprules.tup . + cp -v ${base.src}/Tuprules.tup . # Configure Tup echo $tupConfig | tr ' CONFIG_' '\nCONFIG_' > tup.config diff --git a/pkgs/solo5/default.nix b/pkgs/solo5/default.nix index c8e328b..37f78cf 100644 --- a/pkgs/solo5/default.nix +++ b/pkgs/solo5/default.nix @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 -{ stdenv, buildPackages, fetchurl, llvmPackages, pkgconfig, genode-base, genode-os }: +{ stdenv, buildPackages, fetchurl, llvmPackages, pkgconfig, base, os }: let version = "0.6.3"; in stdenv.mkDerivation { @@ -13,7 +13,7 @@ in stdenv.mkDerivation { nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ genode-base.dev genode-os.dev ]; + buildInputs = [ base.dev os.dev ]; src = fetchurl { url = "https://github.com/Solo5/solo5/releases/download/v${version}/solo5-v${version}.tar.gz"; diff --git a/tests/driver-linux.nix b/tests/driver-linux.nix index 8bfaa9c..6aa682c 100644 --- a/tests/driver-linux.nix +++ b/tests/driver-linux.nix @@ -42,10 +42,10 @@ let bootModules' = { inherit testConfig; config = ./driver-config.xml; - core = "${genode-base-linux}/bin/core-linux"; - init = "${genode-os}/bin/init"; + core = "${base-linux}/bin/core-linux"; + init = "${os}/bin/init"; "ld.lib.so" = "${depot.base-linux}/lib/ld.lib.so"; - timer = "${genode-base-linux}/bin/linux_timer_drv"; + timer = "${base-linux}/bin/linux_timer_drv"; } // bootModules; baseSetup = with builtins; diff --git a/tests/fs_report.nix b/tests/fs_report.nix index b4f6a5b..d1a31ba 100644 --- a/tests/fs_report.nix +++ b/tests/fs_report.nix @@ -8,11 +8,11 @@ testEnv.mkTest { testConfig = ./fs_report.xml; bootModules = { - fs_report = "${genode-os}/bin/fs_report"; - fs_rom = "${genode-os}/bin/fs_rom"; - ram_fs = "${genode-os}/bin/ram_fs"; - test-fs_report = "${genode-os}/bin/test-fs_report"; - "vfs.lib.so" = "${genode-os}/lib/vfs.lib.so"; + fs_report = "${os}/bin/fs_report"; + fs_rom = "${os}/bin/fs_rom"; + ram_fs = "${os}/bin/ram_fs"; + test-fs_report = "${os}/bin/test-fs_report"; + "vfs.lib.so" = "${os}/lib/vfs.lib.so"; }; testScript = '' diff --git a/tests/libc.nix b/tests/libc.nix index d7a6f2c..fef28b5 100644 --- a/tests/libc.nix +++ b/tests/libc.nix @@ -12,7 +12,7 @@ testEnv.mkTest rec { "libm.lib.so" = "${depot.libc}/lib/libm.lib.so"; "posix.lib.so" = "${depot.posix}/lib/posix.lib.so"; "test-libc" = "${depot.test-libc}/bin/test-libc"; - "vfs.lib.so" = "${genode-os}/lib/vfs.lib.so"; + "vfs.lib.so" = "${os}/lib/vfs.lib.so"; }; qemuMem = 384; diff --git a/tests/log.nix b/tests/log.nix index ead29cc..1ef6fed 100644 --- a/tests/log.nix +++ b/tests/log.nix @@ -7,7 +7,7 @@ testEnv.mkTest rec { testConfig = testEnv.lib.renderDhallInit ./log.dhall "{=}"; - bootModules.test-log = "${genode-base}/bin/test-log"; + bootModules.test-log = "${base}/bin/test-log"; testScript = "run_genode_until {Test done.} 10"; } diff --git a/tests/pci.nix b/tests/pci.nix index 5bf7bb9..19afc6e 100644 --- a/tests/pci.nix +++ b/tests/pci.nix @@ -8,10 +8,10 @@ testEnv.mkTest { testConfig = testEnv.lib.renderDhallInit ./pci.dhall "{=}"; bootModules = { - acpi_drv = "${genode-os}/bin/acpi_drv"; - platform_drv = "${genode-os}/bin/platform_drv"; - report_rom = "${genode-os}/bin/report_rom"; - test-pci = "${genode-os}/bin/test-pci"; + acpi_drv = "${os}/bin/acpi_drv"; + platform_drv = "${os}/bin/platform_drv"; + report_rom = "${os}/bin/report_rom"; + test-pci = "${os}/bin/test-pci"; }; testScript = '' diff --git a/tests/signal.nix b/tests/signal.nix index 259126c..12fa1dc 100644 --- a/tests/signal.nix +++ b/tests/signal.nix @@ -7,7 +7,7 @@ testEnv.mkTest rec { testConfig = testEnv.lib.renderDhallInit ./signal.dhall "{=}"; - bootModules.test-signal = "${genode-os}/bin/test-signal"; + bootModules.test-signal = "${os}/bin/test-signal"; testScript = "run_genode_until {--- Signalling test finished ---} 120"; } diff --git a/upstream/default.nix b/upstream/default.nix deleted file mode 100644 index db1b143..0000000 --- a/upstream/default.nix +++ /dev/null @@ -1,161 +0,0 @@ -# SPDX-FileCopyrightText: Emery Hemingway -# -# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 - -{ stdenv, buildPackages, fetchgit, llvmPackages }: - -let - version = "19.08-64-g69eb762e4a"; - - inherit (stdenv) lib targetPlatform; - specs = with targetPlatform; [] - ++ lib.optional is32bit "32bit" - ++ lib.optional is64bit "64bit" - ++ lib.optional isAarch32 "arm" - ++ lib.optional isAarch64 "arm_64" - ++ lib.optional isRiscV "riscv" - ++ lib.optional isx86 "x86" - ++ lib.optional isx86_32 "x86_32" - ++ lib.optional isx86_64 "x86_64"; - - buildRepo = { repo, repoInputs }: - let - tupArch = with stdenv.targetPlatform; - if isAarch32 then "arm" else - if isAarch64 then "arm64" else - if isx86_32 then "i386" else - if isx86_64 then "x86_64" else - abort "unhandled targetPlatform"; - - toTupConfig = attrs: - with builtins; - let op = config: name: "${config}CONFIG_${name}=${getAttr name attrs} "; - in foldl' op "" (attrNames attrs); - - in stdenv.mkDerivation { - name = "genode-${repo}-${version}"; - outputs = [ "out" "dev" ]; - inherit repo specs version; - - src = fetchgit { - url = "https://git.sr.ht/~ehmry/genode"; - rev = "c6c7870a2956e8120bf5333a8588e5603540b136"; - sha256 = "0xw0dhybjgj5y2cyw06i9hmjkn6ryl7pjrx5r9b3f659yn195f5q"; - fetchSubmodules = false; - }; - - setupHook = ./../tool/setup-hooks.sh; - - nativeBuildInputs = repoInputs; - # This is wrong, why does pkg-config not collect buildInputs? - - propagatedNativeBuildInputs = repoInputs; - - depsBuildBuild = with buildPackages; [ llvm pkgconfig tup ]; - - tupConfig = toTupConfig { - LIBCXX = llvmPackages.libcxx; - LIBCXXABI = llvmPackages.libcxxabi; - LIBUNWIND = llvmPackages.libunwind; - LIBUNWIND_BAREMETAL = - llvmPackages.libunwind.override { isBaremetal = true; }; - LINUX_HEADERS = buildPackages.glibc.dev; - OLEVEL = "-O2"; - TUP_ARCH = tupArch; - VERSION = version; - }; - - configurePhase = '' - # Configure Tup - echo $tupConfig | tr ' CONFIG_' '\nCONFIG_' > tup.config - echo CONFIG_NIX_OUTPUTS_OUT=$out >> tup.config - echo CONFIG_NIX_OUTPUTS_DEV=$dev >> tup.config - - # Disable other repos - for R in repos/*; do - [ "$R" != "repos/$repo" ] && find $R -name Tupfile -delete - done - find repos/gems -name Tupfile -delete - - # Scan repository and generate script - tup init - tup generate buildPhase.sh - - # Redirect artifacts to Nix store - mkdir -p $out $dev/include - ln -s $out out - ln -s $dev dev - ''; - - buildPhase = '' - test -d repos/$repo/src/ld && cp -rv repos/$repo/src/ld $dev/ - pushd . - set -v - source buildPhase.sh - set +v - popd - ''; - - installPhase = '' - # Populate the "dev" headers - if [ -d "repos/$repo/include" ]; then - for DIR in repos/$repo/include; do - for SPEC in $specs; do - if [ -d $DIR/spec/$SPEC ]; then - cp -r $DIR/spec/$SPEC/* $dev/include - rm -r $DIR/spec/$SPEC - fi - done - rm -rf $DIR/spec - cp -r $DIR $dev/ - done - fi - - touch $dev/.genode - for pc in $dev/lib/pkgconfig/*.pc; do - sed -i "s|-l:|$dev/lib/|g" $pc - done - ''; - - meta = with stdenv.lib; { - description = - "The Genode operation system framework (${repo} repository)."; - homepage = "https://genode.org/"; - license = licenses.agpl3; - maintainers = [ maintainers.ehmry ]; - }; - - shellHook = '' - export PROMPT_DIRTRIM=2 - export PS1="\[\033[1;30m\]Genode-dev [\[\033[1;37m\]\w\[\033[1;30m\]] $\[\033[0m\] " - export PS2="\[\033[1;30m\]>\[\033[0m\] " - if [ -e "configs/.gitignore" ]; then - local CFG_PATH=configs/${targetPlatform.config}.config - echo $tupConfig | tr ' CONFIG_' '\nCONFIG_' > $CFG_PATH - echo "Tup configuration placed at $CFG_PATH, to activate run the following command:" - echo " tup variant $CFG_PATH" - fi - ''; - }; - -in rec { - base = buildRepo { - repo = "base"; - repoInputs = [ ]; - }; - - base-linux = buildRepo { - repo = "base-linux"; - repoInputs = [ base ]; - }; - - base-nova = buildRepo { - repo = "base-nova"; - repoInputs = [ base ]; - }; - - os = buildRepo { - repo = "os"; - repoInputs = [ base ]; - }; -} From 53a18acd0826499ff644775dce16b660a6583101 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 2 Dec 2019 16:39:52 +0100 Subject: [PATCH 19/20] Use cross-compliation pairs in Flake --- flake.lock | 22 +++++++++++----------- flake.nix | 41 +++++++++++++++++++++++++---------------- lib/default.nix | 11 ++++++----- packages.nix | 6 +++--- tests/default.nix | 10 ++++------ tests/driver-linux.nix | 2 +- tests/driver-nova.nix | 4 ++-- 7 files changed, 52 insertions(+), 44 deletions(-) diff --git a/flake.lock b/flake.lock index 0365841..5cd33a6 100644 --- a/flake.lock +++ b/flake.lock @@ -23,33 +23,33 @@ "inputs": { "nixpkgs": { "inputs": {}, - "narHash": "sha256-HYX9rCn1dweN+L3ecNy4BiCGw4WEt1zgdIiAeYNY5GM=", + "narHash": "sha256-/9hMb9pgV8awDYYchUueplyKF6bz23b7z5gqQ999nro=", "originalUrl": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode", - "url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode&rev=12e31ac07c6d337760b3f59dc64c03f26cdd2009" + "url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode&rev=d63ee96d86672a9cb23d83d50ee02687eded2818" } }, - "narHash": "sha256-9/RR/CwvB1M2VSR7CrSVexYXN1YSSSE4WG4siDh0LE0=", + "narHash": "sha256-7X6XqNVzCzMRqq0LV+NLdfS1h7gWi+psnRNl4mwdPCY=", "originalUrl": "git+https://gitea.c3d2.de/ehmry/genode.git", - "url": "git+https://gitea.c3d2.de/ehmry/genode.git?ref=master&rev=2a9178fced42cac986de07b6944afd4422d28976" + "url": "git+https://gitea.c3d2.de/ehmry/genode.git?ref=master&rev=32f8b603cb09bd85b8ad9092b55b4f3869da19d5" }, "genode-depot": { "inputs": { "nixpkgs": { "inputs": {}, - "narHash": "sha256-HYX9rCn1dweN+L3ecNy4BiCGw4WEt1zgdIiAeYNY5GM=", - "originalUrl": "nixpkgs", - "url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode&rev=12e31ac07c6d337760b3f59dc64c03f26cdd2009" + "narHash": "sha256-/9hMb9pgV8awDYYchUueplyKF6bz23b7z5gqQ999nro=", + "originalUrl": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode", + "url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode&rev=d63ee96d86672a9cb23d83d50ee02687eded2818" } }, - "narHash": "sha256-be9whulZ8unz1sq9PiFr+tuUAXlwiPEhIe0Z6jmfZiU=", + "narHash": "sha256-uTHTwa05KzSmRETVBhpHw2CD+cMicqunaaknYsrxAfY=", "originalUrl": "git+https://gitea.c3d2.de/ehmry/genode-depot.git", - "url": "git+https://gitea.c3d2.de/ehmry/genode-depot.git?ref=master&rev=2f3162d88220bd6fa6b6fbc7c6d9fed68533a761" + "url": "git+https://gitea.c3d2.de/ehmry/genode-depot.git?ref=master&rev=ac11a14f9ba10685ae68ab5a050baf546ae702d2" }, "nixpkgs": { "inputs": {}, - "narHash": "sha256-HYX9rCn1dweN+L3ecNy4BiCGw4WEt1zgdIiAeYNY5GM=", + "narHash": "sha256-/9hMb9pgV8awDYYchUueplyKF6bz23b7z5gqQ999nro=", "originalUrl": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode", - "url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode&rev=12e31ac07c6d337760b3f59dc64c03f26cdd2009" + "url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode&rev=d63ee96d86672a9cb23d83d50ee02687eded2818" } }, "version": 3 diff --git a/flake.nix b/flake.nix index f88abae..a29c0df 100644 --- a/flake.nix +++ b/flake.nix @@ -19,24 +19,33 @@ in { - lib = import ./lib { - genodepkgs = self; - inherit nixpkgs dhall-haskell genode-depot; - }; + lib = nixpkgs.lib.forAllCrossSystems + ({ system, localSystem, crossSystem }: + nixpkgs.lib // (import ./lib { + inherit system localSystem crossSystem nixpkgs dhall-haskell + genode-depot; + genodepkgs = self; + })); - packages = forAllSystems (system: - let thisSystem = builtins.getAttr system; - in import ./packages.nix { - inherit system nixpkgs; - depot = thisSystem genode-depot.packages; - genode = thisSystem genode.packages; - } // builtins.getAttr system genode.packages); + packages = nixpkgs.lib.forAllCrossSystems + ({ system, localSystem, crossSystem }: + let thisSystem = builtins.getAttr system; + in import ./packages.nix { + inherit system nixpkgs; + depot = thisSystem genode-depot.packages; + genode = thisSystem genode.packages; + } // builtins.getAttr system genode.packages); - checks = forAllSystems (system: - import ./tests { - inherit self nixpkgs dhall-haskell genode-depot; - genodepkgs = builtins.getAttr system self.packages; - }); + checks = nixpkgs.lib.forAllCrossSystems + ({ system, localSystem, crossSystem }: + import ./tests { + inherit self system localSystem crossSystem nixpkgs dhall-haskell + genode-depot; + genodepkgs = builtins.getAttr system self.packages; + lib = builtins.getAttr system self.lib; + }) // { + x86_64-linux = self.checks.x86_64-linux-x86_64-genode; + }; }; } diff --git a/lib/default.nix b/lib/default.nix index 4df4384..43860be 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,12 +1,13 @@ -{ genodepkgs, nixpkgs, dhall-haskell, genode-depot }: +{ system, localSystem, crossSystem, genodepkgs, nixpkgs, dhall-haskell, genode-depot }: let hostPkgs = import nixpkgs { - system = "x86_64-linux"; + system = localSystem; overlays = [ (self: super: { inherit (dhall-haskell.packages) dhall; }) ]; }; - testPkgs = genodepkgs.packages.x86_64-genode; - depot = genode-depot.packages.x86_64-genode; + thisSystem = builtins.getAttr system; + testPkgs = thisSystem genodepkgs.packages; + depot = thisSystem genode-depot.packages; in { dhallText = name: source: @@ -37,7 +38,7 @@ in { xmllint --noout $out ''; - x86_64-genode.buildNovaIso = { name, rom }: + buildNovaIso = { name, rom }: let inherit (hostPkgs) cdrkit syslinux; diff --git a/packages.nix b/packages.nix index 2004720..ea91ade 100644 --- a/packages.nix +++ b/packages.nix @@ -15,11 +15,11 @@ let dhallPackages = super.dhallPackages // (callPackage ./dhall { }); in rec { inherit (super) stdenv; - libc = callPackage ./pkgs/libc { inherit depot; }; - stdcxx = callPackage ./pkgs/stdcxx { }; - nic_bus = callPackage ./pkgs/nic_bus { inherit (genode) base os; }; dhallGenode = dhallPackages.genode; dhallPrelude = dhallPackages.prelude; + libc = callPackage ./pkgs/libc { inherit depot; }; + nic_bus = callPackage ./pkgs/nic_bus { inherit (genode) base os; }; nova = callPackage ./NOVA { }; solo5 = callPackage ./pkgs/solo5 { inherit (genode) base os; }; + stdcxx = callPackage ./pkgs/stdcxx { }; } diff --git a/tests/default.nix b/tests/default.nix index 21645c8..905a2ab 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -11,25 +11,23 @@ let # solo5 = call ./solo5 { }; }; -in { self, genodepkgs, nixpkgs, dhall-haskell, genode-depot }: +in { self, system, localSystem, crossSystem, genodepkgs, nixpkgs, dhall-haskell, genode-depot, lib }: let hostPkgs = import nixpkgs { - system = "x86_64-linux"; + system = localSystem; overlays = [ (self: super: { inherit (dhall-haskell.packages) dhall; }) ]; }; - depot = genode-depot.packages.x86_64-genode; + depot = builtins.getAttr crossSystem genode-depot.packages; testPkgs = genodepkgs; - lib = hostPkgs.lib // self.lib; - linux = tests (import ./driver-linux.nix { inherit testPkgs hostPkgs lib depot; }).callTest; nova = (call: ((tests call) // { pci = call ./pci.nix { }; })) (import ./driver-nova.nix { - inherit testPkgs hostPkgs lib depot; + inherit system testPkgs hostPkgs lib depot; }).callTest; testsToList = tests: diff --git a/tests/driver-linux.nix b/tests/driver-linux.nix index 6aa682c..d0f7f67 100644 --- a/tests/driver-linux.nix +++ b/tests/driver-linux.nix @@ -44,7 +44,7 @@ let config = ./driver-config.xml; core = "${base-linux}/bin/core-linux"; init = "${os}/bin/init"; - "ld.lib.so" = "${depot.base-linux}/lib/ld.lib.so"; + "ld.lib.so" = "${base-linux}/bin/ld-linux.lib.so"; timer = "${base-linux}/bin/linux_timer_drv"; } // bootModules; diff --git a/tests/driver-nova.nix b/tests/driver-nova.nix index bd98c64..b6fc55b 100644 --- a/tests/driver-nova.nix +++ b/tests/driver-nova.nix @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 -{ testPkgs, hostPkgs, lib, depot }: +{ system, testPkgs, hostPkgs, lib, depot }: let testDriver = with hostPkgs; @@ -45,7 +45,7 @@ let config = ./driver-config.xml; } // bootModules); - iso = lib.x86_64-genode.buildNovaIso { + iso = lib.buildNovaIso { inherit name; rom = bootModules'; }; From b78a96025266ab36f41452333f2de0bbccfccbe0 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 2 Dec 2019 18:04:40 +0100 Subject: [PATCH 20/20] Remove libc test The test-libc binary is not published by Genode Labs. --- tests/default.nix | 1 - tests/libc.nix | 23 ----------------------- 2 files changed, 24 deletions(-) delete mode 100644 tests/libc.nix diff --git a/tests/default.nix b/tests/default.nix index 905a2ab..88fbf58 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -5,7 +5,6 @@ let tests = call: { fs_report = call ./fs_report.nix { }; - libc = call ./libc.nix { }; log = call ./log.nix { }; signal = call ./signal.nix { }; # solo5 = call ./solo5 { }; diff --git a/tests/libc.nix b/tests/libc.nix deleted file mode 100644 index fef28b5..0000000 --- a/tests/libc.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ testEnv, pkgs, depot }: -with pkgs; - -testEnv.mkTest rec { - name = "libc"; - meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ]; - - testConfig = testEnv.lib.renderDhallInit ./libc.dhall "{=}"; - - bootModules = { - "libc.lib.so" = "${depot.libc}/lib/libc.lib.so"; - "libm.lib.so" = "${depot.libc}/lib/libm.lib.so"; - "posix.lib.so" = "${depot.posix}/lib/posix.lib.so"; - "test-libc" = "${depot.test-libc}/bin/test-libc"; - "vfs.lib.so" = "${os}/lib/vfs.lib.so"; - }; - - qemuMem = 384; - - testScript = '' - run_genode_until "child .* exited with exit value 0.*\n" 30 - ''; -}