From 6721e6f2e911e1573e8b636f840a1694a4754637 Mon Sep 17 00:00:00 2001 From: chenmingkai Date: Mon, 18 Mar 2024 20:33:20 +0800 Subject: [PATCH] [Sec] Add safe compilation options --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index 585b7cee..c9695f69 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,10 @@ ext1 = extension.NpuExtension( '-D__FILENAME__="$$(notdir $$(abspath $$<))"', "-fprofile-arcs", "-ftest-coverage", + "-fPIC", + "-fPIE -pie", + "-fstack-protector-all", + "-Wl,-z,relro,-z,now", ], libraries=["gcov"], ) -- Gitee