add lto and fpic

learning about linkers. Thanks, Drepper
This commit is contained in:
Motiejus Jakštys 2022-11-30 11:56:02 +02:00
parent 0df7d8b722
commit 312e510eff

View File

@ -43,6 +43,7 @@ pub fn build(b: *zbs.Builder) void {
//"-DDEBUG",
});
cmph.strip = strip;
cmph.want_lto = true;
cmph.compress_debug_sections = .zlib;
cmph.omit_frame_pointer = true;
cmph.addIncludePath("deps/cmph/src");
@ -60,16 +61,19 @@ pub fn build(b: *zbs.Builder) void {
"-W",
"-Wno-unused-function",
"-fvisibility=hidden",
"-fpic",
//"-DDEBUG",
});
bdz.omit_frame_pointer = true;
bdz.addIncludePath("deps/cmph/src");
bdz.addIncludePath("include/deps/cmph");
bdz.want_lto = true;
{
const exe = b.addExecutable("turbonss-unix2db", "src/turbonss-unix2db.zig");
exe.compress_debug_sections = .zlib;
exe.strip = strip;
exe.want_lto = true;
exe.setTarget(target);
exe.setBuildMode(mode);
addCmphDeps(exe, cmph);
@ -80,6 +84,7 @@ pub fn build(b: *zbs.Builder) void {
const exe = b.addExecutable("turbonss-analyze", "src/turbonss-analyze.zig");
exe.compress_debug_sections = .zlib;
exe.strip = strip;
exe.want_lto = true;
exe.setTarget(target);
exe.setBuildMode(mode);
exe.install();
@ -89,6 +94,7 @@ pub fn build(b: *zbs.Builder) void {
const exe = b.addExecutable("turbonss-makecorpus", "src/turbonss-makecorpus.zig");
exe.compress_debug_sections = .zlib;
exe.strip = strip;
exe.want_lto = true;
exe.setTarget(target);
exe.setBuildMode(mode);
exe.install();
@ -98,6 +104,7 @@ pub fn build(b: *zbs.Builder) void {
const exe = b.addExecutable("turbonss-getent", "src/turbonss-getent.zig");
exe.compress_debug_sections = .zlib;
exe.strip = strip;
exe.want_lto = true;
exe.linkLibC();
exe.linkLibrary(bdz);
exe.addIncludePath("deps/cmph/src");
@ -116,6 +123,7 @@ pub fn build(b: *zbs.Builder) void {
});
so.compress_debug_sections = .zlib;
so.strip = strip;
so.want_lto = true;
so.linkLibC();
so.linkLibrary(bdz);
so.addIncludePath("deps/cmph/src");