Opened 10 years ago

Closed 9 years ago

#43737 closed defect (fixed)

ld64 @236.3_1 build failure with g++-4.2 on OS X 10.6.8

Reported by: mopihopi Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: snowleopard Cc: mndavidoff (Monte Davidoff), schmittj@…, astrofitz (Michael Fitzgerald), aag6581@…, tommaso.vinci@…, cooljeanius (Eric Gallager), apaye026@…, ivl1705, jdasmith@…, gnw3, jumasoal@…, physadair@…, dliessi (Davide Liessi), spinach@…, wilson@…, null-macports.org@…, lance@…, mkae (Marko Käning), jenstroeger (Jens Troeger), StanSanderson, udbraumann, bitpup, jschwab@…, pattylin@…, eborisch (Eric A. Borisch), melissa.m.hoffman@…, frozencemetery (Robbie Harwood), otto.hasselblad@…, ctreleaven (Craig Treleaven)
Port: ld64

Description

Upgrading or installing ld64 on OS X 10.6.8 with g++ 4.2 produces a build failure.

--->  Building ld64
Error: org.macports.build for port ld64 returned: command execution failed
Please see the log file for port ld64 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_ld64/ld64/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port ld64 failed
...
:info:build /usr/bin/g++-4.2 -Os -Os  -arch x86_64 -I/opt/local/libexec/llvm-3.4/include -DLTO_SUPPORT -Isrc/abstraction -Isrc/ld -Isrc/ld/parsers -I/opt/local/include  -c -o src/other/dyldinfo.o src/other/dyldinfo.cpp
:info:build src/ld/parsers/macho_relocatable_file.cpp: In member function ‘const char* mach_o::relocatable::CUSection<A>::personalityName(mach_o::relocatable::Parser<A>&, const macho_relocation_info<typename A::P>*) [with A = x86_64]’:
:info:build src/ld/parsers/macho_relocatable_file.cpp:4484: error: ‘ld::Section’ is not a template
...

Attachments (4)

ld64-236.3_1+llvm34.log (42.5 KB) - added by mopihopi 10 years ago.
ld64 @236.3_1 +llvm34 build log with g++ 4.2 on OS X 10.6.8
ld64.error.log (30.1 KB) - added by raramayo (Rodolfo Aramayo) 10 years ago.
ld64.error.1.log (31.6 KB) - added by raramayo (Rodolfo Aramayo) 10 years ago.
ld64-blacklist-fix.patch (280 bytes) - added by mopihopi 10 years ago.
fix conflicting compiler blacklist

Download all attachments as: .zip

Change History (56)

Changed 10 years ago by mopihopi

Attachment: ld64-236.3_1+llvm34.log added

ld64 @236.3_1 +llvm34 build log with g++ 4.2 on OS X 10.6.8

comment:1 Changed 10 years ago by mndavidoff (Monte Davidoff)

Cc: md14-macports@… added

Cc Me!

comment:2 Changed 10 years ago by mf2k (Frank Schima)

Cc: jeremyhu@… removed
Owner: changed from macports-tickets@… to jeremyhu@…

comment:3 Changed 10 years ago by schmittj@…

Cc: schmittj@… added

Cc Me!

comment:4 Changed 10 years ago by raramayo (Rodolfo Aramayo)

Cc Me!

Observing same behavior bot updating and/or installing

Changed 10 years ago by raramayo (Rodolfo Aramayo)

Attachment: ld64.error.log added

Changed 10 years ago by raramayo (Rodolfo Aramayo)

Attachment: ld64.error.1.log added

comment:5 Changed 10 years ago by astrofitz (Michael Fitzgerald)

Cc: astrofitz@… added

Cc Me!

comment:6 Changed 10 years ago by aag6581@…

Cc Me!

Got the same error. 10.6.8, gcc 4.2.1, macports 2.2.1

comment:7 Changed 10 years ago by aag6581@…

Cc: aag6581@… added

Cc Me!

comment:8 Changed 10 years ago by tommaso.vinci@…

Cc: tommaso.vinci@… added

Cc Me!

comment:9 Changed 10 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:10 Changed 10 years ago by apaye026@…

Cc: apaye026@… added

Cc Me!

comment:11 Changed 10 years ago by ivl1705

Cc: listmember@… added

Cc Me!

comment:12 Changed 10 years ago by jdasmith@…

Cc: jdasmith@… added

Cc Me!

Same error. OSX 10.6.8, irrespective of port select gcc flavour - none, gcc42, mp-gcc47

Last edited 10 years ago by jdasmith@… (previous) (diff)

comment:13 Changed 10 years ago by gnw3

Cc: gnwiii@… added

Cc Me!

comment:14 Changed 10 years ago by jumasoal@…

