File: fix-dpkg-buildflags-on-c-c%2B%2B.patch

package info (click to toggle)
python-escript 5.6-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 144,304 kB
  • sloc: python: 592,074; cpp: 136,909; ansic: 18,675; javascript: 9,411; xml: 3,384; sh: 738; makefile: 207
file content (31 lines) | stat: -rw-r--r-- 1,603 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Description: false postive for different build flags
  Do not support different different dpkg-buildflags for C vs C++
  In fact, there is no implicit-function-security support for cxxflags,
  So add `-Werror=implicit-function-declaration` into cxxflags.
  But it was still failed is following:
  cxxflags: -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=form
at-security -fcf-protection -Wno-uninitialized -Werror=implicit-function-declaration

  cflags:   -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-
clash-protection -Wformat -Werror=format-security -fcf-protection -Wno-uninitialized
 so sorted them can fix the issue.

Author: Bo YU <tsu.yubo@gmail.com>
Bug-Debian: https://bugs.debian.org/1068158
Last-Update: 2024-04-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/site_scons/extractdebbuild.py
+++ b/site_scons/extractdebbuild.py
@@ -57,8 +57,9 @@
         mycflags=val
     if key=="CXXFLAGS":
         mycxxflags=val
-    if mycflags is not None and mycxxflags is not None and mycflags!=mycxxflags:
-        raise RuntimeError("We do not current support different different dpkg-buildflags for C vs C++")
+    if mycflags is not None and mycxxflags is not None:
+        if sorted(mycflags.split()) != sorted(mycxxflags.split()):
+            raise RuntimeError("We do not current support different different dpkg-buildflags for C vs C++")
     if usedflags[key] is None:
         continue
     res.append([usedflags[key],val])