WiP! absorb Genode upstream

This commit is contained in:
Ehmry - 2019-06-27 11:37:22 +02:00
parent e1172fac40
commit 549e7df89b
5 changed files with 63 additions and 23 deletions

13
.gitignore vendored
View File

@ -1,3 +1,16 @@
/toolchain-* /toolchain-*
/sdk-* /sdk-*
/.gitignore /.gitignore
result
##### TUP GITIGNORE #####
##### Lines below automatically generated by Tup.
##### Do not edit.
.tup
/.gitignore
/Makefile
/bin-list
/depot
/pkg.sed
/public
/raw-list
/versions.sed

View File

@ -1,5 +1,17 @@
.gitignore .gitignore
ifeq (@(TUP_ARCH),i386)
CC_MARCH = -march=i686 -m32
LD_MARCH = -melf_i386
endif
ifeq (@(TUP_ARCH),x86_64)
CC_MARCH = -m64 -mcmodel=large
LD_MARCH = -melf_x86_64
endif
GENODE_DIR = $(TUP_CWD)/upstream
ifeq ($(RAW_NAME),) ifeq ($(RAW_NAME),)
RAW_NAME = $(TARGET_NAME) RAW_NAME = $(TARGET_NAME)
endif endif
@ -22,7 +34,7 @@ endif
DEPOT_DIR = $(TUP_CWD)/depot DEPOT_DIR = $(TUP_CWD)/depot
DEPOT_RAW_DIR = $(DEPOT_DIR)/raw DEPOT_RAW_DIR = $(DEPOT_DIR)/raw
DEPOT_BIN_DIR = $(DEPOT_DIR)/bin/@(TUP_ARCH) DEPOT_BIN_DIR = $(DEPOT_DIR)/bin
DEPOT_PKG_DIR = $(DEPOT_DIR)/pkg DEPOT_PKG_DIR = $(DEPOT_DIR)/pkg
PUBLIC_DIR = $(TUP_CWD)/public PUBLIC_DIR = $(TUP_CWD)/public
@ -99,17 +111,19 @@ SDK_INCLUDE = $(TUP_CWD)/sdk.tup
ERRATA_DIR = $(TUP_CWD)/errata ERRATA_DIR = $(TUP_CWD)/errata
PKG_CONFIG = PKG_CONFIG_PATH=@(PKG_CONFIG_PATH) pkg-config export PKG_CONFIG_PATH
PKG_CONFIG = PKG_CONFIG_PATH=$(GENODE_DIR)/pkg-config:$PKG_CONFIG_PATH pkg-config
ifndef TOOL_CHAIN_PREFIX ifndef TOOL_CHAIN_PREFIX
error TOOL_CHAIN_PREFIX not configured error TOOL_CHAIN_PREFIX not configured
endif endif
CC = $(TOOL_CHAIN_PREFIX)gcc CC = @(TOOL_CHAIN_PREFIX)gcc
CXX = $(TOOL_CHAIN_PREFIX)g++ CXX = @(TOOL_CHAIN_PREFIX)g++
LD= $(TOOL_CHAIN_PREFIX)ld LD= @(TOOL_CHAIN_PREFIX)ld
AR = $(TOOL_CHAIN_PREFIX)ar AR = @(TOOL_CHAIN_PREFIX)ar
OBJCOPY = @(TOOL_CHAIN_PREFIX)objcopy
!cc = |> ^ CC %f^ $(CC) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -c %f -o %o |> !cc = |> ^ CC %f^ $(CC) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -c %f -o %o |>
!cxx = |> ^ CC %f^ $(CC) $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) -c %f -o %o |> !cxx = | $(GENODE_DIR)/<pkg-config> |> ^ CC %f^ $(CC) $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) -c %f -o %o |>
!ld = |> ^ LD %o^ $(LD) $(LDFLAGS) %f -o %o |> !ld = |> ^ LD %o^ $(LD) $(LDFLAGS) %f -o %o |>

View File

