Merge branch 'freebsd-up' of https://github.com/myfreeweb/zig into freebsd2

This commit is contained in:
Andrew Kelley
2018-11-19 17:24:41 -05:00
30 changed files with 1757 additions and 67 deletions

View File

@@ -172,7 +172,7 @@ pub const LibCInstallation = struct {
try group.call(findNativeStaticLibDir, self, loop);
try group.call(findNativeDynamicLinker, self, loop);
},
builtin.Os.macosx => {
builtin.Os.macosx, builtin.Os.freebsd => {
self.include_dir = try std.mem.dupe(loop.allocator, u8, "/usr/include");
},
else => @compileError("unimplemented: find libc for this OS"),

View File

@@ -299,6 +299,13 @@ pub const Target = union(enum) {
pub fn getDynamicLinkerPath(self: Target) ?[]const u8 {
const env = self.getEnviron();
const arch = self.getArch();
const os = self.getOs();
switch (os) {
builtin.Os.freebsd => {
return "/libexec/ld-elf.so.1";
},
else => {},
}
switch (env) {
builtin.Environ.android => {
if (self.is64bit()) {
@@ -493,6 +500,7 @@ pub const Target = union(enum) {
builtin.Os.linux,
builtin.Os.macosx,
builtin.Os.freebsd,
builtin.Os.openbsd,
builtin.Os.zen,
=> switch (id) {
@@ -527,7 +535,6 @@ pub const Target = union(enum) {
builtin.Os.ananas,
builtin.Os.cloudabi,
builtin.Os.dragonfly,
builtin.Os.freebsd,
builtin.Os.fuchsia,
builtin.Os.ios,
builtin.Os.kfreebsd,