authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-02-19 08:39:36-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-02-19 08:39:36-05:00
logc9fb5240d6305bcef7db5e12b7676ba3d741c11e
tree486d3b17a280b14fa2e8f4dd6c76a99857380005
parent007a260cda93004c93ef1c6f2e6155cb043188b6
signaturelock-open Commit is signed but in an unrecognized format.

remove --no-rosegment workaround now that valgrind bug is fixed

See #896 Zig 0.3.0+ and Valgrind 3.14+ do not need the workaround.

7 files changed, 0 insertions(+), 37 deletions(-)

build.zig-4
...@@ -49,7 +49,6 @@ pub fn build(b: *Builder) !void {...@@ -49,7 +49,6 @@ pub fn build(b: *Builder) !void {
49 .c_header_files = nextValue(&index, build_info),49 .c_header_files = nextValue(&index, build_info),
50 .dia_guids_lib = nextValue(&index, build_info),50 .dia_guids_lib = nextValue(&index, build_info),
51 .llvm = undefined,51 .llvm = undefined,
52 .no_rosegment = b.option(bool, "no-rosegment", "Workaround to enable valgrind builds") orelse false,
53 };52 };
54 ctx.llvm = try findLLVM(b, ctx.llvm_config_exe);53 ctx.llvm = try findLLVM(b, ctx.llvm_config_exe);
5554
...@@ -289,8 +288,6 @@ fn nextValue(index: *usize, build_info: []const u8) []const u8 {...@@ -289,8 +288,6 @@ fn nextValue(index: *usize, build_info: []const u8) []const u8 {
289}288}
290289
291fn configureStage2(b: *Builder, exe: var, ctx: Context) !void {290fn configureStage2(b: *Builder, exe: var, ctx: Context) !void {
292 exe.setNoRoSegment(ctx.no_rosegment);
293
294 exe.addIncludeDir("src");291 exe.addIncludeDir("src");
295 exe.addIncludeDir(ctx.cmake_binary_dir);292 exe.addIncludeDir(ctx.cmake_binary_dir);
296 addCppLib(b, exe, ctx.cmake_binary_dir, "zig_cpp");293 addCppLib(b, exe, ctx.cmake_binary_dir, "zig_cpp");
...@@ -375,5 +372,4 @@ const Context = struct {...@@ -375,5 +372,4 @@ const Context = struct {
375 c_header_files: []const u8,372 c_header_files: []const u8,
376 dia_guids_lib: []const u8,373 dia_guids_lib: []const u8,
377 llvm: LibraryDep,374 llvm: LibraryDep,
378 no_rosegment: bool,
379};375};
src-self-hosted/link.zig-4
...@@ -145,10 +145,6 @@ fn constructLinkerArgsElf(ctx: *Context) !void {...@@ -145,10 +145,6 @@ fn constructLinkerArgsElf(ctx: *Context) !void {
145 // lj->args.append("-T");145 // lj->args.append("-T");
146 // lj->args.append(g->linker_script);146 // lj->args.append(g->linker_script);
147 //}147 //}
148
149 //if (g->no_rosegment_workaround) {
150 // lj->args.append("--no-rosegment");
151 //}
152 try ctx.args.append(c"--gc-sections");148 try ctx.args.append(c"--gc-sections");
153149
154 //lj->args.append("-m");150 //lj->args.append("-m");
src/all_types.hpp-1
...@@ -1819,7 +1819,6 @@ struct CodeGen {...@@ -1819,7 +1819,6 @@ struct CodeGen {
1819 bool is_single_threaded;1819 bool is_single_threaded;
1820 bool is_native_target;1820 bool is_native_target;
1821 bool linker_rdynamic;1821 bool linker_rdynamic;
1822 bool no_rosegment_workaround;
1823 bool each_lib_rpath;1822 bool each_lib_rpath;
1824 bool disable_pic;1823 bool disable_pic;
18251824
src/codegen.cpp-1
...@@ -8487,7 +8487,6 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) {...@@ -8487,7 +8487,6 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) {
8487 cache_bool(ch, g->is_single_threaded);8487 cache_bool(ch, g->is_single_threaded);
8488 cache_bool(ch, g->is_native_target);8488 cache_bool(ch, g->is_native_target);
8489 cache_bool(ch, g->linker_rdynamic);8489 cache_bool(ch, g->linker_rdynamic);
8490 cache_bool(ch, g->no_rosegment_workaround);
8491 cache_bool(ch, g->each_lib_rpath);8490 cache_bool(ch, g->each_lib_rpath);
8492 cache_bool(ch, g->disable_pic);8491 cache_bool(ch, g->disable_pic);
8493 cache_buf_opt(ch, g->mmacosx_version_min);8492 cache_buf_opt(ch, g->mmacosx_version_min);
src/link.cpp-3
...@@ -231,9 +231,6 @@ static void construct_linker_job_elf(LinkJob *lj) {...@@ -231,9 +231,6 @@ static void construct_linker_job_elf(LinkJob *lj) {
231 lj->args.append(g->linker_script);231 lj->args.append(g->linker_script);
232 }232 }
233233
234 if (g->no_rosegment_workaround) {
235 lj->args.append("--no-rosegment");
236 }
237 lj->args.append("--gc-sections");234 lj->args.append("--gc-sections");
238235
239 lj->args.append("-m");236 lj->args.append("-m");
src/main.cpp-5
...@@ -92,7 +92,6 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) {...@@ -92,7 +92,6 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) {
92 " -L[dir] alias for --library-path\n"92 " -L[dir] alias for --library-path\n"
93 " -rdynamic add all symbols to the dynamic symbol table\n"93 " -rdynamic add all symbols to the dynamic symbol table\n"
94 " -rpath [path] add directory to the runtime library search path\n"94 " -rpath [path] add directory to the runtime library search path\n"
95 " --no-rosegment compromise security to workaround valgrind bug\n"
96 " --subsystem [subsystem] (windows) /SUBSYSTEM:<subsystem> to the linker\n"95 " --subsystem [subsystem] (windows) /SUBSYSTEM:<subsystem> to the linker\n"
97 " -framework [name] (darwin) link against framework\n"96 " -framework [name] (darwin) link against framework\n"
98 " -mios-version-min [ver] (darwin) set iOS deployment target\n"97 " -mios-version-min [ver] (darwin) set iOS deployment target\n"
...@@ -393,7 +392,6 @@ int main(int argc, char **argv) {...@@ -393,7 +392,6 @@ int main(int argc, char **argv) {
393 BuildMode build_mode = BuildModeDebug;392 BuildMode build_mode = BuildModeDebug;
394 ZigList<const char *> test_exec_args = {0};393 ZigList<const char *> test_exec_args = {0};
395 int runtime_args_start = -1;394 int runtime_args_start = -1;
396 bool no_rosegment_workaround = false;
397 bool system_linker_hack = false;395 bool system_linker_hack = false;
398 TargetSubsystem subsystem = TargetSubsystemAuto;396 TargetSubsystem subsystem = TargetSubsystemAuto;
399 bool is_single_threaded = false;397 bool is_single_threaded = false;
...@@ -573,8 +571,6 @@ int main(int argc, char **argv) {...@@ -573,8 +571,6 @@ int main(int argc, char **argv) {
573 verbose_cimport = true;571 verbose_cimport = true;
574 } else if (strcmp(arg, "-rdynamic") == 0) {572 } else if (strcmp(arg, "-rdynamic") == 0) {
575 rdynamic = true;573 rdynamic = true;
576 } else if (strcmp(arg, "--no-rosegment") == 0) {
577 no_rosegment_workaround = true;
578 } else if (strcmp(arg, "--each-lib-rpath") == 0) {574 } else if (strcmp(arg, "--each-lib-rpath") == 0) {
579 each_lib_rpath = true;575 each_lib_rpath = true;
580 } else if (strcmp(arg, "-ftime-report") == 0) {576 } else if (strcmp(arg, "-ftime-report") == 0) {
...@@ -977,7 +973,6 @@ int main(int argc, char **argv) {...@@ -977,7 +973,6 @@ int main(int argc, char **argv) {
977 }973 }
978974
979 codegen_set_rdynamic(g, rdynamic);975 codegen_set_rdynamic(g, rdynamic);
980 g->no_rosegment_workaround = no_rosegment_workaround;
981 if (mmacosx_version_min && mios_version_min) {976 if (mmacosx_version_min && mios_version_min) {
982 fprintf(stderr, "-mmacosx-version-min and -mios-version-min options not allowed together\n");977 fprintf(stderr, "-mmacosx-version-min and -mios-version-min options not allowed together\n");
983 return EXIT_FAILURE;978 return EXIT_FAILURE;
std/build.zig-19
...@@ -851,7 +851,6 @@ pub const LibExeObjStep = struct {...@@ -851,7 +851,6 @@ pub const LibExeObjStep = struct {
851 disable_libc: bool,851 disable_libc: bool,
852 frameworks: BufSet,852 frameworks: BufSet,
853 verbose_link: bool,853 verbose_link: bool,
854 no_rosegment: bool,
855 c_std: Builder.CStd,854 c_std: Builder.CStd,
856855
857 // zig only stuff856 // zig only stuff
...@@ -924,7 +923,6 @@ pub const LibExeObjStep = struct {...@@ -924,7 +923,6 @@ pub const LibExeObjStep = struct {
924923
925 fn initExtraArgs(builder: *Builder, name: []const u8, root_src: ?[]const u8, kind: Kind, static: bool, ver: Version) LibExeObjStep {924 fn initExtraArgs(builder: *Builder, name: []const u8, root_src: ?[]const u8, kind: Kind, static: bool, ver: Version) LibExeObjStep {
926 var self = LibExeObjStep{925 var self = LibExeObjStep{
927 .no_rosegment = false,
928 .strip = false,926 .strip = false,
929 .builder = builder,927 .builder = builder,
930 .verbose_link = false,928 .verbose_link = false,
...@@ -967,7 +965,6 @@ pub const LibExeObjStep = struct {...@@ -967,7 +965,6 @@ pub const LibExeObjStep = struct {
967965
968 fn initC(builder: *Builder, name: []const u8, kind: Kind, version: Version, static: bool) LibExeObjStep {966 fn initC(builder: *Builder, name: []const u8, kind: Kind, version: Version, static: bool) LibExeObjStep {
969 var self = LibExeObjStep{967 var self = LibExeObjStep{
970 .no_rosegment = false,
971 .builder = builder,968 .builder = builder,
972 .name = name,969 .name = name,
973 .kind = kind,970 .kind = kind,
...@@ -1009,10 +1006,6 @@ pub const LibExeObjStep = struct {...@@ -1009,10 +1006,6 @@ pub const LibExeObjStep = struct {
1009 return self;1006 return self;
1010 }1007 }
10111008
1012 pub fn setNoRoSegment(self: *LibExeObjStep, value: bool) void {
1013 self.no_rosegment = value;
1014 }
1015
1016 fn computeOutFileNames(self: *LibExeObjStep) void {1009 fn computeOutFileNames(self: *LibExeObjStep) void {
1017 switch (self.kind) {1010 switch (self.kind) {
1018 Kind.Obj => {1011 Kind.Obj => {
...@@ -1382,9 +1375,6 @@ pub const LibExeObjStep = struct {...@@ -1382,9 +1375,6 @@ pub const LibExeObjStep = struct {
1382 }1375 }
1383 }1376 }
13841377
1385 if (self.no_rosegment) {
1386 try zig_args.append("--no-rosegment");
1387 }
1388 if (self.system_linker_hack) {1378 if (self.system_linker_hack) {
1389 try zig_args.append("--system-linker-hack");1379 try zig_args.append("--system-linker-hack");
1390 }1380 }
...@@ -1704,7 +1694,6 @@ pub const TestStep = struct {...@@ -1704,7 +1694,6 @@ pub const TestStep = struct {
1704 lib_paths: ArrayList([]const u8),1694 lib_paths: ArrayList([]const u8),
1705 packages: ArrayList(Pkg),1695 packages: ArrayList(Pkg),
1706 object_files: ArrayList([]const u8),1696 object_files: ArrayList([]const u8),
1707 no_rosegment: bool,
1708 output_path: ?[]const u8,1697 output_path: ?[]const u8,
1709 system_linker_hack: bool,1698 system_linker_hack: bool,
1710 override_std_dir: ?[]const u8,1699 override_std_dir: ?[]const u8,
...@@ -1726,17 +1715,12 @@ pub const TestStep = struct {...@@ -1726,17 +1715,12 @@ pub const TestStep = struct {
1726 .lib_paths = ArrayList([]const u8).init(builder.allocator),1715 .lib_paths = ArrayList([]const u8).init(builder.allocator),
1727 .packages = ArrayList(Pkg).init(builder.allocator),1716 .packages = ArrayList(Pkg).init(builder.allocator),
1728 .object_files = ArrayList([]const u8).init(builder.allocator),1717 .object_files = ArrayList([]const u8).init(builder.allocator),
1729 .no_rosegment = false,
1730 .output_path = null,1718 .output_path = null,
1731 .system_linker_hack = false,1719 .system_linker_hack = false,
1732 .override_std_dir = null,1720 .override_std_dir = null,
1733 };1721 };
1734 }1722 }
17351723
1736 pub fn setNoRoSegment(self: *TestStep, value: bool) void {
1737 self.no_rosegment = value;
1738 }
1739
1740 pub fn addLibPath(self: *TestStep, path: []const u8) void {1724 pub fn addLibPath(self: *TestStep, path: []const u8) void {
1741 self.lib_paths.append(path) catch unreachable;1725 self.lib_paths.append(path) catch unreachable;
1742 }1726 }
...@@ -1938,9 +1922,6 @@ pub const TestStep = struct {...@@ -1938,9 +1922,6 @@ pub const TestStep = struct {
1938 zig_args.append("--pkg-end") catch unreachable;1922 zig_args.append("--pkg-end") catch unreachable;
1939 }1923 }
19401924
1941 if (self.no_rosegment) {
1942 try zig_args.append("--no-rosegment");
1943 }
1944 if (self.system_linker_hack) {1925 if (self.system_linker_hack) {
1945 try zig_args.append("--system-linker-hack");1926 try zig_args.append("--system-linker-hack");
1946 }1927 }