Opened 13 years ago

Closed 11 years ago

#34385 closed defect (fixed)

Support gcc48 and gcc49 on ppc

Reported by: boby.foulcan@… Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.0.4
Keywords: Leopard ppc Cc: mww@…, internetzel, yihua1218@…, hapaguy (Brian Kurt Fujikawa), ryandesign (Ryan Carsten Schmidt), cooljeanius (Eric Gallager), jdgleeson
Port: gcc48 gcc49

Description (last modified by ryandesign (Ryan Carsten Schmidt))

I guest I have the similar error than #34329 while building gcc44

:info:build ld: in src/powerpc/.libs/darwin.o, unsupported encoding in FDE
:info:build collect2: ld returned 1 exit status
:info:build make[4]: *** [libffi.la] Error 1
:info:build make[4]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc44/gcc44/work/build/ppc-apple-darwin9/libffi'
:info:build make[3]: *** [all-recursive] Error 1
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc44/gcc44/work/build/ppc-apple-darwin9/libffi'
:info:build make[2]: *** [all] Error 2
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc44/gcc44/work/build/ppc-apple-darwin9/libffi'
:info:build make[1]: *** [all-target-libffi] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc44/gcc44/work/build'
:info:build make: *** [bootstrap] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc44/gcc44/work/build'
:info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc44/gcc44/work/build" && /usr/bin/make -w bootstrap BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89" " returned error 2
:error:build Target org.macports.build returned: shell command failed (see log for details)
:debug:build Backtrace: shell command failed (see log for details)
    while executing
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
:info:build Warning: the following items did not execute (for gcc44): org.macports.install org.macports.build org.macports.destroot
:notice:build Log for gcc44 is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc44/gcc44/main.log

Platform is PowerPC G4 1,67 GHz running MacOs 10.5.8

Thanks

Attachments (11)

main.log (5.5 MB) - added by boby.foulcan@… 13 years ago.
build failure log file
ppl-main.log (59.4 KB) - added by boby.foulcan@… 13 years ago.
ppl build failure log file
gcc42-main.log (4.5 MB) - added by boby.foulcan@… 13 years ago.
gcc42 build failure
gcc45-main.log (6.1 MB) - added by boby.foulcan@… 13 years ago.
gcc45 build failure
gcc47-main.log (6.0 MB) - added by boby.foulcan@… 13 years ago.
gcc47 build failure
gcc48-main.log (4.6 MB) - added by boby.foulcan@… 13 years ago.
gcc48 build failure
gcc45-main-2012-05-16.log (3.1 MB) - added by boby.foulcan@… 13 years ago.
gcc45 build failure new
gcc47-main-comment15.log (9.6 MB) - added by darylew@… 12 years ago.
The log file from my attempt to build gcc47 with apple-gcc4.2/ppc32
Portfile (5.8 KB) - added by internetzel 12 years ago.
Portfile for building on 10.5 ppc
ppc_fde_encoding.diff (1.4 KB) - added by internetzel 12 years ago.
Patch for libffi to be compatible with more recent versions of ld64
gcc-4.7.2.patch (1.7 KB) - added by internetzel 12 years ago.
This patch should be applied to gcc when using ld64 as the linker. It makes the long-branch warning go away and produces the best suitable code for ld64.

Change History (52)

Changed 13 years ago by boby.foulcan@…

Attachment: main.log added

build failure log file

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jeremyhu@… added
Description: modified (diff)
Owner: changed from macports-tickets@… to mww@…

comment:2 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Owner: changed from mww@… to jeremyhu@…
Status: newassigned

r92784 probably needs to be done for gcc44 as well.

Can you please also try gcc42, gcc45, gcc46, gcc47, and gcc48 to let me know where else this needs to be done, so we don't keep coming back to this for each port?

comment:3 in reply to:  2 ; Changed 13 years ago by boby.foulcan@…

I try to build gcc42, gcc43 and gcc45

only gcc43 works.

I got different errors:

for gcc42

:info:build ../../../gcc-4.2.4/boehm-gc/dyn_load.c:1166: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token

for gcc45, the ppl build fail:

:info:build Congruence_System.cc:183: error: no matching function for call to 'swap(Parma_Polyhedra_Library::Dense_Row&, Parma_Polyhedra_Library::Congruence&)'
:info:build make[3]: *** [Congruence_System.lo] Error 1

For gcc46, gcc47 and gcc48 also need ppl, so it can not try to build.

Replying to jeremyhu@…:

r92784 probably needs to be done for gcc44 as well.

Can you please also try gcc42, gcc45, gcc46, gcc47, and gcc48 to let me know where else this needs to be done, so we don't keep coming back to this for each port?

