[MacPorts] #31171: building gcc46 on osx lion fails

MacPorts noreply at macports.org
Sat Oct 15 15:10:00 PDT 2011


#31171: building gcc46 on osx lion fails
------------------------------+---------------------------------------------
 Reporter:  okpail@…          |       Owner:  mww@…           
     Type:  defect            |      Status:  new             
 Priority:  Normal            |   Milestone:                  
Component:  ports             |     Version:                  
 Keywords:                    |        Port:  gcc46           
------------------------------+---------------------------------------------

Comment(by cdecoro@…):

 Why hasn't more priority been placed on this? gcc is unarguably the most
 important port; if it doesn't work, then MacPorts is useless for a lot of
 people.

 In any case, I've found a cumbersome manual workaround. The problem occurs
 when the makefile attempts to link libgcc_s. For some reason, ld has a
 problem with memory management. However, inexplicably, this only happens
 when attempting to build libgcc_s through the port system (probably
 because of some environment settings, but that's just a guess). If you go
 to the following directory (you should probably be root, btw):

 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc46/gcc46/work/build/x86_64
 -apple-darwin11/libgcc

 and run make, libgcc_s will build just fine (you will see some warnings
 from malloc, but no errors).

 Ideally, you would then be able to run make from the top level directory:

 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc46/gcc46/work/build/

 However, for some reason, the Makefile will attempt to rebuild libgcc_s no
 matter what. So you will need to comment out the line in Makefile that
 does that. Search for:

 all-stage3-target-libgcc: configure-stage3-target-libgcc

 which will be approximately on line 14830. The line to comment is a bit
 below that, and starts with:

 cd $(TARGET_SUBDIR)/libgcc && \
         $(MAKE) $(BASE_FLAGS_TO_PASS) \

 I may have also commented some things out under the target configure-
 stage3-target-libgcc, unfortunately I can't remember at this point, sorry.

 Then run make again in the top-level directory. If you have the gfortran
 variant enabled, you will get a similar error when ld attempts to link
 libgfortran. You will need to go into the directory:

 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc46/gcc46/work/build/x86_64
 -apple-darwin11/libgfortran

 and run make. Again, it will give warnings, but no errors. For whatever
 reason, you do not need to comment out the top-level makefile to have it
 avoid remaking this directory.

 Now, run make from the top-level directory again, and it should finally
 build. Then run make install, and you should be all set. gcc46 appears to
 be working fine for me. Your mileage may vary, of course.

-- 
Ticket URL: <https://trac.macports.org/ticket/31171#comment:12>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list