aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-02-07 11:40:56 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-02-07 11:40:56 -0500
commit2b2bf53a49616192e2b2bdf40b88400964ff1500 (patch)
treebffb0aca261dfcbcc4e7e227c97c083dde0de16b /src
parenta0590bda29cc4e0882eda907cfb84df4f46767a6 (diff)
downloadzig-2b2bf53a49616192e2b2bdf40b88400964ff1500.tar.gz
zig-2b2bf53a49616192e2b2bdf40b88400964ff1500.zip
better error message when LLVM does not understand a triple
Diffstat (limited to 'src')
-rw-r--r--src/codegen.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index c5de05e372..f010430e14 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -7553,7 +7553,13 @@ static void init(CodeGen *g) {
LLVMTargetRef target_ref;
char *err_msg = nullptr;
if (LLVMGetTargetFromTriple(buf_ptr(&g->triple_str), &target_ref, &err_msg)) {
- zig_panic("unable to create target based on: %s", buf_ptr(&g->triple_str));
+ fprintf(stderr,
+ "Zig is expecting LLVM to understand this target: '%s'\n"
+ "However LLVM responded with: \"%s\"\n"
+ "Zig is unable to continue. This is a bug in Zig:\n"
+ "https://github.com/ziglang/zig/issues/438\n"
+ , buf_ptr(&g->triple_str), err_msg);
+ exit(1);
}
bool is_optimized = g->build_mode != BuildModeDebug;