Changed 13 years ago by boby.foulcan@…

Attachment: ppl-main.log added

ppl build failure log file

comment:4 in reply to:  3 ; Changed 13 years ago by boby.foulcan@…

as ppl have been updated, I try to build the others gcc

comment:5 in reply to:  4 Changed 13 years ago by boby.foulcan@…

I finally finish to build the different gcc. I summarize the different errors:

gcc43 and gcc46 build without failure

  • gcc42:
    :info:build ../../../gcc-4.2.4/boehm-gc/dyn_load.c:1166: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    
  • gcc45:

same error as for gcc44

  • gcc47 and gcc48:
:info:build Bootstrap comparison failure!

I add the different log files in attachment

Changed 13 years ago by boby.foulcan@…

Attachment: gcc42-main.log added

gcc42 build failure

Changed 13 years ago by boby.foulcan@…

Attachment: gcc45-main.log added

gcc45 build failure

Changed 13 years ago by boby.foulcan@…

Attachment: gcc47-main.log added

gcc47 build failure

Changed 13 years ago by boby.foulcan@…

Attachment: gcc48-main.log added

gcc48 build failure

comment:6 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Ok, so gcc44 and gcc45 should get the same patch as gcc43.

gcc47 and gcc48 need to be marked as not supported on powerpc unless someone cares to fix them.

gcc42's error is somehow related to dyld-headers:

:info:build /opt/local/include/mach-o/dyld.h: In function '_dyld_image_count':
:info:build /opt/local/include/mach-o/dyld.h:47: error: expected declaration specifiers before '__AVAILABILITY_INTERNAL__MAC_10_1'

That should be defined in /usr/include/AvailabilityInternal.h, and I see it there on my Leopard machine, so you need to investigate that issue.

comment:7 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

gcc43 and gcc44 should be fixed with r93031, please confirm.

comment:8 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I meant gcc44 and gcc45 should be fixed...

comment:9 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Keywords: ppc added; PowerPc removed
Port: gcc42 gcc47 gcc48 added; gcc44 removed
Summary: gcc44-4.4.7_1: build failuregcc42, gcc47, and gcc48 fail to build on ppc

comment:10 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: assignedclosed
Summary: gcc42, gcc47, and gcc48 fail to build on ppcgcc47 and gcc48 fail to build on ppc

If you care about gcc47 and gcc48 working on powerpc, please file bugs with GNU. I don't think any MP developers care about working on a fix for that issue.

gcc4[78] "fixed" with r93033.

Please file a separate issue for gcc42 once you've figured out the problem.

comment:11 Changed 13 years ago by boby.foulcan@…

gcc44 build correctly, but with gcc45 I get the same error as with gcc47 and gcc48.

Changed 13 years ago by boby.foulcan@…

Attachment: gcc45-main-2012-05-16.log added

gcc45 build failure new

comment:12 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Weird ... but gcc46 builds fine?

comment:13 Changed 13 years ago by boby.foulcan@…

gcc46 build without failure since the beginning as gcc43...

comment:14 in reply to:  10 Changed 12 years ago by darylew@…

Replying to jeremyhu@…:

If you care about gcc47 and gcc48 working on powerpc, please file bugs with GNU. I don't think any MP developers care about working on a fix for that issue.

gcc4[78] "fixed" with r93033.

Please file a separate issue for gcc42 once you've figured out the problem.