@ -1,9 +1,15 @@
{ pkgs ? import <nixpkgs> {} }: with pkgs; { pkgs ? import <nixpkgs> {} }: with pkgs;
let
lddir = ./upstream/repos/base/src/ld;
toolchain = import ./errata/toolchain.nix { inherit pkgs; };
sdk = import ./sdk { inherit pkgs toolchain; };
ports = import ./upstream/repos/libports/ports { };
in
pkgs.mkShell { pkgs.mkShell {
name = "genode-dev-env"; name = "genode-dev-env";
nativeBuildInputs = nativeBuildInputs =
[ (import ./errata/toolchain.nix { inherit pkgs; }) [ toolchain
stdenv.glibc.dev stdenv.glibc.dev
git tup git tup
ccache ccache
@ -13,6 +19,7 @@ pkgs.mkShell {
findutils findutils
autoconf264 autoconf264
autogen autogen
cdrtools
expect libxml2 syslinux qemu xorriso expect libxml2 syslinux qemu xorriso
@ -38,8 +45,15 @@ pkgs.mkShell {
ncurses ncurses
]; ];
passthru = { inherit lddir sdk toolchain; };
shellHook = shellHook =
'' ''
export SDK_DIR=${sdk}
export LD_DIR=${lddir}
export PKG_CONFIG_PATH=${sdk}/pkg-config
export TOOLCHAIN_DIR=${toolchain}
export SYSLINUX=${syslinux}
export PROMPT_DIRTRIM=2 export PROMPT_DIRTRIM=2
export PS1="\[\033[1;30m\]Genode-dev [\[\033[1;37m\]\w\[\033[1;30m\]] $\[\033[0m\] " export PS1="\[\033[1;30m\]Genode-dev [\[\033[1;37m\]\w\[\033[1;30m\]] $\[\033[0m\] "
export PS2="\[\033[1;30m\]>\[\033[0m\] " export PS2="\[\033[1;30m\]>\[\033[0m\] "

View File

@ -1,31 +1,30 @@
include_rules include_rules
export SYSLINUX export SYSLINUX
: config |> \
echo %f | awk -f a.awk >> %o; \
echo %f | awk -f b.awk >> %o; \
echo %f | awk -f c.awk >> %o; \
|> modules.s
# boot_modules.o {modules} : modules.s |> $(CC) $(CC_MARCH) -c %f -o %o |> boot_modules.o
LINK_ADDRESS = 0x01000000 LINK_ADDRESS = 0x01000000
# : {modules} : boot_modules.o | \
: modules.txt |> \
awk -f a.awk < %f >> %o; \
awk -f b.awk < %f >> %o; \
awk -f c.awk < %f >> %o; \
|> modules.s
: | \
$(GENODE_DIR)/repos/base-nova/<core> \ $(GENODE_DIR)/repos/base-nova/<core> \
$(GENODE_DIR)/repos/base-nova/<ld> \
|> \ |> \
$(CXX) -nostdlib \ $(CXX) $(CC_MARCH) -nostdlib \
-Wl,-T -Wl,$(GENODE_DIR)/repos/base/src/ld/genode.ld \
-Wl,-z -Wl,max-page-size=0x1000 \ -Wl,-z -Wl,max-page-size=0x1000 \
-Wl,-Ttext=$(LINK_ADDRESS) -Wl,-gc-sections \ -Wl,-Ttext=$(LINK_ADDRESS) -Wl,-gc-sections \
-Wl,-nostdlib \ -Wl,-nostdlib \
-Wl,--whole-archive -Wl,--start-group \ -Wl,--whole-archive -Wl,--start-group \
%<core> %<ld> \ %<core> %f \
-Wl,--no-whole-archive \ -Wl,--no-whole-archive \
-Wl,--end-group $libgcc -o %o \ -Wl,--end-group \
`$(CXX) $(CC_MARCH) -print-libgcc-file-name` \
-o %o \
|> image.elf |> image.elf
: image.elf |> gzip --keep %f |> %b.gz : image.elf |> gzip --keep %f |> %b.gz

@ -1 +1 @@
Subproject commit 11d2a2957af3794ba9776d0958c2165699a77ffd Subproject commit 49098b9af3d089ca4a367d8e12c95d7b792460df