aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/codegen.cpp4
-rw-r--r--src/config.h.in1
-rw-r--r--src/ir.cpp5
-rw-r--r--src/link.cpp1
-rw-r--r--src/zig_llvm.cpp11
5 files changed, 10 insertions, 12 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 8c5d7622cc..6fb8d4b8ef 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -456,10 +456,10 @@ static LLVMValueRef fn_llvm_value(CodeGen *g, FnTableEntry *fn_table_entry) {
LLVMSetLinkage(fn_table_entry->llvm_value, LLVMExternalLinkage);
break;
case GlobalLinkageIdWeak:
- LLVMSetLinkage(fn_table_entry->llvm_value, LLVMWeakAnyLinkage);
+ LLVMSetLinkage(fn_table_entry->llvm_value, LLVMWeakODRLinkage);
break;
case GlobalLinkageIdLinkOnce:
- LLVMSetLinkage(fn_table_entry->llvm_value, LLVMLinkOnceAnyLinkage);
+ LLVMSetLinkage(fn_table_entry->llvm_value, LLVMLinkOnceODRLinkage);
break;
}
diff --git a/src/config.h.in b/src/config.h.in
index 36bd66098b..a596213a3d 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -20,7 +20,6 @@
#define ZIG_DYNAMIC_LINKER "@ZIG_DYNAMIC_LINKER@"
#cmakedefine ZIG_EACH_LIB_RPATH
-#cmakedefine ZIG_LLVM_OLD_CXX_ABI
// Only used for running tests before installing.
#define ZIG_TEST_DIR "@CMAKE_SOURCE_DIR@/test"
diff --git a/src/ir.cpp b/src/ir.cpp
index 0879942b3e..787d58442e 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -15312,6 +15312,11 @@ static TypeTableEntry *ir_analyze_instruction_set_align_stack(IrAnalyze *ira, Ir
if (!ir_resolve_align(ira, align_bytes_inst, &align_bytes))
return ira->codegen->builtin_types.entry_invalid;
+ if (align_bytes > 256) {
+ ir_add_error(ira, &instruction->base, buf_sprintf("attempt to @setAlignStack(%" PRIu32 "); maximum is 256", align_bytes));
+ return ira->codegen->builtin_types.entry_invalid;
+ }
+
FnTableEntry *fn_entry = exec_fn_entry(ira->new_irb.exec);
if (fn_entry == nullptr) {
ir_add_error(ira, &instruction->base, buf_sprintf("@setAlignStack outside function"));
diff --git a/src/link.cpp b/src/link.cpp
index f2f21fd746..316c7bc761 100644
--- a/src/link.cpp
+++ b/src/link.cpp
@@ -38,6 +38,7 @@ static Buf *build_o_raw(CodeGen *parent_gen, const char *oname, Buf *full_path)
child_gen->want_h_file = false;
child_gen->verbose_link = parent_gen->verbose_link;
+ child_gen->verbose_ir = parent_gen->verbose_ir;
codegen_set_cache_dir(child_gen, parent_gen->cache_dir);
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index f82b1d5423..0e1a067bc6 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -5,15 +5,6 @@
* See http://opensource.org/licenses/MIT
*/
-// This must go before all includes.
-#include "config.h"
-#if defined(ZIG_LLVM_OLD_CXX_ABI)
-#define _GLIBCXX_USE_CXX11_ABI 0
-#endif
-
-
-#include "zig_llvm.hpp"
-
/*
* The point of this file is to contain all the LLVM C++ API interaction so that:
@@ -22,6 +13,8 @@
* 3. Prevent C++ from infecting the rest of the project.
*/
+#include "zig_llvm.hpp"
+
#include <llvm/Analysis/TargetLibraryInfo.h>
#include <llvm/Analysis/TargetTransformInfo.h>
#include <llvm/IR/DIBuilder.h>