Cc: jumasoal@… added

Cc Me!

comment:15 Changed 10 years ago by physadair@…

Cc: physadair@… added

Cc Me!

comment:16 Changed 10 years ago by dliessi (Davide Liessi)

Cc: davide.liessi@… added

Cc Me!

comment:17 Changed 10 years ago by spinach@…

Cc: spinach@… added

Cc Me!

comment:18 in reply to:  description Changed 10 years ago by spinach@…

I have the same problem... gcc44 fails because of an ld64 error.

What I have tried:

sudo port clean ld64
sudo port install ld64

same error as below

After many gyrations, I even tried uninstalling macports and reinstalling it -- also that didn't work.

I also removed all files from /usr/local, as was suggested in a different forum and that didn't help.

I've also tried:

sudo port -v sync
sudo port -v -f uninstall cctools cctools-headers dyld-headers ld64
sudo port -v install cctools

That also didn't work. I keep getting the same error:

--->  Building ld64
Error: org.macports.build for port ld64 returned: command execution failed
Please see the log file for port ld64 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_ld64/ld64/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port ld64 failed

I'm running OS 10.6.8 (snow leopard) on a MacPro 1,1 with 16GB of ram.

Last edited 10 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:19 Changed 10 years ago by mopihopi

I was able to work around the issue using:

sudo port clean ld64
sudo port upgrade ld64 configure.compiler=macports-clang-3.4

Of course, this requires clang-3.4. It would probably work with another version of clang if you have a different one installed.

comment:20 in reply to:  19 Changed 10 years ago by tommaso.vinci@…

Replying to mopihopi@…:

Of course, this requires clang-3.4. It would probably work with another version of clang if you have a different one installed.

... and it doesn't work if you try first to install clang because it needs ld64 ...

comment:21 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: wilson@… added

Has duplicate #43790.

comment:22 in reply to:  21 Changed 10 years ago by spinach@…

Replying to ryandesign@…:

Has duplicate #43790

There is actually a lot of duplicate tickets citing this problem but none, that I could find, actually solved the problem. Any help is greatly appreciated.

comment:23 Changed 10 years ago by null-macports.org@…

cc me!

comment:24 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: null-macports.org@… lance@… added

Has duplicate #43801.

comment:25 in reply to:  19 Changed 10 years ago by papadopoulos_dimitrios@…

Replying to mopihopi@…:

I was able to work around the issue using:

sudo port clean ld64
sudo port upgrade ld64 configure.compiler=macports-clang-3.4

Of course, this requires clang-3.4. It would probably work with another version of clang if you have a different one installed.

This lead to error: infinite loop. But I tried with sudo port upgrade ld64 configure.compiler=macports-clang-3.2 and it worked for me. Thanks!

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

And not to mention ld64 is a dependency of clang, so ...

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

Does it work with llvm-gcc-4.2? If nobody can provide a patch for this, we may just have to keep Snow Leopard users at an older ld64 version

comment:28 Changed 10 years ago by jdasmith@…

Hmm, I thought I had responded here, but perhaps I ended up doing so on one of the many duplicates.

Given UsingTheRightCompiler to find the appropriate compilers:

I have tried

lassi:~ jonny$ sudo port clean ld64
Password:
--->  Cleaning ld64
lassi:~ jonny$ sudo port select --list gcc
Available versions for gcc:
        apple-gcc42
        gcc40
        gcc42
        llvm-gcc42 (active)
        mp-gcc47
        none
lassi:~ jonny$ sudo port upgrade ld64 configure.compiler=llvm-gcc-4.2
--->  Computing dependencies for ld64
--->  Fetching archive for ld64
--->  Attempting to fetch ld64-236.3_1+llvm32.darwin_10.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/ld64
--->  Attempting to fetch ld64-236.3_1+llvm32.darwin_10.x86_64.tbz2 from http://lil.fr.packages.macports.org/ld64
--->  Attempting to fetch ld64-236.3_1+llvm32.darwin_10.x86_64.tbz2 from http://nue.de.packages.macports.org/macports/packages/ld64
--->  Fetching distfiles for ld64
--->  Verifying checksums for ld64
--->  Extracting ld64
--->  Applying patches to ld64
--->  Configuring ld64
--->  Building ld64
Error: org.macports.build for port ld64 returned: command execution failed
Please see the log file for port ld64 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.                                                                                                  org_release_tarballs_ports_devel_ld64/ld64/main.log
Error: Unable to upgrade port: 1
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets

