summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Di Donato <[email protected]>2022-04-14 12:58:30 +0200
committerGitHub <[email protected]>2022-04-14 12:58:30 +0200
commita4723aca5f13984010556d190be7d8790406d678 (patch)
tree3facd790ba64a4284729a5aa02d7f4c13f44504f
parent23dd00c8f43b6c84a617578ae960e5d79f1735f5 (diff)
update(rules/platform/linux/bpf): enforce -O2 when compiling BPF
To avoid compiler optimizations messing up with generated IR and BPF instructions is paramount to enforce the optimization level to 2 disregarding the mode (whether it is set to debug or release etc.) Signed-off-by: Leonardo Di Donato <[email protected]>
-rw-r--r--xmake/rules/platform/linux/bpf/xmake.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/xmake/rules/platform/linux/bpf/xmake.lua b/xmake/rules/platform/linux/bpf/xmake.lua
index d2afd9160..b14e6a9a0 100644
--- a/xmake/rules/platform/linux/bpf/xmake.lua
+++ b/xmake/rules/platform/linux/bpf/xmake.lua
@@ -46,6 +46,7 @@ rule("platform.linux.bpf")
targetarch = "__TARGET_ARCH_powerpc"
end
target:add("includedirs", path.directory(headerfile))
+ target:set("optimize", "faster")
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}})