unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#28284: GCC 4.7.4 fails to build since April 2017
@ 2017-08-29 21:26 Mark H Weaver
  2017-11-06 21:58 ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 6+ messages in thread
From: Mark H Weaver @ 2017-08-29 21:26 UTC (permalink / raw)
  To: 28284

GCC 4.7.4 fails to build since April 2017:

  https://hydra.gnu.org/job/gnu/master/gcc-4.7.4.x86_64-linux
  https://hydra.gnu.org/job/gnu/master/gcc-4.7.4.i686-linux

      Mark

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#28284: GCC 4.7.4 fails to build since April 2017
  2017-08-29 21:26 bug#28284: GCC 4.7.4 fails to build since April 2017 Mark H Weaver
@ 2017-11-06 21:58 ` Jan Nieuwenhuizen
  2017-11-07 10:25   ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Nieuwenhuizen @ 2017-11-06 21:58 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 28284

[-- Attachment #1: Type: text/plain, Size: 1439 bytes --]

Mark H Weaver writes:

> GCC 4.7.4 fails to build since April 2017:
>
>   https://hydra.gnu.org/job/gnu/master/gcc-4.7.4.x86_64-linux
>   https://hydra.gnu.org/job/gnu/master/gcc-4.7.4.i686-linux

The attached patch should fix this.  I tested it on an inherited package
like this below, while attempting to create diverse double compilation

(define-public repro-gcc-4.7
  (package
    (inherit gcc-4.7-$ORIGIN)
    (source
     (origin
       (inherit (package-source gcc-4.7-$ORIGIN))
       (patches (append ((compose origin-patches package-source) gcc-4.7)
                        (search-patches "gcc-5-reproducibility-drop-profile.patch"
                                        "gcc-4-cfns-fix-mismatch-in-gnu_inline-attributes.patch"
                                        "gcc-4-build-path-prefix-map.patch")))))
    (name "repro-gcc")
    (version "4.7.4")
    (arguments
     (substitute-keyword-arguments (package-arguments gcc-4.7-$ORIGIN)
       ((#:phases original-phases)
        `(modify-phases ,original-phases
           (add-before 'configure 'build-prefix-path
             (lambda* (#:key inputs #:allow-other-keys)
               (setenv "BUILD_PATH_PREFIX_MAP"
                       (string-append "gcc" "-" ,version "=" (getcwd)))
               (format (current-error-port)
                       "BUILD_PATH_PREFIX_MAP=~s\n"
                       (getenv "BUILD_PATH_PREFIX_MAP"))))))))))

Greetings,
janneke


