diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 6d99ff07dd2a7..bc8b5963a32c1 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1626,7 +1626,8 @@ def generate_build_tree( "-pipe", "-ggdb3", ] - if is_linux() and platform.machine() == "x86_64": + cross_arm = args.arm64 or args.arm64ec or args.arm + if is_linux() and platform.machine() == "x86_64" and not cross_arm: # The following flags needs GCC 8 and newer cflags += ["-fstack-clash-protection"] if not args.rv64: