I have bumped into a weird problem with gcc6 and gcc7, initially when gcc7 failed to build icu as universal (ppc+ppc64), and it turned out compiler itself is at fault.
As an example, identical HelloWorld is built correctly for ppc64 on 10.5.8 with Apple gcc, but fails when built with gcc7:
32-bit binaries work normally. The same problem is observed with gcc6.
P. S. At the moment I confirm the issue for Macports versions of compilers. I am building gcc7 outside of Macports now to make sure whether the problem is inherent to compiler itself and not its configuration by Macports. I have opened the ticket: https://trac.macports.org/ticket/64260
As an example, identical HelloWorld is built correctly for ppc64 on 10.5.8 with Apple gcc, but fails when built with gcc7:
Code:
36-225:Dev svacchanda$ gcc-mp-7 -arch ppc HelloWorld.c -o HelloWorld
HelloWorld.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int]
main() {
^~~~
36-225:Dev svacchanda$ /Users/svacchanda/Dev/HelloWorld
hello, world
36-225:Dev svacchanda$ gcc-mp-7 -arch ppc64 HelloWorld.c -o HelloWorld
HelloWorld.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int]
main() {
^~~~
36-225:Dev svacchanda$ /Users/svacchanda/Dev/HelloWorld
Segmentation fault
36-225:Dev svacchanda$ file /Users/svacchanda/Dev/HelloWorld
/Users/svacchanda/Dev/HelloWorld: Mach-O 64-bit executable ppc64
36-225:Dev svacchanda$ gcc -arch ppc64 HelloWorld.c -o HelloWorld
36-225:Dev svacchanda$ /Users/svacchanda/Dev/HelloWorld
hello, world
36-225:Dev svacchanda$ file /Users/svacchanda/Dev/HelloWorld
/Users/svacchanda/Dev/HelloWorld: Mach-O 64-bit executable ppc64
32-bit binaries work normally. The same problem is observed with gcc6.
P. S. At the moment I confirm the issue for Macports versions of compilers. I am building gcc7 outside of Macports now to make sure whether the problem is inherent to compiler itself and not its configuration by Macports. I have opened the ticket: https://trac.macports.org/ticket/64260