[-- Attachment #2: 0001-gnu-gcc-4.7-Resurrect-building-with-gcc-5.4.0.patch --]
[-- Type: text/x-patch, Size: 4894 bytes --]

From b2fb0adc3e0de7194493a0c5f1f9bbdbcd0a4087 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Mon, 6 Nov 2017 22:50:05 +0100
Subject: [PATCH] gnu: gcc-4.7: Resurrect building with gcc-5.4.0.

* gnu/packages/patches/gcc-4-cfns-fix-mismatch-in-gnu_inline-attributes.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/gcc.scm (gcc-4.7): Use it.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/gcc.scm                               |  3 +
 ...fns-fix-mismatch-in-gnu_inline-attributes.patch | 65 ++++++++++++++++++++++
 3 files changed, 69 insertions(+)
 create mode 100644 gnu/packages/patches/gcc-4-cfns-fix-mismatch-in-gnu_inline-attributes.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5dfcf497b..76aef903a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -637,6 +637,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-cfns-fix-mismatch-in-gnu_inline-attributes.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		\
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 7870d4513..2991cbd0b 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -136,6 +136,9 @@ where the OS part is overloaded to denote a specific ABI---into GCC
                (method url-fetch)
                (uri (string-append "mirror://gnu/gcc/gcc-"
                                    version "/gcc-" version ".tar.bz2"))
+               (patches
+                (search-patches
+                 "gcc-4-cfns-fix-mismatch-in-gnu_inline-attributes.patch"))
                (sha256
                 (base32
                  "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))))
diff --git a/gnu/packages/patches/gcc-4-cfns-fix-mismatch-in-gnu_inline-attributes.patch b/gnu/packages/patches/gcc-4-cfns-fix-mismatch-in-gnu_inline-attributes.patch
new file mode 100644
index 000000000..861cd4857
--- /dev/null
+++ b/gnu/packages/patches/gcc-4-cfns-fix-mismatch-in-gnu_inline-attributes.patch
@@ -0,0 +1,65 @@
+Taken from  https://gcc.gnu.org/cgi-bin/get-raw-msg?listname=gcc-patches&date=2016-01&msgid=1451802493-17406-1-git-send-email-vapier%40gentoo.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@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.6.2
+
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


[-- Attachment #3: Type: text/plain, Size: 152 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#28284: GCC 4.7.4 fails to build since April 2017
  2017-11-06 21:58 ` Jan Nieuwenhuizen
@ 2017-11-07 10:25   ` Ludovic Courtès
  2017-11-07 17:29     ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2017-11-07 10:25 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: 28284

Hello!

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> From b2fb0adc3e0de7194493a0c5f1f9bbdbcd0a4087 Mon Sep 17 00:00:00 2001
> From: Jan Nieuwenhuizen <janneke@gnu.org>
> Date: Mon, 6 Nov 2017 22:50:05 +0100
> Subject: [PATCH] gnu: gcc-4.7: Resurrect building with gcc-5.4.0.
>
> * gnu/packages/patches/gcc-4-cfns-fix-mismatch-in-gnu_inline-attributes.patch:
> New file.

Could you use a shorter file name, so we don't hit tar’s limit on file
name length?

> * gnu/local.mk (dist_patch_DATA): Add it.
> * gnu/packages/gcc.scm (gcc-4.7): Use it.

I think this can actually go to master, though please double-check that
the world isn’t getting rebuilt.  :-)

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#28284: GCC 4.7.4 fails to build since April 2017
  2017-11-07 10:25   ` Ludovic Courtès
@ 2017-11-07 17:29     ` Jan Nieuwenhuizen
  2017-11-07 20:58       ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Nieuwenhuizen @ 2017-11-07 17:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 28284

[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

Ludovic Courtès writes:

>> * gnu/packages/patches/gcc-4-cfns-fix-mismatch-in-gnu_inline-attributes.patch:
>> New file.
>
> Could you use a shorter file name, so we don't hit tar’s limit on file
> name length?

I chose: gcc-4-compile-with-gcc-5.patch.  New patch attached.

>> * gnu/local.mk (dist_patch_DATA): Add it.
>> * gnu/packages/gcc.scm (gcc-4.7): Use it.
>
> I think this can actually go to master, though please double-check that
> the world isn’t getting rebuilt.  :-)

Here is what I did

    18:25:50 janneke@dundal:~/src/guix-master [env]
    $ ./pre-inst-env guix refresh -l gcc@4.7.4
    No dependents other than itself: gcc@4.7.4
    18:25:55 janneke@dundal:~/src/guix-master [env]
    $ ./pre-inst-env guix build hello
    /gnu/store/lr8c1yswvrgckkaa6nzdi7q0d618bazs-hello-2.10
    18:26:01 janneke@dundal:~/src/guix-master [env]

so indeed, it looks fine; and it makes sense.  I was working on the
$ORIGIN stuff inside (a copy of) the gcc-4.7.4 builder -- that code is
of course (re)used by all other gcc packages.

Greetings,
janneke


[-- Attachment #2: 0001-gnu-gcc-4.7-Resurrect-building-with-gcc-5.4.0.patch --]
[-- Type: text/x-patch, Size: 5149 bytes --]

From 22d5353991784409e3a8e671611c5ccff3ff7b68 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Mon, 6 Nov 2017 22:50:05 +0100
Subject: [PATCH] gnu: gcc-4.7: Resurrect building with gcc-5.4.0.

* gnu/packages/patches/gcc-4-compile-with-gcc-5.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/gcc.scm (gcc-4.7): Use it.
---
 gnu/local.mk                                       |  2 +
 gnu/packages/gcc.scm                               |  1 +
 .../patches/gcc-4-compile-with-gcc-5.patch         | 65 ++++++++++++++++++++++
 3 files changed, 68 insertions(+)
 create mode 100644 gnu/packages/patches/gcc-4-compile-with-gcc-5.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 630d8187f..c77c4d8ed 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -11,6 +11,7 @@
 # Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
 # Copyright © 2016, 2017 Alex Vong <alexvong1995@gmail.com>
 # Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
+# Copyright © 2016, 2017 Jan Nieuwenhuizen <janneke@gnu.org>
 # Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
 # Copyright © 2017 Clément Lassieur <clement@lassieur.org>
 # Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
@@ -637,6 +638,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-compile-with-gcc-5.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		\
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 7870d4513..79e159f1a 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -136,6 +136,7 @@ where the OS part is overloaded to denote a specific ABI---into GCC
                (method url-fetch)
                (uri (string-append "mirror://gnu/gcc/gcc-"
                                    version "/gcc-" version ".tar.bz2"))
+               (patches (search-patches "gcc-4-compile-with-gcc-5.patch"))
                (sha256
                 (base32
                  "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))))
diff --git a/gnu/packages/patches/gcc-4-compile-with-gcc-5.patch b/gnu/packages/patches/gcc-4-compile-with-gcc-5.patch
new file mode 100644
index 000000000..861cd4857
--- /dev/null
+++ b/gnu/packages/patches/gcc-4-compile-with-gcc-5.patch
@@ -0,0 +1,65 @@
+Taken from  https://gcc.gnu.org/cgi-bin/get-raw-msg?listname=gcc-patches&date=2016-01&msgid=1451802493-17406-1-git-send-email-vapier%40gentoo.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@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.6.2
+
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


[-- Attachment #3: Type: text/plain, Size: 152 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#28284: GCC 4.7.4 fails to build since April 2017
  2017-11-07 17:29     ` Jan Nieuwenhuizen
@ 2017-11-07 20:58       ` Ludovic Courtès
  2017-11-07 21:07         ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2017-11-07 20:58 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: 28284

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> Here is what I did
>
>     18:25:50 janneke@dundal:~/src/guix-master [env]
>     $ ./pre-inst-env guix refresh -l gcc@4.7.4
>     No dependents other than itself: gcc@4.7.4
>     18:25:55 janneke@dundal:~/src/guix-master [env]
>     $ ./pre-inst-env guix build hello
>     /gnu/store/lr8c1yswvrgckkaa6nzdi7q0d618bazs-hello-2.10
>     18:26:01 janneke@dundal:~/src/guix-master [env]
>
> so indeed, it looks fine; and it makes sense.

Sounds good.

> I was working on the $ORIGIN stuff inside (a copy of) the gcc-4.7.4
> builder -- that code is of course (re)used by all other gcc packages.

Though the $ORIGIN stuff is separate, right?  Will be nice to have.

> From 22d5353991784409e3a8e671611c5ccff3ff7b68 Mon Sep 17 00:00:00 2001
> From: Jan Nieuwenhuizen <janneke@gnu.org>
> Date: Mon, 6 Nov 2017 22:50:05 +0100
> Subject: [PATCH] gnu: gcc-4.7: Resurrect building with gcc-5.4.0.
>
> * gnu/packages/patches/gcc-4-compile-with-gcc-5.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
> * gnu/packages/gcc.scm (gcc-4.7): Use it.

Go for it!

Thank you,
Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#28284: GCC 4.7.4 fails to build since April 2017
  2017-11-07 20:58       ` Ludovic Courtès
@ 2017-11-07 21:07         ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Nieuwenhuizen @ 2017-11-07 21:07 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 28284-done

Ludovic Courtès writes:

>> I was working on the $ORIGIN stuff inside (a copy of) the gcc-4.7.4
>> builder -- that code is of course (re)used by all other gcc packages.
>
> Though the $ORIGIN stuff is separate, right?  Will be nice to have.

Sure, i figure this will take some time to get in if at all.  We'll have
to see what the pros and cons are.  Different story/thread.

>> From 22d5353991784409e3a8e671611c5ccff3ff7b68 Mon Sep 17 00:00:00 2001
>> From: Jan Nieuwenhuizen <janneke@gnu.org>
>> Date: Mon, 6 Nov 2017 22:50:05 +0100
>> Subject: [PATCH] gnu: gcc-4.7: Resurrect building with gcc-5.4.0.
>>
>> * gnu/packages/patches/gcc-4-compile-with-gcc-5.patch: New file.
>> * gnu/local.mk (dist_patch_DATA): Add it.
>> * gnu/packages/gcc.scm (gcc-4.7): Use it.
>
> Go for it!

Pushed to master as 625492ee1a5a8e515b97d4b76734584c1b420243

janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-11-07 21:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29 21:26 bug#28284: GCC 4.7.4 fails to build since April 2017 Mark H Weaver
2017-11-06 21:58 ` Jan Nieuwenhuizen
2017-11-07 10:25   ` Ludovic Courtès
2017-11-07 17:29     ` Jan Nieuwenhuizen
2017-11-07 20:58       ` Ludovic Courtès
2017-11-07 21:07         ` Jan Nieuwenhuizen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).