[MacPorts] #54215: gcc7: broken on powerpc

classic Classic list List threaded Threaded
60 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[MacPorts] #54215: gcc7: broken on powerpc

MacPorts
#54215: gcc7: broken on powerpc
--------------------+------------------
 Reporter:  mojca   |      Owner:
     Type:  defect  |     Status:  new
 Priority:  Normal  |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  gcc7
--------------------+------------------
 gcc7 seems to be broken on PPC

 {{{
 In file included from /path/to/gcc-7-20170226/libgcc/unwind-dw2.c:1728:0:
 /path/to/gcc-7-20170226/libgcc/unwind.inc: In function
 '_Unwind_RaiseException':
 /path/to/gcc-7-20170226/libgcc/unwind.inc:136:1: error: unrecognizable
 insn:
  }
  ^
 (jump_insn/f 193 192 194 14 (parallel [
             (return)
             (use (symbol_ref:SI ("*eh_rest_world_r10")))
             (clobber (reg:SI 11 r11))
             (set (reg:SI 70 cr2)
                 (mem/c:SI (plus:SI (reg/f:SI 1 r1)
                         (const_int 4 [0x4])) [30  S4 A8]))
 }}}

 See: https://build.macports.org/builders/ports-10.5_ppc_legacy-
 builder/builds/28045

 I submitted a bug report upstream:
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80865

--
Ticket URL: <https://trac.macports.org/ticket/54215>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
#54215: gcc7: broken on powerpc
---------------------+-----------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:
      Port:  gcc7    |
---------------------+-----------------

Comment (by ccorn):

 As indicated in [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80865
 Bugzilla 80865], the [https://gcc.gnu.org/bugzilla/attachment.cgi?id=42124
 patches mentioned in Comment 2] let the build succeed. Whether the result
 is usable, I cannot say yet.

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+-----------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:
      Port:  gcc7    |
---------------------+-----------------

Comment (by ccorn):

 This now applies to the gcc7 port as well as its libgcc subport, as
 introduced in [https://github.com/macports/macports-
 ports/commit/ff4c4bd6219f166b85c82c44eecb909dd3ae08b3 MacPorts commit
 ff4c4bd].

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+-----------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:
      Port:  gcc7    |
---------------------+-----------------
Changes (by ccorn):

 * Attachment "gcc7-darwin-ppc-Portfile.diff" added.

 Portfile changes for use with the patch mentioned in GCC Bugzilla 80865

--
Ticket URL: <https://trac.macports.org/ticket/54215>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+-----------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:
      Port:  gcc7    |
---------------------+-----------------
Changes (by mojca):

 * cc: kencu, ryandesign (added)


Comment:

 I'm adding the two of you to CC in case you are able to test the changes.
 (Or we could commit and hope that the buildbot attempt succeeds.)

 ccorn: you diff only includes the patch for the Portfile, not the patch
 itself (but of course the patch itself can be taken from bugzilla).

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+----------------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:  haspatch
      Port:  gcc7    |
---------------------+----------------------
Changes (by mojca):

 * keywords:   => haspatch


--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+----------------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:  haspatch
      Port:  gcc7    |
---------------------+----------------------

Comment (by ryandesign):

 What kind of testing would be useful? I could see if the port builds on
 PowerPC with that patch. The port doesn't have a test phase.

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+----------------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:  haspatch
      Port:  gcc7    |
---------------------+----------------------

Comment (by kencu):

 I'm happy to try a build in the morning as well. I saw this but was
 hesitating... this means changing libgcc to libgcc7 as well, correct?

 I haven't yet read much about how libgcc changes in gcc7, but I did see
 there is a libstdc++.6.dylib in it, so I guess it's a "drop in"
 replacement for that file at least (plenty of software on my 10.5 PPC box
 is built with gcc6 or clang-3.8 and links against libstdc++), as does all
 the cxx11 1.1 PortGroup stuff.

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+----------------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:  haspatch
      Port:  gcc7    |
---------------------+----------------------

Comment (by ryandesign):

 Replying to [comment:7 kencu]:
 > I'm happy to try a build in the morning as well. I saw this but was
 hesitating... this means changing libgcc to libgcc7 as well, correct?

 No... what makes you think that?

 The version of one of the gcc libraries changed in gcc 7.x. Therefore,
 since libgcc contains that new version, a new libgcc6 port had to be
 created to provide the older version of the library for use by gcc 6.x and
 earlier. The ports should be correctly handling all these details already
 so nothing about that needs to be changed for this ticket.

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:8>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+----------------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:  haspatch
      Port:  gcc7    |
---------------------+----------------------

Comment (by kencu):

 Thanks, good to know.

 There is that "clang test suite" of 500 applications I used to test clang
 3.8 on PPC; I wonder if something similar exists for gcc, or if that clang
 suite can be used to test gcc...

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+----------------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:  haspatch
      Port:  gcc7    |
---------------------+----------------------

Comment (by mojca):

 I would say that at the moment it would already help to test whether the
 compiler itself builds at all and provide feedback to the upstream ticket.

 Current sources don't build at all.

 Running a test suite would of course be nice to reveal other potential
 problems, but getting the build to succeed in the first place seems most
 important right now. If the build succeeds, you could more easily test a
 couple of random ports with it.

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:10>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+----------------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:  haspatch
      Port:  gcc7    |
---------------------+----------------------

Comment (by ccorn):

 Both {{{gcc7}}} and its subport {{{libgcc}}} get built successfully with
 the mentioned [https://gcc.gnu.org/bugzilla/attachment.cgi?id=42124 patch-
 darwin-ppc-2017-01-msg02971.diff]
 which comprises Iain Sandoe's Darwin/PPC patches.

 A tiny bit of ad-hoc testing reveals no more than the ages-old problem (at
 least on my apple-darwin9-powerpc G5) that C++ programs indirectly linked
 to both GCC's and the native C++ runtime libs tend to crash on exit. E.g.
 {{{octave-gui}}}. That can be avoided by using {{{-static-libgcc}}} when
 linking. There used to be an ancient patchfile for the GCC ports forcing
 that, but it was controversial and removed from the GCC 4.7+ ports if I
 recall correctly. I have kept the patch in a private git branch of the
 ports tree and applied it without problems ever since.
 (If you folks have no such problems, I'd like to hear about that.)

 I have now applied that force-static-libgcc patch to the GCC7 port. Both
 {{{libgcc}}} and {{{gcc7}}} still build fine; and {{{octave-gui}}} does
 not crash on exit any longer.
 Furthermore, my handful of C++11 feature tests works.
 The {{{boost}}} port (privately patched to allow GCC) also builds fine,
 and my few tests with {{{Boost.Threads}}} work. Superficially, things look
 nice.

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:11>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+----------------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:  haspatch
      Port:  gcc7    |
---------------------+----------------------

Comment (by kencu):

 I haven't built it yet (that machine is still upgrading outdated ports
 this morning) but it sounds like this patch will be a go and we'll sort
 out the dust later if any.

 I'll have to think about this: `indirectly linked to both GCC's and the
 native C++ runtime libs tend to crash on exit`.

 There is a way to build libgcc with `default abi 4` so that software built
 with gcc6 would be compatible with the systems libstdc++ even if the ABI4
 flag is not passed in during the build (like it is with the cxx11 1.1
 PortGroup). I suspect the issue could lie in there...

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:12>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+----------------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:  haspatch
      Port:  gcc7    |
---------------------+----------------------

Comment (by kencu):

 I haven't had any major issues with Boost though. The stock MacPorts
 version works OK for me. Sometimes you have to add the -fvisibility-hidden
 flag to ports that use boost, though, at least so far that's what I've
 done.

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:13>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+----------------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:  haspatch
      Port:  gcc7    |
---------------------+----------------------

Comment (by kencu):

 It took a while to build this, but I have it built now (both gcc7 and
 libgcc). It builds through without errors, and I compiled my favourite
 c++11 test port, `aria2` and that builds and works correctly so far.

 I then rebuilt libgcc with my +defaultabi4 variant, so it would always use
 the "correct" ABI for this system; that also built though correctly.

 To me, this looks good to go.

 Thanks to everyone for your efforts; it's a real bonus having gcc7 on PPC.
 If we / I / somebody can ever fix the "exceptions" problem, clang-3.8 for
 PPC will be a full-bore go as well, which would be something special too
 (I backported Marcus' macports-libstdc++ fixes into clang-3.8 so it can
 work on PPC like the cxx11 1.1 PortGroup does already on clang-3.9+).

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:15>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7: broken on powerpc
---------------------+----------------------
  Reporter:  mojca   |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:  haspatch
      Port:  gcc7    |
---------------------+----------------------

Comment (by kencu):

 There is a testsuite for gcc7 <https://gcc.gnu.org/install/test.html>, and
 all the prerequisites for it are available in MacPorts (minor tweak needed
 to install port:expect prior to buiding port:dejagnu).

 The test command from that website is `cd objdir; make -k check` which
 perhaps could be part of the gcc7 Portfile.

 I haven't added a test suite to a Port before, certainly not somthing as
 complicated as gcc7. Here is a block from git that is probably pretty
 close to what gcc7 would need, I would think:
 {{{
 test.run            yes
 test.cmd            make
 test.target         test
 test.dir            ${worksrcpath}
 pre-test {
     eval test.args  ${build.args}
 }
 }}}

 I wonder if could it be as easy as adding this block, then changing the
 test.cmd to `make -k`,  the test.target to `check`, and setting the
 test.dir to `${workpath}/build`

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:16>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7, libgcc: broken on powerpc (was: gcc7: broken on powerpc)

MacPorts
In reply to this post by MacPorts
#54215: gcc7, libgcc: broken on powerpc
---------------------------+----------------------
  Reporter:  mojca         |      Owner:
      Type:  defect        |     Status:  new
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:
Resolution:                |   Keywords:  haspatch
      Port:  gcc7, libgcc  |
---------------------------+----------------------
Changes (by ryandesign):

 * cc: ballapete (added)
 * port:  gcc7 => gcc7, libgcc


Comment:

 Has duplicate #54795.

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:17>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7, libgcc: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7, libgcc: broken on powerpc
---------------------------+----------------------
  Reporter:  mojca         |      Owner:
      Type:  defect        |     Status:  new
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:
Resolution:                |   Keywords:  haspatch
      Port:  gcc7, libgcc  |
---------------------------+----------------------

Comment (by kencu):

 The test suite for gcc7 takes a long time to run. Here are the results to
 date. I'll update this with the final results in another day perhaps, and
 then I'll put up the full test log.

 {{{
 All fixinclude tests pass

                 === gcc Summary ===

 # of expected passes            99768
 # of unexpected failures        187
 # of unexpected successes       3
 # of expected failures          319
 # of unresolved testcases       29
 # of unsupported tests          3328

                 === g++ Summary ===

 # of expected passes            100673
 # of unexpected failures        37
 # of expected failures          378
 # of unresolved testcases       2
 # of unsupported tests          4484

                 === gfortran Summary ===

 # of expected passes            44541
 # of unexpected failures        12
 # of unexpected successes       6
 # of expected failures          112
 # of unsupported tests          224

                 === objc Summary ===

 # of expected passes            5616
 # of unexpected failures        2
 # of unsupported tests          78

                 === obj-c++ Summary ===

 # of expected passes            3114
 # of unexpected failures        2
 # of expected failures          2
 # of unresolved testcases       1
 # of unsupported tests          62

 }}}

--
Ticket URL: <https://trac.macports.org/ticket/54215#comment:18>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7, libgcc: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7, libgcc: broken on powerpc
---------------------------+----------------------
  Reporter:  mojca         |      Owner:
      Type:  defect        |     Status:  new
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:
Resolution:                |   Keywords:  haspatch
      Port:  gcc7, libgcc  |
---------------------------+----------------------
Changes (by kencu):

 * Attachment "gcc7_test_suite.log" added.

 full run of gcc7 test suite (ABI4 set as default)

--
Ticket URL: <https://trac.macports.org/ticket/54215>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #54215: gcc7, libgcc: broken on powerpc

MacPorts
In reply to this post by MacPorts
#54215: gcc7, libgcc: broken on powerpc
---------------------------+----------------------
  Reporter:  mojca         |      Owner:
      Type:  defect        |     Status:  new
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:
Resolution:                |   Keywords:  haspatch
      Port:  gcc7, libgcc  |
---------------------------+----------------------
Changes (by kencu):

 * Attachment "gcc_test_suite_email_sent.txt" added.

 gcc7 summary of test results (email usually sent to gcc admins)

--
Ticket URL: <https://trac.macports.org/ticket/54215>
MacPorts <https://www.macports.org/>
Ports system for macOS
123