I have GCC-4.7 on my PowerPC/32-bit system. I got this rude surprise running update outdated on gcc47! Has anyone reported the bugs here with GNU? (I took a very quick look through "gcc47-main.log" and didn't see what the problem was.) What has changed? My copy (@4.7.0) has been compiling programs just fine.

comment:15 Changed 12 years ago by darylew@…

Resolution: fixed
Status: closedreopened

I said my copy of GCC 4.7 was running fine. I was wrong. Before I ran update outdated, it was running. Afterwards, I checked GCC 4.7 by running g++-mp-4.7 --version, which worked. When I ran it for an actual compile, it choked.

Before I explain that, let me say that my first run of update outdated ended when it tried to update my copy of GCC 4.6. I got it work by following the suggestion from https://trac.macports.org/ticket/34366#comment:11 to force it to compile with Apple's GCC 4.2. Then I tried to update the remaining outdated ports. It stopped on GCC 4.7 due to the deliberate block added to PowerPC systems, although it worked before.

I thought my pre-update copy of GCC 4.7 should still be there and I can use it, but when I tried to actually compile with it, instead of simply printing the version number I got:

gcc.compile.c++ bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
dyld: Library not loaded: /opt/local/lib/libppl.9.dylib
  Referenced from: /opt/local/libexec/gcc/ppc-apple-darwin8/4.7.0/cc1plus
  Reason: image not found
g++-mp-4.7: internal compiler error: Trace/BPT trap (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

    "g++-mp-4.7"  -ftemplate-depth-128 -std=c++11 -pthread -O0 -fno-inline -Wall -g -fPIC    -I"../../.." -I"/Users/daryle/Documents/Projects/working/boost-trunk" -c -o "bin/cayley_example.test/gcc-4.7/debug/cayley_example.o" "../example/cayley_example.cpp"

...failed gcc.compile.c++ bin/cayley_example.test/gcc-4.7/debug/cayley_example.o

(The "gcc.compile.c++" part is from my compiler script.) I looked up PPL and tried to install it directly via MacPorts. The attempt ended with port trying to redo the gcc47 instead:

[daryle]$ sudo port install ppl
Password:
--->  Computing dependencies for ppl
--->  Cleaning ppl
--->  Scanning binaries for linking errors: 100.0%
--->  Found 14 broken file(s), matching files to ports
--->  Found 1 broken port(s), determining rebuild order
--->  Rebuilding in order
     gcc47 @4.7.0 
Error: gcc47 cannot be installed for the configured build_arch 'ppc' because it only supports the arch(s) 'i386 x86_64'.
Error: Unable to upgrade port: 1
Error rebuilding gcc47
    while executing
"error "Error rebuilding $portname""
    (procedure "revupgrade_scanandrebuild" line 370)
    invoked from within
"revupgrade_scanandrebuild broken_port_counts $opts"
    (procedure "macports::revupgrade" line 5)
    invoked from within
"macports::revupgrade $opts"
    (procedure "action_revupgrade" line 2)
    invoked from within
"action_revupgrade $action $portlist $opts"
    (procedure "action_target" line 94)
    invoked from within
"$action_proc $action $portlist [array get global_options]"
    (procedure "process_cmd" line 95)
    invoked from within
"process_cmd $remaining_args"
    invoked from within
"if { [llength $remaining_args] > 0 } {

    # If there are remaining arguments, process those as a command
    set exit_status [process_cmd $remaining..."
    (file "/opt/local/bin/port" line 4784)
[daryle]$ 

So I tried to apply the workaround I did for GCC 4.6 on GCC 4.7, but directly in the Portfile. I commented out the "supported_archs i386 x86_64", which is on line 28. Then I changed the block starting at line 106 to:

# http://trac.macports.org/ticket/29104
#if {${configure.compiler} == "llvm-gcc-4.2"} {
#    configure.compiler clang
#}
configure.compiler apple-gcc-4.2

(This is hard coded; the resolved version should do some sort of if/else chain.) It started to work, but came up with an error:

[daryle]$ sudo port upgrade outdated
Portfile changed since last build; discarding previous state.
--->  Computing dependencies for gcc47
--->  Fetching archive for gcc47
--->  Attempting to fetch gcc47-4.7.1_0.darwin_8.ppc.tbz2 from http://packages.macports.org/gcc47
--->  Fetching distfiles for gcc47
--->  Attempting to fetch gcc-4.7.1.tar.bz2 from ftp://ftp.gnu.org/gnu/gcc/gcc-4.7.1
--->  Verifying checksum(s) for gcc47
--->  Extracting gcc47
--->  Configuring gcc47
--->  Building gcc47
Error: org.macports.build for port gcc47 returned: command execution failed
Please see the log file for port gcc47 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/main.log
Error: Unable to upgrade port: 1
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
[daryle]$ 

From the log file, I see:

...
:info:build /bin/sh ./libtool --tag=CC   --mode=link /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/work/build/./gcc/xgcc -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/work/build/./gcc/ -B/opt/local/ppc-apple-darwin8/bin/ -B/opt/local/ppc-apple-darwin8/lib/ -isystem /opt/local/ppc-apple-darwin8/include -isystem /opt/local/ppc-apple-darwin8/sys-include    -Wall -g -fexceptions -g -pipe -O2 -version-info `grep -v '^#' ../../../gcc-4.7.1/libffi/libtool-version`    -o libffi.la -rpath /opt/local/lib/gcc47 src/debug.lo src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo              src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo src/powerpc/darwin_closure.lo             
:info:build libtool: link: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/work/build/./gcc/xgcc -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/work/build/./gcc/ -B/opt/local/ppc-apple-darwin8/bin/ -B/opt/local/ppc-apple-darwin8/lib/ -isystem /opt/local/ppc-apple-darwin8/include -isystem /opt/local/ppc-apple-darwin8/sys-include    -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libffi.4.dylib  src/.libs/debug.o src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/powerpc/.libs/ffi_darwin.o src/powerpc/.libs/darwin.o src/powerpc/.libs/darwin_closure.o      -install_name  /opt/local/lib/gcc47/libffi.4.dylib -compatibility_version 5 -current_version 5.1 -Wl,-single_module
:info:build ld: in src/powerpc/.libs/darwin.o, unsupported encoding in FDE
:info:build collect2: error: ld returned 1 exit status
...

When I ran a web search for "unsupported encoding in FDE", the results mentioned problems with libffi, which we have a MacPort of. The results included the page for changeset r74107. I thought I could change the "10" to an "8" (the Darwin number of Tiger), but the Portfile for libffi is different now and that section isn't there anymore. Now what? (I guess those Snow Leopard changes have been merged into the source files?)

I'll attach my forementioned gcc47 log file.

Changed 12 years ago by darylew@…

Attachment: gcc47-main-comment15.log added

The log file from my attempt to build gcc47 with apple-gcc4.2/ppc32

comment:16 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: reopenedclosed
dyld: Library not loaded: /opt/local/lib/libppl.9.dylib
  Referenced from: /opt/local/libexec/gcc/ppc-apple-darwin8/4.7.0/cc1plus
  Reason: image not found

You need to rebuild the port due to dependencies changed out from underneath it:

sudo port -v rev-upgrade

Please ask for help on macports-users if you run into trouble.

comment:17 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Oh, I see you did that already.

In any event, the ppc_fde_encoding.diff patch is applied unconditionally, so I don't know what you mean by changing it... also it's the gcc port that is at issue, not the libffi port. If you have further issues, please open a new bug report. Try adding the ppc_fde_encoding.diff patch (from gcc45) to gcc47.

comment:18 in reply to:  17 Changed 12 years ago by darylew@…

Replying to jeremyhu@…:

Oh, I see you did that already.

I did not run the rev-upgrade; MacPorts did it on its own when it tried redoing gcc47 after processing ppl.

In any event, the ppc_fde_encoding.diff patch is applied unconditionally, so I don't know what you mean by changing it... also it's the gcc port that is at issue, not the libffi port. If you have further issues, please open a new bug report. Try adding the ppc_fde_encoding.diff patch (from gcc45) to gcc47.

We're looking at different patches. You're talking about the FDE patches from [93031] for gcc44 and gcc45. I was talking about the patch in [74107] for libffi. The patch for the later changeset was conditional, but that whole section in the Portfile has been redone, most likely from either the original developers fixing the source or the patch's effects were moved to different files.

I added:

patchfiles          ppc_fde_encoding.diff
patch.dir           ${workpath}/gcc-${version}

after line 50 in gcc47's Portfile, then copied the "ppc_fde_encoding.diff" file from gcc45' to gcc47`:

[daryle]$ pushd /opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/gcc47/
/opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/gcc47 ~
[daryle]$ ls
Portfile        files           work
[daryle]$ cd files
[daryle]$ ls -l
total 8
-rw-r--r--   1 root  admin  111 Nov 30  2011 mp-gcc47
[daryle]$ cd ..
[daryle]$ cd ../gcc45
[daryle]$ ls
Portfile        files
[daryle]$ ls files
mp-gcc45                ppc_fde_encoding.diff
[daryle]$ cd files
[daryle]$ cp ppc_fde_encoding.diff ../../gcc47/files
cp: ../../gcc47/files/ppc_fde_encoding.diff: Permission denied
[daryle]$ cp ppc_fde_encoding.diff ~
[daryle]$ cd ..
[daryle]$ cd ..
[daryle]$ cd gcc47
[daryle]$ cd files
[daryle@daryle-walkers-emac:files]$ cp ~/ppc_fde_encoding.diff .
cp: ./ppc_fde_encoding.diff: Permission denied
[daryle]$ ls -l ~/ppc_fde_encoding.diff 
-rw-r--r--   1 daryle  daryle  1406 Jun 20 12:16 /Users/daryle/ppc_fde_encoding.diff
[daryle]$ sudo cp ~/ppc_fde_encoding.diff .
Password:
[daryle]$ ls -l
total 16
-rw-r--r--   1 root  admin   111 Nov 30  2011 mp-gcc47
-rw-r--r--   1 root  admin  1406 Jun 20 12:18 ppc_fde_encoding.diff

But I messed up somewhere:

[daryle]$ popd
~
[daryle]$ sudo port upgrade outdated
Portfile changed since last build; discarding previous state.
--->  Computing dependencies for gcc47
--->  Fetching archive for gcc47
--->  Attempting to fetch gcc47-4.7.1_0.darwin_8.ppc.tbz2 from http://packages.macports.org/gcc47
--->  Fetching distfiles for gcc47
--->  Verifying checksum(s) for gcc47
--->  Extracting gcc47
--->  Applying patches to gcc47
Error: org.macports.patch for port gcc47 returned: command execution failed
Please see the log file for port gcc47 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/main.log
Error: Unable to upgrade port: 1
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
[daryle]$ 

The process ended really early; the log is short:

version:1
:msg:main --->  Computing dependencies for gcc47:info:main .:debug:main gcc47 has no conflicts
:debug:main Searching for dependency: gmp
:debug:main Found Dependency: receipt exists for gmp
:debug:main Searching for dependency: mpfr
:debug:main Found Dependency: receipt exists for mpfr
:debug:main Searching for dependency: libiconv
:debug:main Found Dependency: receipt exists for libiconv
:debug:main Searching for dependency: libmpc
:debug:main Found Dependency: receipt exists for libmpc
:debug:main Searching for dependency: ppl
:debug:main Found Dependency: receipt exists for ppl
:debug:main Searching for dependency: cloog
:debug:main Found Dependency: receipt exists for cloog
:debug:main Searching for dependency: gcc_select
:debug:main Found Dependency: receipt exists for gcc_select
:debug:main Searching for dependency: ld64
:debug:main Found Dependency: receipt exists for ld64
:debug:main Searching for dependency: cctools
:debug:main Found Dependency: receipt exists for cctools
:msg:main 
:debug:main Executing org.macports.main (gcc47)
:debug:main changing euid/egid - current euid: 0 - current egid: 0
:debug:main egid changed to: 500
:debug:main euid changed to: 506
:debug:archivefetch archivefetch phase started at Wed Jun 20 12:40:45 EDT 2012
:msg:archivefetch --->  Fetching archive for gcc47
:debug:archivefetch Executing org.macports.archivefetch (gcc47)
:debug:archivefetch euid/egid changed to: 0/0
:debug:archivefetch chowned /opt/local/var/macports/incoming to macports
:debug:archivefetch euid/egid changed to: 506/500
:info:archivefetch --->  gcc47-4.7.1_0.darwin_8.ppc.tbz2 doesn't seem to exist in /opt/local/var/macports/incoming/verified
:msg:archivefetch --->  Attempting to fetch gcc47-4.7.1_0.darwin_8.ppc.tbz2 from http://packages.macports.org/gcc47
:debug:archivefetch Fetching archive failed:: The requested URL returned error: 404
:debug:archivefetch Privilege de-escalation not attempted as not running as root.
:debug:fetch fetch phase started at Wed Jun 20 12:40:46 EDT 2012
:notice:fetch --->  Fetching distfiles for gcc47
:debug:fetch Executing org.macports.fetch (gcc47)
:debug:fetch Privilege de-escalation not attempted as not running as root.
:debug:checksum checksum phase started at Wed Jun 20 12:40:46 EDT 2012
:notice:checksum --->  Verifying checksum(s) for gcc47
:debug:checksum Executing org.macports.checksum (gcc47)
:info:checksum --->  Checksumming gcc-4.7.1.tar.bz2
:debug:checksum Correct (rmd160) checksum for gcc-4.7.1.tar.bz2
:debug:checksum Correct (sha256) checksum for gcc-4.7.1.tar.bz2
:info:checksum --->  Checksumming ecj-4.5.jar
:debug:checksum Correct (rmd160) checksum for ecj-4.5.jar
:debug:checksum Correct (sha256) checksum for ecj-4.5.jar
:debug:checksum Privilege de-escalation not attempted as not running as root.
:debug:extract extract phase started at Wed Jun 20 12:41:14 EDT 2012
:notice:extract --->  Extracting gcc47
:debug:extract setting option extract.cmd to /usr/bin/bzip2
:debug:extract Executing org.macports.extract (gcc47)
:info:extract --->  Extracting gcc-4.7.1.tar.bz2
:debug:extract setting option extract.args to '/opt/local/var/macports/distfiles/gcc47/gcc-4.7.1.tar.bz2'
:debug:extract Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.4'
:debug:extract Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/work" && /usr/bin/bzip2 -dc '/opt/local/var/macports/distfiles/gcc47/gcc-4.7.1.tar.bz2' | /usr/bin/gnutar --no-same-owner -xf -'
:debug:extract Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/work" && /usr/bin/bzip2 -dc '/opt/local/var/macports/distfiles/gcc47/gcc-4.7.1.tar.bz2' | /usr/bin/gnutar --no-same-owner -xf - 
:debug:extract euid/egid changed to: 0/0
:debug:extract chowned /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/work to macports
:debug:extract euid/egid changed to: 506/500
:debug:extract Executing proc-post-org.macports.extract-extract-0
:debug:extract Privilege de-escalation not attempted as not running as root.
:debug:patch patch phase started at Wed Jun 20 13:10:30 EDT 2012
:debug:patch Executing org.macports.patch (gcc47)
:notice:patch --->  Applying patches to gcc47
:info:patch --->  Applying ppc_fde_encoding.diff
:debug:patch Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.4'
:debug:patch Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/work/gcc-4.7.1" && /usr/bin/patch -p0'
:debug:patch Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/work/gcc-4.7.1" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/gcc47/files/ppc_fde_encoding.diff'
:info:patch patching file libffi/src/powerpc/darwin.S
:info:patch Hunk #1 FAILED at 191.
:info:patch 1 out of 1 hunk FAILED -- saving rejects to file libffi/src/powerpc/darwin.S.rej
:info:patch patching file libffi/src/powerpc/darwin_closure.S
:info:patch Hunk #1 FAILED at 253.
:info:patch 1 out of 1 hunk FAILED -- saving rejects to file libffi/src/powerpc/darwin_closure.S.rej
:info:patch Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/work/gcc-4.7.1" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/gcc47/files/ppc_fde_encoding.diff'
:info:patch Exit code: 1
:error:patch org.macports.patch for port gcc47 returned: command execution failed
:debug:patch Error code: CHILDSTATUS 27389 1
:debug:patch Backtrace: command execution failed
    while executing
"system $fullcmdstring"
    ("eval" body line 1)
    invoked from within
"eval system $notty $nice \$fullcmdstring"
    invoked from within
"command_exec patch "" "< '$patch'""
    ("default" arm line 1)
    invoked from within
"switch -- [file extension $patch] {
            .Z -
            .gz {command_exec patch "$gzcat \"$patch\" | (" ")"}
            .bz2 {command_exec p..."
    (procedure "portpatch::patch_main" line 31)
    invoked from within
"$procedure $targetname"
:info:patch Warning: targets not executed for gcc47: org.macports.install org.macports.patch org.macports.configure org.macports.build org.macports.destroot
:notice:patch Please see the log file for port gcc47 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_gcc47/gcc47/main.log

I guess I messed up copying the patch over from gcc45 to gcc47?

comment:19 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

As mentioned in another bug report, gcc47 and gcc48 specifically have supported_archs set to 'i386 x86_64' because of this and related issues. If you can provide a fix, we will certainly take it (and I suggest you work with gnu.org to get the fix included in their releases as well), but we will not be focusing our efforts on fixing issues like this.

comment:20 Changed 12 years ago by internetzel

The above Portfile I used to successfully build gcc47 on 10.5.8 ppc. I didn't try to use gcc-4.0 for the first stage.

Changed 12 years ago by internetzel

Attachment: Portfile added

Portfile for building on 10.5 ppc

Changed 12 years ago by internetzel

Attachment: ppc_fde_encoding.diff added

Patch for libffi to be compatible with more recent versions of ld64

comment:21 Changed 12 years ago by internetzel

The above patch is also needed.

comment:22 Changed 12 years ago by internetzel

Cc: tobias.netzel@… added

Cc Me!

comment:23 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: closedreopened
Summary: gcc47 and gcc48 fail to build on ppcSupport gcc47 and gcc48 on ppc

Is the configure.compiler choice really needed?

Index: Portfile
===================================================================
--- Portfile	(revision 95311)
+++ Portfile	(working copy)
@@ -26,8 +26,6 @@
                     http://www.mirrorservice.org/sites/sources.redhat.com/pub/java/:ecj \
                     http://ftp-stud.fht-esslingen.de/pub/Mirrors/sourceware.org/java/:ecj
 
-supported_archs     i386 x86_64
-
 use_bzip2           yes
 
 set ecj             ecj-4.5.jar
@@ -50,6 +48,9 @@
 
 depends_skip_archcheck-append gcc_select ld64 cctools
 
+patchfiles          ppc_fde_encoding.diff
+patch.dir           ${workpath}/gcc-${version}
+
 set major           4.7
 
 worksrcdir          build
@@ -130,6 +131,8 @@
 
 platform powerpc {
     configure.universal_archs ppc ppc64
+    depends_build-append port:apple-gcc42
+    configure.compiler apple-gcc-4.2
 }
 platform i386 {
     configure.universal_archs i386 x86_64

Does the same change work for gcc48?

comment:24 in reply to:  23 Changed 12 years ago by internetzel

Replying to jeremyhu@…:

Is the configure.compiler choice really needed?

Honestly, I didn't want to try building with gcc-4.0 considering the hours it takes to build the entire gcc on this 1.5GHz G4 and so I chose the safe way and forced it to use apple-gcc-4.2 which I had already built for other purposes. I only know that it works with the Portfile and patch that I attached. And you really have to use the ppc_fde_encoding.diff I attached because the context of the lines to patch changed slightly since gcc-4.5 . Concerning gcc48: Considering the amount of time I'd need to just try to build a prerelease version I'd never do that in the case of gcc.

comment:25 in reply to:  19 ; Changed 12 years ago by darylew@…

Replying to jeremyhu@…:

As mentioned in another bug report, gcc47 and gcc48 specifically have supported_archs set to 'i386 x86_64' because of this and related issues. If you can provide a fix, we will certainly take it (and I suggest you work with gnu.org to get the fix included in their releases as well), but we will not be focusing our efforts on fixing issues like this.

I downloaded (from SVN) GCC 4.7 and it seems to have built correctly so far. I think the problem may be related to bootstrap failure in libffi:darwin_closure for powerpc-darwin8, but it should already be fixed.

Since my attempts to fix it, I see another fix here by tobias. Maybe I'll try it with gcc47 on my 10.4.11 ppc system.

comment:26 in reply to:  25 Changed 12 years ago by internetzel

Replying to darylew@…: You need the patch against libffi only if you use ld64 to link gcc. When using the classic 32 bit ld you don't need it.

comment:27 Changed 12 years ago by darylew@…

I've been doing other stuff for several weeks. When I updated my copy of gcc46, it also automatically tried to update my copy of gcc47. It used my Apple GCC 4.0.1 system compiler, and ended with the same error that GCC 4.6 does (can't link in several functions from the C++ runtime library). I'll try redoing it with Apple GCC 4.2 and see if it solves it like for gcc46.

comment:28 in reply to:  27 ; Changed 12 years ago by darylew@…

Replying to darylew@…:

I've been doing other stuff for several weeks. When I updated my copy of gcc46, it also automatically tried to update my copy of gcc47. It used my Apple GCC 4.0.1 system compiler, and ended with the same error that GCC 4.6 does (can't link in several functions from the C++ runtime library). I'll try redoing it with Apple GCC 4.2 and see if it solves it like for gcc46.

I built GCC 4.7 with:

sudo port install gcc47 configure.compiler=apple-gcc-4.2

(It seems to ignore the compiler override if I use "upgrade" instead of "install".) The newly built gcc47 did compile my test programs, although with the same warnings as before some change broke everything:

ld: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /usr/lib/crt1.o
ld: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /opt/local/lib/gcc47/gcc/ppc-apple-darwin8/4.7.1/crt3.o
ld: warning: can't find atom for N_GSYM stabs _ZNSt17integral_constantIbLb0EE5valueE:G(0,246)=k(0,47) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZNSt17integral_constantIbLb1EE5valueE:G(0,246) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN9__gnu_cxx24__numeric_traits_integerIiE5__minE:G(0,203) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN9__gnu_cxx24__numeric_traits_integerIiE5__maxE:G(0,203) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN9__gnu_cxx25__numeric_traits_floatingIfE16__max_exponent10E:G(0,203) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN9__gnu_cxx25__numeric_traits_floatingIdE16__max_exponent10E:G(0,203) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN9__gnu_cxx25__numeric_traits_floatingIeE16__max_exponent10E:G(0,203) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN9__gnu_cxx24__numeric_traits_integerImE8__digitsE:G(0,203) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN9__gnu_cxx24__numeric_traits_integerIcE5__maxE:G(0,247)=k(0,248)=r(0,248);0;127; in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN9__gnu_cxx24__numeric_traits_integerIsE5__minE:G(0,249)=k(0,250)=@s16;r(0,250);-32768;32767; in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN9__gnu_cxx24__numeric_traits_integerIsE5__maxE:G(0,249) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_aiIiLm0EE4rankE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_aiIiLm0EE13element_countE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_aiIiLm0EE10dimensionsE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_arIiLm0EE10dimensionsE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_aiIiLm1EE4rankE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_aiIiLm1EE13element_countE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_aiIiLm1EE10dimensionsE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_arIiLm1EE4rankE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_arIiLm1EE13element_countE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_arIiLm1EE10dimensionsE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_aiIiLm2EE4rankE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_aiIiLm2EE13element_countE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_aiIiLm2EE10dimensionsE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_arIiLm2EE4rankE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_aiIiLm3EE4rankE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_aiIiLm3EE13element_countE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_aiIiLm3EE10dimensionsE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZN5boost4math14cdh_complex_arIiLm3EE4rankE:G(0,32) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o
ld: warning: can't find atom for N_GSYM stabs _ZNSt26linear_congruential_engineIjLj16807ELj0ELj2147483647EE12default_seedE:G(0,159) in bin/cayley_example.test/gcc-4.7/debug/cayley_example.o

A source of concern is that MacPorts' versions of ISL and CLooG are older than what GCC 4.7 wants (0.07 and 0.16.3 instead of 0.10 and 0.17.0, respectively). That could be the cause of the whole mess, since I suspect the problem is on our end. (When I tried building GCC 4.7 from GNU's archives, it seemed OK, although I never fully installed it.)

comment:29 Changed 12 years ago by jmroot (Joshua Root)

Cc: mww@… added; jeremyhu@… removed

comment:30 in reply to:  28 Changed 12 years ago by internetzel

Replying to darylew@…: Those warnings are because of ld64. The "-mlong-branch" warning should be disabled in the ld64 port when building for Tiger. The "N_GSYM stabs" warning is because ld64 doesn't support stabs debug symbols (default until Xcode 2.3 I think) as well as dwarf debug symbols (default from Xcode 2.4 on). gcc should be configured with "--with-dwarf2" to get rid of this warning.

comment:31 Changed 12 years ago by yihua1218@…

Cc: yihua1218@… added

Cc Me!

comment:32 Changed 12 years ago by hapaguy (Brian Kurt Fujikawa)

Cc: brian.fujikawa@… added

Cc Me!

comment:33 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Can someone please summarize the state of gcc on ppc? AIUI, the only issue currently is with 4.7 and 4.8, right?

@darylew, your comment a few weeks ago make it sound like you got at least 4.7 to build. If that's the case, can you please provide a patch to the Portfile?

comment:34 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

Cc Me!

Changed 12 years ago by internetzel

Attachment: gcc-4.7.2.patch added

This patch should be applied to gcc when using ld64 as the linker. It makes the long-branch warning go away and produces the best suitable code for ld64.

comment:35 Changed 12 years ago by internetzel

I recommend the above patch together with the use of ld64 (by means of building using apple-gcc42). I strongly discourage any further use of the old classic linker. The above patch doesn't make all long-branch warning go away since there are other crt files that Apple distributed separatly in its Csu open source project. In fact I recommend that rebuilding those crt files be part of the compiler bootstrap like the other crt files. Here I uploaded rebuilt Csu crt files that should be placed next to the existing ones so that they take precedence of the ones installed with Apple Developer Tools (for example in /opt/local/lib/gcc46/gcc/ppc-apple-darwin8/4.6.3/): http://tenfourfox.googlecode.com/issues/attachment?aid=520194000&name=crt.zip&token=7tC0Xg3z8e_7G2yoIY05eLcXsuc%3A1357070857178 Some modifications to the Csu makefile are necessary to get that project compiled. In case of interest I'll add them here.

Furthermore in order to get the feature objc-direct-dispatch working again one may compile/assemble the following file and add it to the libgcc static library, that way providing the missing symbols produced when trying to link ObjC(++) object files that were built with that feature switched on: http://tenfourfox.googlecode.com/issues/attachment?aid=520093000&name=objc_msgSend_Fast.s&token=dbkk8mEl6q3KISJLo-b-I7s99zU%3A1357070857157

Last edited 12 years ago by internetzel (previous) (diff)

comment:36 Changed 12 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:37 Changed 11 years ago by jdgleeson

gcc48 now builds on ppc.

comment:38 Changed 11 years ago by jdgleeson

Cc: jdgleeson@… added

Cc Me!

comment:39 Changed 11 years ago by jdgleeson

For the record, I've done only limited testing of gcc48 on ppc. The ports I've built with it are atlas, fftw-3, and py27-numpy. The numpy test results are

    Ran 4459 tests in 88.311s
                
    FAILED (KNOWNFAIL=8, SKIP=25, failures=1)

Except for the one unexpected failure, this is identical to what I get when I build with gcc4{5,6,7}. (The gcc45 variant of py27-numpy was linked with Accelerate. All other gcc variants of py27-numpy were linked with atlas)

comment:40 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Port: gcc49 added; gcc42 gcc47 removed
Summary: Support gcc47 and gcc48 on ppcSupport gcc48 and gcc49 on ppc

Thanks for the report. I'll remove the supported_archs line in a coming revbump.

comment:41 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.