lassi:~ jonny$ cat /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_ld64/ld64/main.log | grep -i error
:debug:archivefetch Fetching archive failed:: The requested URL returned error: 404
:debug:archivefetch Fetching archive failed:: The requested URL returned error: 404
:debug:archivefetch Fetching archive failed:: The requested URL returned error: 404
:info:build src/ld/parsers/macho_relocatable_file.cpp:4484: error: ‘ld::Section’ is not a template
:info:build src/ld/parsers/macho_relocatable_file.cpp:4504: error: ‘ld::Section’ is not a template
:info:build src/ld/parsers/macho_relocatable_file.cpp:4512: error: ‘class ld::Section’ has no member named ‘machoSection’
:info:build src/ld/parsers/macho_relocatable_file.cpp:4531: error: ‘ld::Section’ is not a template
:info:build src/ld/parsers/macho_relocatable_file.cpp:6951: error: using ‘typename’ outside of template
:info:build make: *** [src/ld/parsers/macho_relocatable_file.o] Error 1
:error:build org.macports.build for port ld64 returned: command execution failed
:debug:build Error code: CHILDSTATUS 25082 2

I have additionally tried setting gcc to the other compilers listed here, cleaning, then setting macports to build ld64 with the configure.compiler set (except apple, which I tried to build, but only got half way because it needed ld64)

There is only the one ld64 showing in macports, so I think no macports user option to downgrade to get a snow leopard system working again. I'm happy to try any suggestions.

Last edited 10 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:29 Changed 10 years ago by mkae (Marko Käning)

Cc: mk@… added

Cc Me!

comment:30 in reply to:  27 Changed 10 years ago by mopihopi

Replying to jeremyhu@…:

Does it work with llvm-gcc-4.2? If nobody can provide a patch for this, we may just have to keep Snow Leopard users at an older ld64 version

It doesn't build with any g++ that I tried (gcc++-4.2, llvm-g++-4.2, or g++-mp-4.[4-8]), but builds at least with configure.compiler=macports-clang-3.[1-4] if that compiler is installed.

Is it possible to get current ld64 and clang-3.4 binary archives on packages.macports.org to avoid the circular dependency?

It appears that current clang-3.2 binary archives are available for Snow Leopard, so anyone that doesn't already have a clang-3.x installed may be able to get it working by installing clang-3.2 (perhaps with -n to avoid updating the ld64 dependency) and then upgrading or installing ld64 with configure.compiler=macports-clang-3.2 as in comment:25.

comment:31 Changed 10 years ago by pietvo (Pieter van Oostrum)

I could install ld64 with configure.compiler=macports-clang-3.3 which I happened to have installed.

comment:32 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jens.troeger@… added

Has duplicate #43813.

comment:33 in reply to:  31 ; Changed 10 years ago by ivl1705

Replying to piet@…:

I could install ld64 with configure.compiler=macports-clang-3.3 which I happened to have installed.

worked for me

System Version: Mac OS X 10.6.8; MacPorts Version: 2.2.1

comment:34 Changed 10 years ago by StanSanderson

Cc: stansand@… added

Cc Me!

comment:35 Changed 10 years ago by udbraumann

Cc: braumann@… added

Cc Me!

comment:36 Changed 10 years ago by bitpup

Cc: wheeltong@… added

Cc Me!

comment:37 Changed 10 years ago by jschwab@…

Cc: jschwab@… added

Cc Me!

comment:38 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: pattylin@… added
Keywords: snowleopard added

Has duplicate #43833.

comment:39 Changed 10 years ago by eborisch (Eric A. Borisch)

Cc: eborisch@… added

Cc Me!

comment:40 Changed 10 years ago by melissa.m.hoffman@…

Cc: melissa.m.hoffman@… added

Cc Me!

comment:41 Changed 10 years ago by frozencemetery (Robbie Harwood)

Cc: rharwood@… added

Cc Me!

comment:42 Changed 10 years ago by otto.hasselblad@…

Cc: otto.hasselblad@… added

Cc Me!

comment:43 in reply to:  33 Changed 10 years ago by frozencemetery (Robbie Harwood)

Replying to listmember@…:

Replying to piet@…:

I could install ld64 with configure.compiler=macports-clang-3.3 which I happened to have installed.

worked for me

System Version: Mac OS X 10.6.8; MacPorts Version: 2.2.1

Same process for me works with macports-clang-3.4 on OSX 10.6.8 with MacPorts 2.3.0

comment:44 Changed 10 years ago by ctreleaven (Craig Treleaven)

Cc: ctreleaven@… added

Cc Me!

comment:45 Changed 10 years ago by mopihopi

