Hi.

This is my proposal to fix this bug.
(to be applied with "git am").

The only problem is that salsa has a version 2.6.0+dfsg-6
which is unreleased and I don't know how that should be handled.

Thanks.
From c2a627c84888f454ec3b9c1a08025955583656a4 Mon Sep 17 00:00:00 2001
From: Santiago Vila <sanv...@debian.org>
Date: Wed, 9 Apr 2025 13:34:26 +0200
Subject: [PATCH] Disable non-portable flags. Closes: #1102472.

Thanks to Adrian Bunk.
---
 .../2310-disable-non-portable-flags.patch     | 21 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 22 insertions(+)
 create mode 100644 debian/patches/2310-disable-non-portable-flags.patch

diff --git a/debian/patches/2310-disable-non-portable-flags.patch b/debian/patches/2310-disable-non-portable-flags.patch
new file mode 100644
index 00000000..2c3b23a8
--- /dev/null
+++ b/debian/patches/2310-disable-non-portable-flags.patch
@@ -0,0 +1,21 @@
+Description: Disable non-portable flags
+Author: Santiago Vila <sanv...@debian.org>
+Bug-Debian: https://bugs.debian.org/1102472
+Last-Update: 2025-04-09
+
+--- a/torch/_inductor/cpp_builder.py
++++ b/torch/_inductor/cpp_builder.py
+@@ -547,13 +547,6 @@
+             # on macos, unknown argument: '-fno-tree-loop-vectorize'
+             if _is_gcc(cpp_compiler):
+                 cflags.append("fno-tree-loop-vectorize")
+-            # https://stackoverflow.com/questions/65966969/why-does-march-native-not-work-on-apple-m1
+-            # `-march=native` is unrecognized option on M1
+-            if not config.is_fbcode():
+-                if platform.machine() == "ppc64le":
+-                    cflags.append("mcpu=native")
+-                else:
+-                    cflags.append("march=native")
+ 
+         return cflags
+ 
diff --git a/debian/patches/series b/debian/patches/series
index bd20a540..cdd55b7e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,3 +13,4 @@
 2210-disable-fno-math-errno-on-arm64-to-workaround-gcc14-bug.patch
 2220-disable-sve-on-arm64.patch
 2300-torch-cuda-no-use-nvtx3.patch
+2310-disable-non-portable-flags.patch
-- 
2.39.5

Reply via email to