commit cb744f3a28cf5aa6caef797e9265b7165c903a55 (tree)
parent 71b4ee931eb2acd21576ee61c5b1bb6c7c9ae350
Author: Andrew Kelley <superjoe30@gmail.com>
Date: Tue, 20 Mar 2018 13:48:25 -0400
self-hosted build: print helpful message when libstdc++.a not found
closes #843
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/build.zig b/build.zig
@@ -64,6 +64,14 @@ pub fn build(b: &Builder) !void {
if (exe.target.getOs() == builtin.Os.linux) {
const libstdcxx_path_padded = try b.exec([][]const u8{cxx_compiler, "-print-file-name=libstdc++.a"});
const libstdcxx_path = ??mem.split(libstdcxx_path_padded, "\r\n").next();
+ if (mem.eql(u8, libstdcxx_path, "libstdc++.a")) {
+ warn(
+ \\Unable to determine path to libstdc++.a
+ \\On Fedora, install libstdc++-static and try again.
+ \\
+ );
+ return error.RequiredLibraryNotFound;
+ }
exe.addObjectFile(libstdcxx_path);
exe.linkSystemLibrary("pthread");