Skip to content

Commit

Permalink
[*] Remove leftover references to Runtime/
Browse files Browse the repository at this point in the history
Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com>
  • Loading branch information
woju committed Sep 27, 2021
1 parent eb3febf commit cda0d87
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 29 deletions.
8 changes: 4 additions & 4 deletions Documentation/manifest-syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,10 @@ Gramine currently supports two types of mount points:
* ``chroot``: Host-backed files. All host files and sub-directories found under
``[URI]`` are forwarded to the Gramine instance and placed under ``[PATH]``.
For example, with a host-level path specified as
``fs.mount.lib.uri = "file:gramine/Runtime/"`` and forwarded to Gramine via
``fs.mount.lib.path = "/lib"``, a host-level file
``gramine/Runtime/libc.so.6`` is visible to graphenized application as
``/lib/libc.so.6``. This concept is similar to FreeBSD's chroot and to
``fs.mount.lib.uri = "file:/one/path/"`` and forwarded to Graphene via
``fs.mount.lib.path = "/another/path"``, a host-level file
``/one/path/file`` is visible to graphenized application as
``/another/path/file``. This concept is similar to FreeBSD's chroot and to
Docker's named volumes. Files under ``chroot`` mount points support mmap and
fork/clone.

Expand Down
20 changes: 5 additions & 15 deletions LibOS/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
include ../Scripts/Makefile.configs
include ../Scripts/Makefile.rules

RUNTIME_DIR = $(CURDIR)/../Runtime

define LN_SF_TO_RUNTIME_DIR_template =
$(RUNTIME_DIR)/$(notdir $(1)): $(1)
$$(call cmd,ln_sfr)
endef

GNU_MIRRORS ?= https://ftp.gnu.org/gnu/ \
https://mirrors.kernel.org/gnu/ \
https://mirrors.ocf.berkeley.edu/gnu/
Expand All @@ -23,9 +16,9 @@ ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
# ------------------------------------------------------------------------------------------------
# GCC build: patch libgomp.so.1 (OpenMP runtime library) to replace raw SYSCALL instruction with
# function call into Gramine. GCC is not built by default with Gramine; use `make -C LibOS gcc`
# to build it. The resulting libgomp.so.1 is symlinked under $RUNTIME_DIR. This patched version
# makes sense only on x86_64 platforms. NOTE: We'd prefer to build libgomp.so.1 alone but it is
# impossible (the only way to build it is as part of the complete GCC build).
# to build it. This patched version makes sense only on x86_64 platforms. NOTE: We'd prefer to build
# libgomp.so.1 alone but it is impossible (the only way to build it is as part of the complete GCC
# build).
#
# We explicitly unset CC, CXX, AS environment variables for the case we're compiling the rest of the
# project with clang. This is because in GCC build, "defining certain environment variables such as
Expand All @@ -38,7 +31,6 @@ GCC_HASH = 27e879dccc639cd7b0cc08ed575c1669492579529b53c9ff27b0b96265fa867d
GCC_BUILD_DIR = gcc-build
GCC_LIBS = x86_64-pc-linux-gnu/libgomp/.libs/libgomp.so.1
GCC_TARGET = $(addprefix $(GCC_BUILD_DIR)/, $(GCC_LIBS))
GCC_RUNTIME = $(addprefix $(RUNTIME_DIR)/, $(notdir $(GCC_TARGET)))

.SECONDARY: $(GCC_BUILD_DIR)/Build.success

Expand All @@ -52,13 +44,11 @@ $(GCC_BUILD_DIR)/Makefile: $(GCC_SRC)/.configured
mkdir -p $(GCC_BUILD_DIR)
(cd $(GCC_BUILD_DIR) || exit 1; \
unset CC CXX AS; \
../$(GCC_SRC)/configure --prefix=$(RUNTIME_DIR) \
../$(GCC_SRC)/configure \
--enable-languages=c \
--disable-multilib \
)

$(foreach lib,$(GCC_TARGET),$(eval $(call LN_SF_TO_RUNTIME_DIR_template,$(lib))))

