2
0
Fork 0

Merge branch 'flake'

This commit is contained in:
Ehmry - 2019-12-02 18:09:11 +01:00
commit e092f8cc86
64 changed files with 541 additions and 3428 deletions

View File

@ -1,33 +0,0 @@
# SPDX-FileCopyrightText: Emery Hemingway
#
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
let
nativeOverlay = self: super:
# Overlay of locally defined packages
with self; {
depot = callPackage ./depot { };
dhallPackages = super.dhallPackages // (callPackage ./dhall { });
genode = (callPackage ./upstream { } // {
libc = callPackage ./pkgs/libc { };
nic_bus = callPackage ./pkgs/nic_bus { };
});
nova = callPackage ./NOVA { };
solo5 = callPackage ./pkgs/solo5 { };
};
toolchainOverlay = import ./toolchain-overlay;
# Overlay of toolchain patches
in { nixpkgs ? ../nixpkgs, nim-overlay ? <nim-overlay>, 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;
}

View File

@ -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";};}
]

View File

@ -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)

View File

@ -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 ']'

View File

@ -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";};}
]

View File

@ -6,6 +6,6 @@
fetchgit {
url = "https://git.sr.ht/~ehmry/dhall-genode";
rev = "4e05e7bf88e53c81a8f00460673fd48e858c6dfc";
sha256 = "0y92jinqr26wlrychk8mi58kqwmy4y25c2ffks3r3m78i8andi8y";
rev = "c9a9c18dc8dd45198dbf0a53732ca02079fee0fd";
sha256 = "1fcfyfcnm6snpagf3ii70p8vdy7na9lv6c3izlckyp6gvgadyyjn";
}

56
flake.lock Normal file
View File

@ -0,0 +1,56 @@
{
"inputs": {
"dhall-haskell": {
"inputs": {
"nixpkgs": {
"inputs": {},
"narHash": "sha256-wJg4DA700SoQbEz61448sR6BgxRa1R92K3vvCV1g+HY=",
"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=",
"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=",
"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-/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-7X6XqNVzCzMRqq0LV+NLdfS1h7gWi+psnRNl4mwdPCY=",
"originalUrl": "git+https://gitea.c3d2.de/ehmry/genode.git",
"url": "git+https://gitea.c3d2.de/ehmry/genode.git?ref=master&rev=32f8b603cb09bd85b8ad9092b55b4f3869da19d5"
},
"genode-depot": {
"inputs": {
"nixpkgs": {
"inputs": {},
"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-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=ac11a14f9ba10685ae68ab5a050baf546ae702d2"
},
"nixpkgs": {
"inputs": {},
"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"
}
},
"version": 3
}

51
flake.nix Normal file
View File

@ -0,0 +1,51 @@
{
edition = 201909;
description = "Genode packages";
inputs = {
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, dhall-haskell, genode-depot, genode, nixpkgs }:
let
systems = [ "x86_64-genode" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
in {
lib = nixpkgs.lib.forAllCrossSystems
({ system, localSystem, crossSystem }:
nixpkgs.lib // (import ./lib {
inherit system localSystem crossSystem nixpkgs dhall-haskell
genode-depot;
genodepkgs = self;
}));
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 = 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;
};
};
}

View File

@ -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
}
}
}

View File

@ -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); }

View File

@ -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

View File

@ -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 <<EOM >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;
}

163
lib/default.nix Normal file
View File

@ -0,0 +1,163 @@
{ system, localSystem, crossSystem, genodepkgs, nixpkgs, dhall-haskell, genode-depot }:
let
hostPkgs = import nixpkgs {
system = localSystem;
overlays = [ (self: super: { inherit (dhall-haskell.packages) dhall; }) ];
};
thisSystem = builtins.getAttr system;
testPkgs = thisSystem genodepkgs.packages;
depot = thisSystem genode-depot.packages;
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 = with hostPkgs; [ dhall libxml2 ];
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 (env:initConfig env:initArgs)' \
> $out
xmllint --noout $out
'';
buildNovaIso = { name, rom }:
let
inherit (hostPkgs) cdrkit syslinux;
coreNovaObj = "${testPkgs.base-nova}/lib/core-nova.o";
rom' = (with testPkgs; {
init = "${os}/bin/init";
"ld.lib.so" = "${depot.base-nova}/lib/ld.lib.so";
timer = "${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');
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";
passthru = rom;
passAsFile = [ "modulesAsm" ];
inherit modulesAsm;
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 $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
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 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
'';
};
}

25
packages.nix Normal file
View File

