authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-10-09 22:07:05+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-10-09 22:44:36+02:00
log9ae293ae3bda918280a9ee254685ec9468e7d141
tree0963a93fc056a767fc3e73a6abb71678782684be
parentf83bb3dd9e68899ca39cdddb7d84c2ad1c833d55

Remove x86/Windows name mangling hack

Let's fix this properly by generating the correct lib files from the mingw sources.

2 files changed, 6 insertions(+), 12 deletions(-)

lib/std/special/compiler_rt.zig+6-4
...@@ -250,10 +250,12 @@ comptime {...@@ -250,10 +250,12 @@ comptime {
250250
251 switch (builtin.arch) {251 switch (builtin.arch) {
252 .i386 => {252 .i386 => {
253 @export("_alldiv", @import("compiler_rt/aulldiv.zig")._alldiv, strong_linkage);253 // Don't let LLVM apply the stdcall name mangling on those MSVC
254 @export("_aulldiv", @import("compiler_rt/aulldiv.zig")._aulldiv, strong_linkage);254 // builtin functions
255 @export("_allrem", @import("compiler_rt/aullrem.zig")._allrem, strong_linkage);255 @export("\x01__alldiv", @import("compiler_rt/aulldiv.zig")._alldiv, strong_linkage);
256 @export("_aullrem", @import("compiler_rt/aullrem.zig")._aullrem, strong_linkage);256 @export("\x01__aulldiv", @import("compiler_rt/aulldiv.zig")._aulldiv, strong_linkage);
257 @export("\x01__allrem", @import("compiler_rt/aullrem.zig")._allrem, strong_linkage);
258 @export("\x01__aullrem", @import("compiler_rt/aullrem.zig")._aullrem, strong_linkage);
257259
258 @export("__divti3", @import("compiler_rt/divti3.zig").__divti3, linkage);260 @export("__divti3", @import("compiler_rt/divti3.zig").__divti3, linkage);
259 @export("__modti3", @import("compiler_rt/modti3.zig").__modti3, linkage);261 @export("__modti3", @import("compiler_rt/modti3.zig").__modti3, linkage);
src/codegen.cpp-8
...@@ -415,16 +415,8 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) {...@@ -415,16 +415,8 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) {
415415
416 bool external_linkage = linkage != GlobalLinkageIdInternal;416 bool external_linkage = linkage != GlobalLinkageIdInternal;
417 CallingConvention cc = fn->type_entry->data.fn.fn_type_id.cc;417 CallingConvention cc = fn->type_entry->data.fn.fn_type_id.cc;
418 if (cc == CallingConventionStdcall && external_linkage &&
419 g->zig_target->arch == ZigLLVM_x86)
420 {
421 // prevent llvm name mangling
422 symbol_name = buf_ptr(buf_sprintf("\x01_%s", symbol_name));
423 }
424
425 bool is_async = fn_is_async(fn);418 bool is_async = fn_is_async(fn);
426419
427
428 ZigType *fn_type = fn->type_entry;420 ZigType *fn_type = fn->type_entry;
429 // Make the raw_type_ref populated421 // Make the raw_type_ref populated
430 resolve_llvm_types_fn(g, fn);422 resolve_llvm_types_fn(g, fn);