Browse Source

[LibOS/benchmark] make LibOS/shim/tests/benchmark build again

This patch fixes up to make LibOS/shim/tests/benchmark build again.
It addresses small 4 issues as follows.

- Runtime/pal_loader
  pass --no-print-directory to make pal_loader doesn't work as
  expected when it's invoked by make command as below.  pal_loader
  invokes make with --quiet. But when pal_loader is called by make as
  sub command, the message, "Entering/Leaving <dir>" is still output.
  pass --no-print-directory to make to suppress Entering/Leaving
  message.

  > /graphene/Runtime/pal-make[1]: Entering
  > directory '/graphene/Pal/test'
  > Linux
  > make[1]: Leaving directory
  > '/graphene/devel/graphene/Pal/test' is not built, or
  > security mode is not supported

- fix up Makefiles to build LibOS/shim/tests/benchmark
  Otherwise the build fails as follows.
  > $ make
  > ln -sf ../../../../Runtime/pal_loader
  > [ fork_latency ]
  > [ test_start.m ]
  > [ rpc_latency.libos ]
  > /usr/bin/ld: cannot find -llibos
  > collect2: error: ld returned 1 exit status
  > Makefile:18: recipe for target 'rpc_latency.libos' failed
  > make: *** [rpc_latency.libos] Error 1

- update stale manifest.template

- update .gitignore
  The change set of 7f5a4cc made Makefile create .lib directory.
  So add it to .gitignore.

Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
Isaku Yamahata 5 years ago
parent
commit
4a63e6a577

+ 2 - 0
.gitignore

@@ -2,3 +2,5 @@
 *~
 /Jenkinsfiles/Jenkinsfile-*
 /Jenkinsfiles/JenkinsfileSGX-*
+
+.lib

+ 2 - 0
LibOS/shim/test/Makefile

@@ -20,6 +20,8 @@ CFLAGS-debug = $(CFLAGS) -I$(SHIMDIR)/../include -I$(PALDIR)/../include/pal -I$(
 LDFLAGS	=
 LDFLAGS-debug = $(LDFLAGS) -L$(SHIMDIR) -L$(PALDIR) -Wl,-rpath-link=$(abspath $(RUNTIME))
 
+CFLAGS-libos = -I$(SHIMDIR)/../include -L$(SHIMDIR)/../../glibc-build/libos
+
 .PHONY: default
 default: all
 

+ 7 - 0
LibOS/shim/test/benchmark/.gitignore

@@ -0,0 +1,7 @@
+/fork_latency
+/manifest
+/rpc_latency.libos
+/rpc_latency2.libos
+/sig_latency
+/start
+/test_start.m

+ 1 - 3
LibOS/shim/test/benchmark/Makefile

@@ -1,10 +1,8 @@
-CFLAGS-libos = -L../../../build/libos -I../../include
-
 c_executables = $(patsubst %.c,%,$(wildcard *.c))
 cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
 
 target = $(c_executables) $(cxx_executables) \
-	  manifest pal pal_sec
+	  manifest
 
 level = ../
 include ../Makefile

+ 6 - 9
LibOS/shim/test/benchmark/manifest.template

@@ -3,16 +3,13 @@ loader.env.LD_LIBRARY_PATH = /lib
 loader.debug_type = none
 loader.syscall_symbol = syscalldb
 
-fs.mount.root.type = chroot
-fs.mount.root.uri = file:
+fs.mount.lib.type = chroot
+fs.mount.lib.path = /lib
+fs.mount.lib.uri = file:../../../../Runtime
 
-fs.mount.other.lib.type = chroot
-fs.mount.other.lib.path = /lib
-fs.mount.other.lib.uri = file:../../../build
-
-fs.mount.other.bin.type = chroot
-fs.mount.other.bin.path = /bin
-fs.mount.other.bin.uri = file:/bin
+fs.mount.bin.type = chroot
+fs.mount.bin.path = /bin
+fs.mount.bin.uri = file:/bin
 
 # allow to bind on port 8000
 net.rules.1 = 127.0.0.1:8000:0.0.0.0:0-65535

+ 0 - 2
LibOS/shim/test/native/Makefile

@@ -9,8 +9,6 @@ target = $(exec_target) $(manifests)
 level = ../
 include ../Makefile
 
-CFLAGS-libos = -I$(SHIMDIR)/../include -L$(SHIMDIR)/../../glibc-build/libos
-
 ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
 $(c_executables): %: %.c
 	@echo [ $@ ]

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

@@ -1,5 +1,3 @@
-CFLAGS-libos = -L../../../build/libos -I../../include
-
 special_executables = bootstrap_static bootstrap_pie shared_object
 c_executables = $(filter-out $(special_executables),$(patsubst %.c,%,$(wildcard *.c)))
 cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))

+ 1 - 1
Runtime/pal_loader

@@ -16,7 +16,7 @@ if [ "$1" == "SGX" ]; then
 fi
 
 RUNTIME_DIR=$(/usr/bin/dirname $(readlink -f ${BASH_SOURCE[0]}))
-PAL_HOST=$(/usr/bin/make --quiet -f $RUNTIME_DIR/../Pal/src/Makefile.Host print_host 2>&1)
+PAL_HOST=$(/usr/bin/make --no-print-directory --quiet -f $RUNTIME_DIR/../Pal/src/Makefile.Host print_host 2>&1)
 
 MANIFEST=
 PREFIX=