File: 2210-disable-fno-math-errno-on-arm64-to-workaround-gcc14-bug.patch

package info (click to toggle)
pytorch-cuda 2.6.0%2Bdfsg-7
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid, trixie
  • size: 161,620 kB
  • sloc: python: 1,278,832; cpp: 900,322; ansic: 82,710; asm: 7,754; java: 3,363; sh: 2,811; javascript: 2,443; makefile: 597; ruby: 195; xml: 84; objc: 68
file content (21 lines) | stat: -rw-r--r-- 1,092 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Description: Disable -fno-math-errno on arm64 to workaroun gcc 14 bug (#1094828)
Author: Shengqi Chen <harry@debian.org>
Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118892
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1094828
Last-Update: 2025-02-18 
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: pytorch/CMakeLists.txt
===================================================================
--- pytorch.orig/CMakeLists.txt
+++ pytorch/CMakeLists.txt
@@ -1092,7 +1092,9 @@ if(NOT MSVC)
     string(APPEND CMAKE_CXX_FLAGS_DEBUG " -fno-omit-frame-pointer -O0")
     string(APPEND CMAKE_LINKER_FLAGS_DEBUG " -fno-omit-frame-pointer -O0")
   endif()
+  if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU")
   append_cxx_flag_if_supported("-fno-math-errno" CMAKE_CXX_FLAGS)
+  endif()
   append_cxx_flag_if_supported("-fno-trapping-math" CMAKE_CXX_FLAGS)
   append_cxx_flag_if_supported("-Werror=format" CMAKE_CXX_FLAGS)
   if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13)