mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-06 13:51:28 +00:00
Add shared_object to test/native (#56)
This commit is contained in:
@@ -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 $@ $< \
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user