From afc1ae1481601feb6ef75cdfc0695f9a1c2c8622 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Fri, 4 Apr 2025 10:22:21 +0800 Subject: [PATCH] mipsel: build: Fix -z execstack link error --- src/build/config/compiler/BUILD.gn | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/build/config/compiler/BUILD.gn b/src/build/config/compiler/BUILD.gn index deabff7236..6b77768882 100644 --- a/src/build/config/compiler/BUILD.gn +++ b/src/build/config/compiler/BUILD.gn @@ -1105,10 +1105,18 @@ config("linker") { } if (is_linux || is_chromeos || is_android || is_fuchsia) { - ldflags += [ - "-Wl,-z,noexecstack", - "-Wl,-z,relro", - ] + if (current_cpu != "mipsel" && current_cpu != "mips64el") { + ldflags += [ + "-Wl,-z,noexecstack", + "-Wl,-z,relro", + ] + } else { + ldflags += [ + # https://github.com/llvm/llvm-project/pull/124068 + "-Wl,-z,execstack", + "-Wl,-z,relro", + ] + } if (!is_component_build) { ldflags += [ "-Wl,-z,now" ]