GCC_PATCHES = \
gcc-patches/libgomp-replace-futex-instruction.patch

Expand All @@ -81,7 +71,7 @@ $(GCC_SRC).tar.gz:
../Scripts/download --output $@ --sha256 $(GCC_HASH) $(foreach mirror,$(GNU_MIRRORS),--url $(mirror)gcc/$(GCC_SRC)/$(GCC_SRC).tar.gz)

.PHONY: gcc
gcc: $(GCC_TARGET) $(GCC_RUNTIME)
gcc: $(GCC_TARGET)

# ------------------------------------------------------------------------------------------------
# Common targets
Expand Down
1 change: 0 additions & 1 deletion LibOS/shim/src/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
gramine_lib = .lib/gramine-lib.a
pal_lib = $(RUNTIME_DIR)/libpal-$(PAL_HOST).so

.PHONY: all
all: gramine_lib_recurse
Expand Down
2 changes: 0 additions & 2 deletions LibOS/shim/test/ltp/Makefile.Test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export SYS

PALDIR = $(LTP_DIR)/../../../../Pal/src
SHIMDIR = $(LTP_DIR)/../../src
RUNTIME = $(LTP_DIR)/../../../../Runtime

CC = gcc
CXX = g++
Expand Down Expand Up @@ -72,7 +71,6 @@ relative-to = $(shell python -c "import os.path; print os.path.relpath(\"$(abspa

ifeq ($(SGX),1)
SGX_DIR = $(PALDIR)/host/Linux-SGX
RUNTIME_DIR = $(RUNTIME)

SGX_SIGNER_KEY ?= $(SGX_DIR)/signer/enclave-key.pem
SGX_SIGN = gramine-sgx-sign --key $(SGX_SIGNER_KEY)
Expand Down
2 changes: 0 additions & 2 deletions Pal/src/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export RUNTIME_DIR = $(CURDIR)/../../Runtime

include ../../Scripts/Makefile.configs
include ../../Scripts/Makefile.rules

Expand Down
3 changes: 0 additions & 3 deletions Pal/src/host/Linux-SGX/manifest.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
SGX_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
RUNTIME_DIR = $(SGX_DIR)/../../../../Runtime

LIBPAL = $(RUNTIME_DIR)/libpal-Linux-SGX.so
SGX_SIGNER_KEY ?= $(SGX_DIR)/signer/enclave-key.pem

# sgx manifest.sgx/sig/token
Expand Down
3 changes: 1 addition & 2 deletions Scripts/Makefile.Test
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ SHIM_TEST_DIR = $(SCRIPTS_DIR)/../LibOS/shim/test

PALDIR = $(abspath $(SCRIPTS_DIR)/../Pal/src)
SHIMDIR = $(abspath $(SCRIPTS_DIR)/../LibOS/shim)
RUNTIME = $(abspath $(SCRIPTS_DIR)/../Runtime)

include $(SCRIPTS_DIR)/Makefile.rules

CFLAGS-libos = -I$(SHIMDIR)/include -L$(SHIMDIR)/../glibc-build/libos

CFLAGS-libos-debug = -I$(SHIMDIR)/include -I$(PALDIR)/../include/pal -I$(PALDIR)/../include/lib -fno-builtin -nostdlib
CXXFLAGS-libos-debug = -I$(SHIMDIR)/include -I$(PALDIR)/../include/pal -I$(PALDIR)/../include/lib -fno-builtin -nostdlib
LDFLAGS-libos-debug = -L$(SHIMDIR)/src -L$(PALDIR)/host/$(PAL_HOST) -Wl,-rpath-link=$(abspath $(RUNTIME)) -lpal -lsysdb_debug
LDFLAGS-libos-debug = -L$(SHIMDIR)/src -L$(PALDIR)/host/$(PAL_HOST) -lpal -lsysdb_debug

.PHONY: all
ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
Expand Down

0 comments on commit cda0d87

Please sign in to comment.