~ruther/guix-local

db90eb8c2bd447ab53bed80e5b0ea5105a928cdf — Ricardo Wurmus 9 years ago afbc941
gnu: Add propeller-gcc-4.

* gnu/packages/embedded.scm (propeller-gcc-4): New variable.
* gnu/packages/patches/gcc-4.6-gnu-inline.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
3 files changed, 88 insertions(+), 0 deletions(-)

M gnu/local.mk
M gnu/packages/embedded.scm
A gnu/packages/patches/gcc-4.6-gnu-inline.patch
M gnu/local.mk => gnu/local.mk +1 -0
@@ 606,6 606,7 @@ dist_patch_DATA =						\
  %D%/packages/patches/gcc-cross-environment-variables.patch	\
  %D%/packages/patches/gcc-libvtv-runpath.patch			\
  %D%/packages/patches/gcc-strmov-store-file-names.patch	\
  %D%/packages/patches/gcc-4.6-gnu-inline.patch			\
  %D%/packages/patches/gcc-4.9.3-mingw-gthr-default.patch	\
  %D%/packages/patches/gcc-5.0-libvtv-runpath.patch		\
  %D%/packages/patches/gcc-5-source-date-epoch-1.patch		\

M gnu/packages/embedded.scm => gnu/packages/embedded.scm +22 -0
@@ 488,6 488,28 @@ with a layered architecture of JTAG interface and TAP support.")
      (home-page "https://github.com/totalspectrum/gcc-propeller")
      (synopsis "GCC for the Parallax Propeller"))))

(define-public propeller-gcc-4
  (let ((xgcc propeller-gcc)
        (commit "f1b01001b760d691a91ff1db4830d41bb712557f")
        (revision "1"))
    (package (inherit xgcc)
      (name "propeller-gcc")
      (version (string-append "4.6.1-" revision "." (string-take commit 9)))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/dbetz/propgcc-gcc.git")
                      (commit commit)))
                (file-name (string-append name "-" commit "-checkout"))
                (sha256
                 (base32
                  "15mxrhk2v4vqmdkvcqy33ag1wrg9x9q20kx2w33kkw8pkrijknbi"))
                (patches
                 (append
                  (origin-patches (package-source gcc-4.7))
                  (search-patches "gcc-4.6-gnu-inline.patch")))))
      (home-page "https://github.com/dbetz/propgcc-gcc"))))

;; There is no release, so we take the latest version as referenced from here:
;; https://github.com/dbetz/propeller-gcc
(define-public proplib

A gnu/packages/patches/gcc-4.6-gnu-inline.patch => gnu/packages/patches/gcc-4.6-gnu-inline.patch +65 -0
@@ 0,0 1,65 @@
This patch was taken from https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00375.html.
It is used by propeller-gcc-4.

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@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