From: Waldemar Kozaczuk <[email protected]>
Committer: Waldemar Kozaczuk <[email protected]>
Branch: master

native-example: add statically linked executables

Signed-off-by: Waldemar Kozaczuk <[email protected]>

---
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

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/0000000000004b15c5060e8ce6a2%40google.com.

Reply via email to