I try to build a app for target mips-linux-musl with soft float by zig 0.11.0. The below build script can not work.
var target = b.standardTargetOptions(.{});
const Features = std.Target.mips.Feature;
target.cpu_features_add.addFeature(@intFromEnum(Features.soft_float));
@dimdin thanks for you suggestion. But still not work, I don’t known if it is caused by the dynamic link.
const target = b.resolveTargetQuery(.{
.cpu_arch = .mips,
.os_tag = .linux,
.abi = .musl,
.cpu_features_add = std.Target.mips.featureSet(&[_]std.Target.mips.Feature{
.mips32, // select CPU model from mips1-5, mips32, mips32r2-6, etc.
.soft_float,
// more mips features here
}),
});
const exe = b.addExecutable(.{
.name = "zig_demo",
// In this case the main source file is merely a path, however, in more
// complicated build scripts, this could be a generated file.
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.linkage = .dynamic,
.optimize = optimize,
});
exe.linkLibC();