From: Waldemar Kozaczuk <
jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <
jwkoz...@gmail.com>
Branch: master
native-example: add statically linked executables
Signed-off-by: Waldemar Kozaczuk <
jwkoz...@gmail.com>
---
diff --git a/native-example/Makefile b/native-example/Makefile
--- a/native-example/Makefile
+++ b/native-example/Makefile
@@ -1,10 +1,16 @@
.PHONY: module
-module: hello
+module: hello hello-static-pie hello-static-non-pie
CFLAGS = -std=gnu99 -fpie -rdynamic
hello: hello.c
$(CC) -pie -o $@ $(CFLAGS) $(LDFLAGS) hello.c
+hello-static-pie: hello.c
+ $(CC) -fPIE -static-pie -o hello-static-pie hello.c
+
+hello-static-non-pie: hello.c
+ $(CC) -static -o hello-static-non-pie hello.c
+
clean:
- rm -f hello
+ rm -f hello hello-static-pie hello-static-non-pie
diff --git a/native-example/usr.manifest b/native-example/usr.manifest
--- a/native-example/usr.manifest
+++ b/native-example/usr.manifest
@@ -1 +1,3 @@
/hello: ${MODULE_DIR}/hello
+/hello-static-pie: ${MODULE_DIR}/hello-static-pie
+/hello-static-non-pie: ${MODULE_DIR}/hello-static-non-pie