summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-04-17 10:03:58 +0800
committerGitHub <[email protected]>2022-04-17 10:03:58 +0800
commitac2caed605c01fca00db6f8d9c6be441e8e00f73 (patch)
tree7f36b86b269f0dbc4c0e0d75339250fdc02b7086
parentf5eb360c282156f9d03a1111b8c7fce9030fb1db (diff)
parent77ed9022bce7632272ed7f187f7a46774062def2 (diff)
Merge pull request #2269 from leodido/patch-1
update(rules/platform/linux/bpf): enforce -O2 when compiling BPF
-rw-r--r--xmake/rules/platform/linux/bpf/xmake.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/xmake/rules/platform/linux/bpf/xmake.lua b/xmake/rules/platform/linux/bpf/xmake.lua
index d2afd9160..d78693708 100644
--- a/xmake/rules/platform/linux/bpf/xmake.lua
+++ b/xmake/rules/platform/linux/bpf/xmake.lua
@@ -48,7 +48,7 @@ rule("platform.linux.bpf")
target:add("includedirs", path.directory(headerfile))
batchcmds:show_progress(opt.progress, "${color.build.object}compiling.bpf %s", sourcefile)
batchcmds:mkdir(path.directory(objectfile))
- batchcmds:compile(sourcefile, objectfile, {configs = {force = {cxflags = {"-target bpf", "-g"}}, defines = targetarch}})
+ batchcmds:compile(sourcefile, objectfile, {configs = {force = {cxflags = {"-target bpf", "-g", "-O2"}}, defines = targetarch}})
batchcmds:mkdir(path.directory(headerfile))
batchcmds:execv("bpftool", {"gen", "skeleton", objectfile}, {stdout = headerfile})
batchcmds:add_depfiles(sourcefile)