diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-04-07 07:51:39 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-04-07 07:54:47 -0700 |
| commit | b086b7da9e9adbb4445363f635d3bb37177b2f18 (patch) | |
| tree | e288dc1b7191c94b74a2f300524bfbd1d7459d37 /src/Compilation.zig | |
| parent | 1fdea551b22726783356c5bed90bce63706b550f (diff) | |
| download | zig-b086b7da9e9adbb4445363f635d3bb37177b2f18.tar.gz zig-b086b7da9e9adbb4445363f635d3bb37177b2f18.zip | |
zig cc: complete the -wrap flag implementation
* use a set instead of a list
* use of this flag currently requires LLD
* add documentation
* make it only a zig cc compatibility flag for now because I personally
think this is an anti-feature.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index e1e665c192..f6f4851e5e 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -494,7 +494,7 @@ pub const InitOptions = struct { clang_argv: []const []const u8 = &[0][]const u8{}, lib_dirs: []const []const u8 = &[0][]const u8{}, rpath_list: []const []const u8 = &[0][]const u8{}, - wrap_list: []const []const u8 = &[0][]const u8{}, + symbol_wrap_set: std.StringArrayHashMapUnmanaged(void) = .{}, c_source_files: []const CSourceFile = &[0]CSourceFile{}, link_objects: []LinkObject = &[0]LinkObject{}, framework_dirs: []const []const u8 = &[0][]const u8{}, @@ -826,7 +826,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { options.output_mode == .Lib or options.linker_script != null or options.version_script != null or options.emit_implib != null or - build_id) + build_id or + options.symbol_wrap_set.count() > 0) { break :blk true; } @@ -1439,7 +1440,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { .wasi_emulated_libs = options.wasi_emulated_libs, .lib_dirs = options.lib_dirs, .rpath_list = options.rpath_list, - .wrap_list = options.wrap_list, + .symbol_wrap_set = options.symbol_wrap_set, .strip = strip, .is_native_os = options.is_native_os, .is_native_abi = options.is_native_abi, @@ -2261,7 +2262,7 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes man.hash.add(comp.bin_file.options.rdynamic); man.hash.addListOfBytes(comp.bin_file.options.lib_dirs); man.hash.addListOfBytes(comp.bin_file.options.rpath_list); - man.hash.addListOfBytes(comp.bin_file.options.wrap_list); + man.hash.addListOfBytes(comp.bin_file.options.symbol_wrap_set.keys()); man.hash.add(comp.bin_file.options.each_lib_rpath); man.hash.add(comp.bin_file.options.build_id); man.hash.add(comp.bin_file.options.skip_linker_dependencies); |
