commit
d694f298d8
|
@ -209,7 +209,7 @@ else()
|
|||
else()
|
||||
set(ZIG_LLD_COMPILE_FLAGS "-std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Wno-comment")
|
||||
if(MINGW)
|
||||
set(ZIG_LLD_COMPILE_FLAGS "${ZIG_LLD_COMPILE_FLAGS} -D__STDC_FORMAT_MACROS -D__USE_MINGW_ANSI_STDIO -Wno-pedantic-ms-format")
|
||||
set(ZIG_LLD_COMPILE_FLAGS "${ZIG_LLD_COMPILE_FLAGS} -D__STDC_FORMAT_MACROS -D__USE_MINGW_ANSI_STDIO")
|
||||
endif()
|
||||
endif()
|
||||
set_target_properties(embedded_lld_lib PROPERTIES
|
||||
|
@ -511,18 +511,22 @@ set(OPTIMIZED_C_FLAGS "-std=c99 -O3")
|
|||
|
||||
set(EXE_LDFLAGS " ")
|
||||
if(MSVC)
|
||||
set(EXE_LDFLAGS "/STACK:16777216")
|
||||
set(EXE_LDFLAGS "${EXE_LDFLAGS} /STACK:16777216")
|
||||
elseif(MINGW)
|
||||
set(EXE_LDFLAGS "${EXE_LDFLAGS} -Wl,--stack,16777216")
|
||||
endif()
|
||||
|
||||
if(ZIG_STATIC)
|
||||
if(APPLE)
|
||||
set(EXE_LDFLAGS "-static-libgcc -static-libstdc++")
|
||||
set(EXE_LDFLAGS "${EXE_LDFLAGS} -static-libgcc -static-libstdc++")
|
||||
elseif(MINGW)
|
||||
set(EXE_LDFLAGS "-static-libgcc -static-libstdc++ -Wl,-Bstatic,--whole-archive -lwinpthread -lz3 -lz -lgomp -Wl,--no-whole-archive")
|
||||
set(EXE_LDFLAGS "${EXE_LDFLAGS} -static-libgcc -static-libstdc++ -Wl,-Bstatic, -lwinpthread -lz3 -lz -lgomp")
|
||||
elseif(NOT MSVC)
|
||||
set(EXE_LDFLAGS "${EXE_LDFLAGS} -static")
|
||||
endif()
|
||||
else()
|
||||
set(EXE_LDFLAGS "-static")
|
||||
if(MINGW)
|
||||
set(EXE_LDFLAGS "${EXE_LDFLAGS} -lz3")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -559,11 +563,6 @@ if(NOT MSVC)
|
|||
target_link_libraries(compiler LINK_PUBLIC ${LIBXML2})
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
find_library(Z3_LIBRARIES NAMES z3 z3.dll)
|
||||
target_link_libraries(compiler LINK_PUBLIC ${Z3_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(ZIG_DIA_GUIDS_LIB)
|
||||
target_link_libraries(compiler LINK_PUBLIC ${ZIG_DIA_GUIDS_LIB})
|
||||
endif()
|
||||
|
|
10
std/coff.zig
10
std/coff.zig
|
@ -120,7 +120,15 @@ pub const Coff = struct {
|
|||
|
||||
pub fn getPdbPath(self: *Coff, buffer: []u8) !usize {
|
||||
try self.loadSections();
|
||||
const header = (self.getSection(".rdata") orelse return error.MissingCoffSection).header;
|
||||
const header = blk: {
|
||||
if (self.getSection(".buildid")) |section| {
|
||||
break :blk section.header;
|
||||
} else if (self.getSection(".rdata")) |section| {
|
||||
break :blk section.header;
|
||||
} else {
|
||||
return error.MissingCoffSection;
|
||||
}
|
||||
};
|
||||
|
||||
// The linker puts a chunk that contains the .pdb path right after the
|
||||
// debug_directory.
|
||||
|
|
Loading…
Reference in New Issue