Browse Source

More fixes

Don Porter 7 years ago
parent
commit
c4498e9adb

+ 10 - 11
LibOS/shim/test/Makefile

@@ -5,21 +5,19 @@ export SYS
 
 PALDIR  = $(level)../../../Pal/src
 SHIMDIR = $(level)../src
-LIBCDIR = $(level)../../../Runtime
+RUNTIME = $(level)../../../Runtime
 
 CC = gcc
 CXX = g++
 CFLAGS 	= -std=gnu99
 CFLAGS-debug = $(CFLAGS) -I$(SHIMDIR)/../include -I$(PALDIR)/../include/pal -I$(PALDIR)/../lib
 LDFLAGS	=
-LDFLAGS-debug = $(LDFLAGS) -L$(SHIMDIR) -L$(PALDIR) \
-		-Wl,-rpath-link=$(abspath $(SHIMDIR)) \
-		-Wl,-rpath-link=$(abspath $(PALDIR))
+LDFLAGS-debug = $(LDFLAGS) -L$(SHIMDIR) -L$(PALDIR) -Wl,-rpath-link=$(abspath $(RUNTIME))
 
 default: all
 include $(PALDIR)/Makefile.Test
 
-all: $(target) $(if $(level),,build-subdirs) | $(call expand_target,$(exec_target))
+all: pal_loader $(target) $(if $(level),,build-subdirs) | $(call expand_target,$(exec_target))
 
 ifeq ($(DEBUG),1)
 CC += -g
@@ -28,15 +26,16 @@ endif
 export DEBUG
 
 manifest_rules = \
-	-e 's:\$$(PAL):$(abspath $(level)pal_loader):g' \
-	-e 's:\$$(PALDIR):'$$RELDIR'$(PALDIR):g' \
+	-e 's:\$$(PAL):$(abspath $(RUNTIME)/pal_loader):g' \
 	-e 's:\$$(PWD):$(PWD):g' \
 	-e 's:\$$(BIN):$(subst .manifest,,$(notdir $@)):g' \
-	-e 's:\$$(SHIMDIR):'$$RELDIR'$(SHIMDIR):g' \
-	-e 's:\$$(SHIMPATH):'$$RELDIR'$(SHIMDIR)/libsysdb.so:g' \
-	-e 's:\$$(LIBCDIR):'$$RELDIR'$(LIBCDIR):g' \
+	-e 's:\$$(SHIMPATH):'$$RELDIR'$(RUNTIME)/libsysdb.so:g' \
+	-e 's:\$$(LIBCDIR):'$$RELDIR'$(RUNTIME):g' \
 	$(extra_rules)
 
+pal_loader:
+	ln -s $(RUNTIME)/pal_loader
+
 relative-to = $(shell python -c "import os.path; print os.path.relpath(\"$(abspath $2)\",\"$(abspath $1)\")")
 
 %manifest: %manifest.template
@@ -52,7 +51,7 @@ manifest: manifest.template
 .PHONY: test clean
 
 clean: $(clean-extra) $(if $(level),,clean-subdirs)
-	rm -rf $(call expand_target,$(exec_target)) $(target)
+	rm -rf pal_loader $(call expand_target,$(exec_target)) $(target)
 
 build-subdirs:
 	for f in $(subdirs); do (cd $$f; $(MAKE); cd ..); done

+ 1 - 1
LibOS/shim/test/apps/lmbench/Makefile.lmbench

@@ -15,5 +15,5 @@ include ../../../../../Makefile
 $(addsuffix .template,$(manifests)): %: ../../../%
 	ln -sf $< $@
 
-pal_loader: ../../../../pal_loader
+pal_loader: ../../../../../pal_loader
 	ln -sf $< $@

+ 0 - 42
LibOS/shim/test/pal_loader

@@ -1,42 +0,0 @@
-#!/bin/bash
-
-THIS_DIR=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
-RUNTIME_DIR=$(readlink -f $THIS_DIR/../../../Runtime)
-OS=$(make --quiet -f $THIS_DIR/../../../Pal/src/Makefile.Host print_host)
-
-MANIFEST=
-GDB_CMD=
-PAL_CMD=$RUNTIME_DIR/pal-$OS
-
-if [ "$GDB" == "1" ]; then
-	GDB="gdb"
-fi
-
-if [ "$GDB" != "" ] && [ "$GDB" != "0" ]; then
-	GDB_CMD="$GDB --args"
-fi
-
-if [ "$SEC" == "1" ]; then
-	echo "Use reference monitor"
-	PAL_CMD=$RUNTIME_DIR/pal_sec-$OS
-fi
-
-while [ "$1" != "" ];
-do
-	if [ "$MANIFEST" == "" ]; then
-		MANIFEST=$1
-		shift
-		continue
-	fi
-
-	break
-done
-
-if [ ! -f "$PAL_CMD" ]; then
-	echo "$PAL_CMD is not built, or security mode is not supported"
-	exit 1
-fi
-
-set -x
-
-exec $GDB_CMD $PAL_CMD $MANIFEST "$@"

+ 1 - 0
LibOS/shim/test/pal_loader

@@ -0,0 +1 @@
+../../../Runtime/pal_loader

+ 1 - 1
LibOS/shim/test/regression/00_bootstrap.py

@@ -3,7 +3,7 @@
 import os, sys, mmap
 from regression import Regression
 
-loader = './pal'
+loader = sys.argv[1]
 
 # Running Bootstrap
 regression = Regression(loader, "bootstrap")

+ 1 - 1
LibOS/shim/test/regression/90_large-mmap.py

@@ -3,7 +3,7 @@
 import os, sys, mmap
 from regression import Regression
 
-loader = './pal'
+loader = sys.argv[1]
 
 # Running Bootstrap
 regression = Regression(loader, "large-mmap")

+ 2 - 2
LibOS/shim/test/regression/Makefile

@@ -46,9 +46,9 @@ PYTHONENV="PYTHONPATH=../../../../Scripts"
 
 regression: $(target)
 	@echo "\n\nBasic Bootstrapping:"
-	@for f in $(wildcard 00_*.py); do env $(PYTHONENV) python $$f; done
+	@for f in $(wildcard 00_*.py); do env $(PYTHONENV) python $$f $(RUNTIME)/pal-$(PAL_HOST); done
 	@echo "\n\nLarge File Support:"
-	@for f in $(wildcard 90_*.py); do env $(PYTHONENV) python $$f; done
+	@for f in $(wildcard 90_*.py); do env $(PYTHONENV) python $$f $(RUNTIME)/pal-$(PAL_HOST); done
 	@echo "\n\nLTP tests for system calls:"
 	../apps/ltp/syscalls.sh