@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: Emery Hemingway
#
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
{ system, nixpkgs, depot, genode }:
let
toolchainOverlay = import ./toolchain-overlay;
# Overlay of toolchain patches
super = builtins.getAttr system nixpkgs.legacyPackages;
inherit (super) callPackage;
dhallPackages = super.dhallPackages // (callPackage ./dhall { });
in rec {
inherit (super) stdenv;
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 { };
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
{ stdenv, buildPackages, fetchurl, llvmPackages, pkgconfig, genode }:
{ 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";

26
pkgs/stdcxx/default.nix Normal file
View File

@ -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
'';
}

5
pkgs/stdcxx/stdcxx.pc Normal file
View File

@ -0,0 +1,5 @@
Name: stdcxx
Description: Genode Standard C++ library
Version: @version@
Requires: libc libm
Cflags: @cflags@

View File

@ -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 ? <dhall-haskell>
, dhallNixpkgs ? dhallPinned.nixpkgs
, dhallNixpkgsStaticLinux ? dhallPinned.nixpkgsStaticLinux
, nim-overlay ? <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';
};
}

View File

@ -5,56 +5,34 @@
let
tests = call: {
fs_report = call ./fs_report.nix { };
libc = call ./libc.nix { };
log = call ./log.nix { };
signal = call ./signal.nix { };
solo5 = call ./solo5 { };
# solo5 = call ./solo5 { };
};
in { genodepkgs ? import ./../default.nix { }, nixpkgs ? import ./../nixpkgs.nix
, dhall-haskell }:
in { self, system, localSystem, crossSystem, genodepkgs, nixpkgs, dhall-haskell, genode-depot, lib }:
let
hostPkgs = import nixpkgs {
overlays = [ (self: super: { dhall = dhall-haskell.linux-dhall; }) ];
system = localSystem;
overlays = [ (self: super: { inherit (dhall-haskell.packages) dhall; }) ];
};
depot = builtins.getAttr crossSystem genode-depot.packages;
testPkgs = genodepkgs;
lib = hostPkgs.lib // {
linux = tests (import ./driver-linux.nix {
inherit testPkgs hostPkgs lib depot;
}).callTest;
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
'';
nova = (call: ((tests call) // { pci = call ./pci.nix { }; }))
(import ./driver-nova.nix {
inherit system testPkgs hostPkgs lib depot;
}).callTest;
renderDhallInit = path: args:
hostPkgs.runCommand "init.xml" {
preferLocalBuild = true;
buildInputs = [ hostPkgs.dhall ];
initConfig = path;
initArgs = args;
DHALL_PRELUDE = "${testPkgs.dhallPackages.prelude}/package.dhall";
DHALL_GENODE = "${testPkgs.dhallPackages.genode}/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
'';
};
testsToList = tests:
map (test: {
inherit (test) name;
value = test;
}) (builtins.attrValues tests);
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;
};
}
in with builtins; listToAttrs (concatLists (map (testsToList) [ linux nova ]))

View File

@ -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";
"ld.lib.so" = "${depot.base-linux}/lib/ld.lib.so";
timer = "${genode.base-linux}/bin/linux_timer_drv";
core = "${base-linux}/bin/core-linux";
init = "${os}/bin/init";
"ld.lib.so" = "${base-linux}/bin/ld-linux.lib.so";
timer = "${base-linux}/bin/linux_timer_drv";
} // bootModules;
baseSetup = with builtins;
@ -92,5 +92,6 @@ in {
isNova = false;
};
pkgs = testPkgs;
inherit depot;
} // args));
}

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
{ testPkgs, hostPkgs, lib }:
{ system, 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 = ''
@ -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
@ -48,64 +43,62 @@ 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 = mkIso bootModules';
iso = lib.buildNovaIso {
inherit name;
rom = bootModules';
};
baseSetup = ''
##
# 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}/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;
@ -147,5 +140,6 @@ in {
isNova = true;
};
pkgs = testPkgs;
inherit depot;
} // args));
}

View File

@ -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 = "${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 = ''

View File

@ -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
''
<config>
<vfs>
<dir name="dev">
<log/>
<inline name="rtc">2019-08-20 15:01</inline>
</dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
</config>
''
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
''
<config>
<vfs>
<dir name="dev">
<log/>
<inline name="rtc">2019-08-20 15:01</inline>
</dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
</config>
''
)
}
: Genode.Init.Start.Type
}
: Genode.Init.Start.Type
}

View File

