diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-07-21 12:45:32 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-07-21 12:45:32 -0700 |
| commit | 36295d712fbd561c3de9b3eb46e776d63e646e9a (patch) | |
| tree | 9fadd735b548a1d2d2282e9abe0a30b57e21e728 /src/main.zig | |
| parent | 26984852bdfdbe3564b19f3ff7b3ecfd606c9902 (diff) | |
| download | zig-36295d712fbd561c3de9b3eb46e776d63e646e9a.tar.gz zig-36295d712fbd561c3de9b3eb46e776d63e646e9a.zip | |
remove 'pe' object format
Portable Executable is an executable format, not an object format.
Everywhere in the entire zig codebase, we treated coff and pe as if they
were the same. Remove confusion by not including pe in the
std.Target.ObjectFormat enum.
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/main.zig b/src/main.zig index 3b62bba410..9a51eba5f6 100644 --- a/src/main.zig +++ b/src/main.zig @@ -287,9 +287,9 @@ const usage_build_generic = \\ .s Target-specific assembly source code \\ .S Assembly with C preprocessor (requires LLVM extensions) \\ .c C source code (requires LLVM extensions) - \\ .cpp C++ source code (requires LLVM extensions) - \\ Other C++ extensions: .C .cc .cxx + \\ .cxx .cc .C .cpp C++ source code (requires LLVM extensions) \\ .m Objective-C source code (requires LLVM extensions) + \\ .bc LLVM IR Module (requires LLVM extensions) \\ \\General Options: \\ -h, --help Print this help and exit @@ -361,13 +361,12 @@ const usage_build_generic = \\ elf Executable and Linking Format \\ c Compile to C source code \\ wasm WebAssembly - \\ pe Portable Executable (Windows) \\ coff Common Object File Format (Windows) \\ macho macOS relocatables \\ spirv Standard, Portable Intermediate Representation V (SPIR-V) \\ plan9 Plan 9 from Bell Labs object format - \\ hex (planned) Intel IHEX - \\ raw (planned) Dump machine code directly + \\ hex (planned feature) Intel IHEX + \\ raw (planned feature) Dump machine code directly \\ -dirafter [dir] Add directory to AFTER include search path \\ -isystem [dir] Add directory to SYSTEM include search path \\ -I[dir] Add directory to include search path @@ -1708,8 +1707,6 @@ fn buildOutputType( break :blk .c; } else if (mem.eql(u8, ofmt, "coff")) { break :blk .coff; - } else if (mem.eql(u8, ofmt, "pe")) { - break :blk .pe; } else if (mem.eql(u8, ofmt, "macho")) { break :blk .macho; } else if (mem.eql(u8, ofmt, "wasm")) { @@ -1753,7 +1750,7 @@ fn buildOutputType( }; const a_out_basename = switch (object_format) { - .pe, .coff => "a.exe", + .coff => "a.exe", else => "a.out", }; @@ -2396,11 +2393,8 @@ fn updateModule(gpa: *Allocator, comp: *Compilation, hook: AfterUpdateHook) !voi // If a .pdb file is part of the expected output, we must also copy // it into place here. - const coff_or_pe = switch (comp.bin_file.options.object_format) { - .coff, .pe => true, - else => false, - }; - const have_pdb = coff_or_pe and !comp.bin_file.options.strip; + const is_coff = comp.bin_file.options.object_format == .coff; + const have_pdb = is_coff and !comp.bin_file.options.strip; if (have_pdb) { // Replace `.out` or `.exe` with `.pdb` on both the source and destination const src_bin_ext = fs.path.extension(bin_sub_path); |