I had resolved this on my system by building ld64 @236.3_1 with clang-3.4, however during an update today, MacPorts automatically "updated" it to the old version @136_2 :(.

ld64 @236.3_1 should build on Snow Leopard if all versions of gcc are blacklisted. It looks like there was an attempt to do that in r120447, however the Snow Leopard buildbot still tried (and failed) to build with g++-4.2. I'm guessing that is because there is another blacklist line after that one in the Portfile, which overrides it. If the blacklist conflict is corrected (which should be done anyway for the other OS X versions) that should make it possible to reinstate this fix for Snow Leopard.

There is also now a current Snow Leopard binary archive for all of the clang versions, allowing the circular dependency issue to be avoided to build ld64 from source when clang-3.x is not already installed.

comment:46 in reply to:  45 Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Replying to mopihopi@…:

I had resolved this on my system by building ld64 @236.3_1 with clang-3.4, however during an update today, MacPorts automatically "updated" it to the old version @136_2 :(.

Yes ... so as to not block everything dependent on ld64 ;)

ld64 @236.3_1 should build on Snow Leopard if all versions of gcc are blacklisted.

Yes, however that causes a dependency cycle. clang depends on ld64.

There is also now a current Snow Leopard binary archive for all of the clang versions, allowing the circular dependency issue to be avoided to build ld64 from source when clang-3.x is not already installed.

That's not really a valid argument. We need to ensure there is no cycle.

comment:47 Changed 10 years ago by alex.hanselmann@…

I question the scope of the bug? I just updated to MacPorts 2.3.0 on a OSX 10.7.5 computer. The compiling of ld64(ld64-236.3) fails too. The using of Clang-3-4 as a solution fails too.

Some details of the process that stopped at executing: make -j2 -w all CC="/usr/bin/llvm-gcc-4.2" CXX="/usr/bin/llvm-g++-4.2" OTHER_CPPFLAGS="-I/opt/local/include" OTHER_CFLAGS="-Os -arch x86_64" OTHER_CXXFLAGS="-Os -arch x86_64" OTHER_LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64" RC_SUPPORTED_ARCHS="armv6 armv7 i386 x86_64" LLVM_CONFIG=/opt/local/bin/llvm-config-mp-3.3.

This make run consisted of the problematic part that failed "-/usr/bin/llvm-g++-4.2 -Os -Os -arch x86_64 -I/opt/local/libexec/llvm-3.3/include -DLTO_SUPPORT -Isrc/abstraction -Isrc/ld -Isrc/ld/parsers -I/opt/local/include -c -o src/ld/passes/stubs/stubs.o src/ld/passes/stubs/stubs.cpp"

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

Just update and install 136.

Changed 10 years ago by mopihopi

Attachment: ld64-blacklist-fix.patch added

fix conflicting compiler blacklist

comment:49 in reply to:  47 ; Changed 10 years ago by mopihopi

Replying to alex.hanselmann@…:

I question the scope of the bug? I just updated to MacPorts 2.3.0 on a OSX 10.7.5 computer. The compiling of ld64(ld64-236.3) fails too. The using of Clang-3-4 as a solution fails too.

This bug affects users of later OS X versions if their default C++ compiler is not clang. I think that includes Lion users using a version of XCode earlier than about 4.3 or 4.2. If you don't want to update your XCode I would expect that compiling with macports-clang-3.4 would work.

make -j2 -w all CC="/usr/bin/llvm-gcc-4.2" CXX="/usr/bin/llvm-g++-4.2" OTHER_CPPFLAGS="-I/opt/local/include" OTHER_CFLAGS="-Os -arch x86_64" OTHER_CXXFLAGS="-Os -arch x86_64" OTHER_LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64" RC_SUPPORTED_ARCHS="armv6 armv7 i386 x86_64" LLVM_CONFIG=/opt/local/bin/llvm-config-mp-3.3.

That says that it is using llvm-gcc-4.2 (the default compiler in XCode 4.1). Unfortunately ld64 @236.3_1 does not compile with that compiler. If you haven't done so already, you might try this:

sudo port clean ld64
sudo port upgrade ld64 -llvm33 +llvm34 configure.compiler=macports-clang-3.4

I've also attached a simple patch for the conflicting blacklist in the Portfile, which should prevent it from trying that compiler by default.

comment:50 in reply to:  49 Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Replying to mopihopi@…:

Replying to alex.hanselmann@…:

I question the scope of the bug? I just updated to MacPorts 2.3.0 on a OSX 10.7.5 computer. The compiling of ld64(ld64-236.3) fails too. The using of Clang-3-4 as a solution fails too.

This bug affects users of later OS X versions if their default C++ compiler is not clang. I think that includes Lion users using a version of XCode earlier than about 4.3 or 4.2. If you don't want to update your XCode I would expect that compiling with macports-clang-3.4 would work.

Yes. People running unsupported configurations may need to jump through hoops. There's really no reason to be on such an old version of Xcode on Lion.

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

r120606 has your blacklist update, thanks.

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

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