Add shared_object to test/native (#56)

This commit is contained in:
adombeck
2018-05-26 16:31:41 -07:00
committed by Chia-Che Tsai
parent 2b487b093f
commit 68c994d450
3 changed files with 29 additions and 1 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
special_executables = static pie
special_executables = static pie shared_object
c_executables = $(filter-out $(special_executables),$(patsubst %.c,%,$(wildcard *.c)))
cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
manifests = $(patsubst %.template,%,$(wildcard *.manifest.template)) manifest
@@ -27,6 +27,11 @@ static: %: %.c
@$(CC) $(CFLAGS) -o $@ -static $< \
$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
shared_object: %: %.c
@echo [ $@ ]
@$(CC) $(CFLAGS) -o $@ -fPIC -pie $< \
$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
pie: %: %.c
@echo [ $@ ]
@$(CC) $(CFLAGS) -fPIC --pie -o $@ $< \
+12
View File
@@ -0,0 +1,12 @@
/* -*- mode:c; c-file-style:"k&r"; c-basic-offset: 4; tab-width:4; indent-tabs-mode:nil; mode:auto-fill; fill-column:78; -*- */
/* vim: set ts=4 sw=4 et tw=78 fo=cqt wm=0: */
/* a simple helloworld test */
#include <stdio.h>
int main()
{
printf("Hello world\n");
return 0;
}
@@ -0,0 +1,11 @@
loader.preload = file:$(SHIMPATH)
loader.env.LD_LIBRARY_PATH = /lib
loader.debug_type = inline
fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(LIBCDIR)
sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6