@ -1,23 +0,0 @@
{ testEnv, pkgs }:
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" = "${genode.os}/lib/vfs.lib.so";
};
qemuMem = 384;
testScript = ''
run_genode_until "child .* exited with exit value 0.*\n" 30
'';
}

View File

@ -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" } }
}

View File

@ -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 = "${base}/bin/test-log";
testScript = "run_genode_until {Test done.} 10";
}

View File

@ -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
''
<config system="yes">
<policy label="smbios_decoder -> smbios_table" report="acpi_drv -> smbios_table"/>
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
</config>
''
}
, 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
''
<config>
<policy label_prefix="test-pci"> <pci class="ALL"/> </policy>
</config>
''
}
→ 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
''
<config system="yes">
<policy label="smbios_decoder -> smbios_table" report="acpi_drv -> smbios_table"/>
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
</config>
''
)
}
, 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
''
<config>
<policy label_prefix="test-pci"> <pci class="ALL"/> </policy>
</config>
''
)
}
}
}

View File

@ -1,4 +1,4 @@
{ testEnv, pkgs }:
{ testEnv, pkgs, ... }:
with pkgs;
testEnv.mkTest {
@ -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 = ''

View File

@ -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
}

View File

@ -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 = "${os}/bin/test-signal";
testScript = "run_genode_until {--- Signalling test finished ---} 120";
}

View File

@ -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 "{=}";
}

View File

@ -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()

View File

@ -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"

View File

@ -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;
}

View File

@ -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
'';
}

View File

@ -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

View File

@ -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_ */

View File

@ -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

View File

@ -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;
})

View File

@ -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

View File

@ -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) }
}

View File

@ -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

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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 */

View File

@ -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)
*/

View File

@ -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 <float.h>
#include <math.h>
#include "floatio.h"

View File

@ -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

View File

@ -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 <unistd.h>
#include <netdb.h>
-#ifndef HAVE_MD5
-# include "../dst/md5.h"
-#else
-# ifdef SOLARIS2
-# include <sys/md5.h>
-# elif _LIBC
-# include <md5.h>
-# endif
-#endif
-#ifndef _MD5_H_
-# define _MD5_H_ 1 /*%< make sure we do not include rsaref md5.h file */
-#endif
+#include <sys/random.h>
#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;
}
/*%

View File

@ -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;
}

View File

@ -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

View File

@ -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 */
/*

View File

@ -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;

View File

@ -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) {

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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 <locale.h>
#include <limits.h>
-#define dtoa __dtoa
-#define freedtoa __freedtoa
-
#include <float.h>
#include <math.h>
#include "gdtoa.h"

View File

@ -1,185 +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, srcHash }:
let
src = stdenv.mkDerivation {
name = "genode-" + repo + "-src";
inherit repo;
preferLocalBuild = true;
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = srcHash;
src = fetchgit {
url = "https://git.sr.ht/~ehmry/genode";
rev = "1dc25293b84fb3aed880bb4315adc7ce321c6343";
sha256 = "1jqbc1i4hwi6aai728mz8wmbcpm864v2mlkyg36lm118b7cpp493";
fetchSubmodules = false;
};
phases = [ "unpackPhase" "patchPhase" "installPhase" ];
postPatch = ''
# Disable other repos
for R in repos/*; do
if [ -d "$R" ] ; then
case $R in
repos/$repo) ;;
repos/base)
find $R -name Tupfile -delete ;;
*)
rm -r $R ;;
esac
fi
done
'';
installPhase = "cp -r . $out";
};
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 src repo specs version;
setupHook = ./../tool/setup-hooks.sh;
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
# 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 {
# reset hashes to 0000000000000000000000000000000000000000000000000000
# when updating git revision
base = buildRepo {
repo = "base";
srcHash = "1wb0jif4v9cgrwsjbg16c5fnpg4d1pa0ikbrl6c25axsrqx77pkp";
};
base-linux = (buildRepo {
repo = "base-linux";
srcHash = "0brdiaxgf37cjv34irhybckgwhz7a6lkj8ymya1aba3nrkb12zv6";
}).overrideAttrs (attrs: { nativeBuildInputs = [ base ]; });
base-nova = (buildRepo {
repo = "base-nova";
srcHash = "02zhv0j77ikdagslk2nbjiiabl6885kngqlh89jc8i51ksksyljd";
}).overrideAttrs (attrs: { nativeBuildInputs = [ base ]; });
os = (buildRepo {
repo = "os";
srcHash = "0ld71jw3d1bs0afad3zm1p8kacj8f1xbncx0jfi89an639b0qgis";
}).overrideAttrs (attrs: { nativeBuildInputs = [ base ]; });
}