skylark/Makefile-Use-strip-option-in-gcc.patch
Dongxu Sun c45c975504 docs/Makefile: Update README.md and Makefile
docs: Use chinese description instead of English in README.md
Makefile: Use strip option in gcc

Signed-off-by: Dongxu Sun <sundongxu3@huawei.com>
2022-12-09 09:59:42 +08:00

33 lines
1.0 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From d3d934e6358ba214bfbc81e12d6f38d287d2bc45 Mon Sep 17 00:00:00 2001
From: Dongxu Sun <sundongxu3@huawei.com>
Date: Thu, 8 Dec 2022 09:23:09 +0000
Subject: [PATCH 2/2] Makefile: Use strip option in gcc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Add -s in gcc compile options and remove -g options
to keep skylark security and reduce binary file size.
Signed-off-by: sundongxu <sundongxu3@huawei.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index cc00862..f2c0a80 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ skylarkd: *.py */*.py
mv ../skylarkd .
libskylarkmsr.so: data_collector/get_msr.c
- gcc --share -fPIC -g -o libskylarkmsr.so data_collector/get_msr.c
+ gcc --share -fPIC -s -o libskylarkmsr.so data_collector/get_msr.c
install: skylarkd libskylarkmsr.so skylarkd.service skylarkd.sysconfig low_prio_machine.slice high_prio_machine.slice
install -T -D skylarkd $(DESTDIR)/usr/sbin/skylarkd
--
2.27.0