From 2bd6c60752bbfc568c1fdf358a68480ddd437def Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 19 Jun 2017 21:36:54 -0400 Subject: update for llvm 5.0.0rc1 --- src/link.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/link.cpp') diff --git a/src/link.cpp b/src/link.cpp index f031084409..b22b78c4f9 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -437,12 +437,26 @@ static void construct_linker_job_coff(LinkJob *lj) { } } if (buf_len(def_contents) != 0) { - Buf *dll_path = buf_alloc(); - os_path_join(g->cache_dir, buf_create_from_str("all.dll"), dll_path); - ZigLLDDefToLib(def_contents, dll_path); + Buf *def_path = buf_alloc(); + os_path_join(g->cache_dir, buf_create_from_str("all.def"), def_path); + os_write_file(def_path, def_contents); Buf *all_lib_path = buf_alloc(); os_path_join(g->cache_dir, buf_create_from_str("all.lib"), all_lib_path); + + //Buf *dll_path = buf_alloc(); + //os_path_join(g->cache_dir, buf_create_from_str("all.dll"), dll_path); + + ZigList args = {0}; + args.append("link"); + args.append(buf_ptr(buf_sprintf("-DEF:%s", buf_ptr(def_path)))); + args.append(buf_ptr(buf_sprintf("-OUT:%s", buf_ptr(all_lib_path)))); + Buf diag = BUF_INIT; + if (!ZigLLDLink(g->zig_target.oformat, args.items, args.length, &diag)) { + fprintf(stderr, "%s\n", buf_ptr(&diag)); + exit(1); + } + lj->args.append(buf_ptr(all_lib_path)); } @@ -732,6 +746,8 @@ static void construct_linker_job(LinkJob *lj) { return construct_linker_job_elf(lj); case ZigLLVM_MachO: return construct_linker_job_macho(lj); + case ZigLLVM_Wasm: + zig_panic("TODO link wasm"); } } -- cgit v1.2.3