| author | |
| committer | |
| log | c166c49b1917bb682d6949150feb59e54d6c0b2d |
| tree | 0048e3bc334b5b6f1a705632a90037cd0688694d |
| parent | dde76ae5f7f74f9173650d4b420ed44e183b1337 |
| signature |
2 files changed, 14 insertions(+), 2 deletions(-)
CMakeLists.txt+1-1| ... | ... | @@ -609,7 +609,7 @@ else() |
| 609 | 609 | set(ZIG1_COMPILE_FLAGS "-std=c99 -Os -fno-strict-aliasing") |
| 610 | 610 | set(ZIG2_COMPILE_FLAGS "-std=c99 -O0 -fno-sanitize=undefined -fno-stack-protector -fno-strict-aliasing") |
| 611 | 611 | # Must match the condition in build.zig. |
| 612 | if(ZIG_HOST_TARGET_ARCH MATCHES "^(arm|thumb)(eb)?$" OR ZIG_HOST_TARGET_ARCH MATCHES "^powerpc(64)?(le)?$") | |
| 612 | if(ZIG_HOST_TARGET_ARCH MATCHES "^(arm|thumb)(eb)?$" OR ZIG_HOST_TARGET_ARCH EQUAL "hexagon" OR ZIG_HOST_TARGET_ARCH MATCHES "^powerpc(64)?(le)?$") | |
| 613 | 613 | set(ZIG1_COMPILE_FLAGS "${ZIG1_COMPILE_FLAGS} -ffunction-sections -fdata-sections") |
| 614 | 614 | set(ZIG2_COMPILE_FLAGS "${ZIG2_COMPILE_FLAGS} -ffunction-sections -fdata-sections") |
| 615 | 615 | endif() |
build.zig+13-1| ... | ... | @@ -780,7 +780,19 @@ fn addCompilerStep(b: *std.Build, options: AddCompilerModOptions) *std.Build.Ste |
| 780 | 780 | exe.stack_size = stack_size; |
| 781 | 781 | |
| 782 | 782 | // Must match the condition in CMakeLists.txt. |
| 783 | const function_data_sections = options.target.result.cpu.arch.isArm() or options.target.result.cpu.arch.isPowerPC(); | |
| 783 | const function_data_sections = switch (options.target.result.cpu.arch) { | |
| 784 | .arm, | |
| 785 | .armeb, | |
| 786 | .thumb, | |
| 787 | .thumbeb, | |
| 788 | .hexagon, | |
| 789 | .powerpc, | |
| 790 | .powerpcle, | |
| 791 | .powerpc64, | |
| 792 | .powerpc64le, | |
| 793 | => true, | |
| 794 | else => false, | |
| 795 | }; | |
| 784 | 796 | |
| 785 | 797 | exe.link_function_sections = function_data_sections; |
| 786 | 798 | exe.link_data_sections = function_data_sections; |