[packages/crossnacl-gcc] - fix building using gcc 5 - rel 12
baggins
baggins at pld-linux.org
Sat Mar 12 20:10:54 CET 2016
commit 04c7c5f942b719ca197f8930192a56ae5a363f61
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sat Mar 12 20:10:39 2016 +0100
- fix building using gcc 5
- rel 12
crossnacl-gcc.spec | 6 +++--
gnu_inline-mismatch.patch | 69 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 73 insertions(+), 2 deletions(-)
---
diff --git a/crossnacl-gcc.spec b/crossnacl-gcc.spec
index 0210715..34c3b1d 100644
--- a/crossnacl-gcc.spec
+++ b/crossnacl-gcc.spec
@@ -6,12 +6,13 @@
Summary: Various compilers (C, C++) for NaCl
Name: crossnacl-gcc
Version: 4.4.3
-Release: 11.git%{gitver}
+Release: 12.git%{gitver}
License: GPL v3+ and GPL v3+ with exceptions and GPL v2+ with exceptions
Group: Development/Languages
Source0: nacl-gcc-%{version}-git%{gitver}.tar.xz
# Source0-md5: e72fed38d5b93e4505c1a05c69ab0796
Source1: get-source.sh
+Patch0: gnu_inline-mismatch.patch
URL: http://sourceware.org/gcc/
BuildRequires: cloog-ppl-devel
BuildRequires: crossnacl-binutils
@@ -71,13 +72,14 @@ Ten pakiet zawiera kompilator objc generujący kod pod Win32.
%prep
%setup -q -n nacl-gcc-%{version}-git%{?gitver}
+%patch0 -p1
%build
rm -rf obj-%{target}
install -d obj-%{target}
cd obj-%{target}
-OPT_FLAGS="%{rpmcflags} -D_FILE_OFFSET_BITS=64"
+OPT_FLAGS="%{rpmcflags} -D_FILE_OFFSET_BITS=64 -fgnu89-inline"
OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
%ifarch %{ix86}
OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-march=i.86//g')
diff --git a/gnu_inline-mismatch.patch b/gnu_inline-mismatch.patch
new file mode 100644
index 0000000..e47a171
--- /dev/null
+++ b/gnu_inline-mismatch.patch
@@ -0,0 +1,69 @@
+From: Mike Frysinger <vapier at gentoo dot org>
+To: gcc-patches at gcc dot gnu dot org
+Subject: [PATCH] cfns: fix mismatch in gnu_inline attributes
+Date: Thu, 6 Aug 2015 23:47:06 -0400
+Message-Id: <1438919226-30427-1-git-send-email-vapier at gentoo.org>
+
+Since the 3.0.3 release of gperf (made in May 2007), the generated func
+has had the gnu_inline attribute applied to it. The gcc source however
+has not been updated to include that which has lead to a mismatch.
+
+In practice, this hasn't been an issue for two reasons:
+(1) Before gcc-5, the default standard was (gnu) C89, and gcc does not
+warn or throw an error in this mode.
+(2) Starting with gcc-4.8, the compiler driver used to build gcc was
+changed to C++, and g++ does not warn or throw an error in this mode.
+
+This error does show up though when using gcc-5 to build gcc-4.7 or
+older as then the default is (gnu) C11 and the C compiler driver is
+used. That failure looks like:
+In file included from .../gcc-4.7.4/gcc/cp/except.c:990:0:
+cfns.gperf: At top level:
+cfns.gperf:101:1: error: 'gnu_inline' attribute present on 'libc_name_p'
+cfns.gperf:26:14: error: but not here
+
+Whether the compiler should always emit this error regardless of the
+active standard or compiler driver is debatable (I think it should be
+consistent -- either always do it or never do it).
+
+2015-08-06 Mike Frysinger <vapier at gentoo.org>
+
+ * cfns.gperf [__GNUC__, __GNUC_STDC_INLINE__]: Apply the
+ __gnu_inline__ attribute.
+ * cfns.h: Regenerated.
+---
+ gcc/cp/cfns.gperf | 3 +++
+ gcc/cp/cfns.h | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
+index 68acd3d..953262f 100644
+--- a/gcc/cp/cfns.gperf
++++ b/gcc/cp/cfns.gperf
+@@ -22,6 +22,9 @@ __inline
+ static unsigned int hash (const char *, unsigned int);
+ #ifdef __GNUC__
+ __inline
++#ifdef __GNUC_STDC_INLINE__
++__attribute__ ((__gnu_inline__))
++#endif
+ #endif
+ const char * libc_name_p (const char *, unsigned int);
+ %}
+diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
+index 1c6665d..6d00c0e 100644
+--- a/gcc/cp/cfns.h
++++ b/gcc/cp/cfns.h
+@@ -53,6 +53,9 @@ __inline
+ static unsigned int hash (const char *, unsigned int);
+ #ifdef __GNUC__
+ __inline
++#ifdef __GNUC_STDC_INLINE__
++__attribute__ ((__gnu_inline__))
++#endif
+ #endif
+ const char * libc_name_p (const char *, unsigned int);
+ /* maximum key range = 391, duplicates = 0 */
+--
+2.4.4
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/crossnacl-gcc.git/commitdiff/04c7c5f942b719ca197f8930192a56ae5a363f61
More information about the pld-cvs-commit
mailing list