Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#46519 closed defect (fixed)

ld64 @97.17_4 fails building on 10.5.8. PPC

Reported by: udbraumann Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: leopard powerpc Cc: ryandesign (Ryan Carsten Schmidt)
Port: ld64

Description

...

:info:build /usr/bin/g++-4.2 -Os -Os  -arch ppc  -Isrc/abstraction -Isrc/ld -I/opt/local/include -I/opt/local/Developer/SDKs/Darwin9.sdk/usr/include  -c -o src/other/ObjectDump.o src/other/ObjectDump.cpp
:info:build In file included from src/ld/MachOReaderRelocatable.hpp:43,
:info:build                  from src/other/ObjectDump.cpp:31:
:info:build /opt/local/Developer/SDKs/Darwin9.sdk/usr/include/libunwind/DwarfInstructions.hpp: In static member function ‘static typename A::pint_t libunwind::DwarfInstructions<A, R>::getCFA(A&, const typename libunwind::CFI_Parser<A>::PrologInfo&, const R&)’:
:info:build /opt/local/Developer/SDKs/Darwin9.sdk/usr/include/libunwind/DwarfInstructions.hpp:75: error: there are no arguments to ‘__builtin_unreachable’ that depend on a template parameter, so a declaration of ‘__builtin_unreachable’ must be available
:info:build /opt/local/Developer/SDKs/Darwin9.sdk/usr/include/libunwind/DwarfInstructions.hpp:75: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
:info:build /opt/local/Developer/SDKs/Darwin9.sdk/usr/include/libunwind/DwarfInstructions.hpp: In static member function ‘static int libunwind::DwarfInstructions<A, R>::stepWithDwarf(A&, typename A::pint_t, typename A::pint_t, R&)’:
:info:build /opt/local/Developer/SDKs/Darwin9.sdk/usr/include/libunwind/DwarfInstructions.hpp:209: error: ‘UNW_STEP_SUCCESS’ was not declared in this scope

...

ObjectDump.cpp is the very first file to compile. There is a lot of subsequent errors, see the attached main.log

Attachments (2)

main.log (87.5 KB) - added by udbraumann 10 years ago.
full error log
ppc.patch (1.4 KB) - added by jeremyhu (Jeremy Huddleston Sequoia) 10 years ago.

Download all attachments as: .zip

Change History (18)

Changed 10 years ago by udbraumann

Attachment: main.log added

full error log

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

Cc: jeremyhu@… removed
Keywords: leopard powerpc added; 10.5.8 removed
Owner: changed from macports-tickets@… to jeremyhu@…

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

While there are a ton of warnings, it builds fine on Leopard/Intel with gcc-4.2. I am also able to compile ObjectDump.cpp in ld64-127.2 successfully by a copy/paste of the failing command line. Note that the reporter is *on* ppc and thus trying to compile ld64-97.17

comment:3 Changed 10 years ago by udbraumann

Yes, I am on ppc, and the previous version ld64 @97.17_3 was building without problems, so what has been changed for ld64 @97.17_4 ?

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

The only change between 97.17_3 and 97.17_4 was that 97.17_4 now skips building and installing libprunetrie.a.

The likely issue here is not a difference between 97.17_3 and 97.17_4 but rather a change made in 97.17_3 without a revbump ... specifically, changes to the libunwind-headers port.

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

r131410 for the __builtin_unreachable() bug. Also see http://www.llvm.org/bugs/show_bug.cgi?id=22198

I'm able to reproduce some of this by editing the port to force 97.17 on Yosemite and building like:

sudo port -v -s destroot ld64 -universal cxx_stdlib=libstdc++

I'll try to address these build errors and see how much that helps you.

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

As of r131415, libunwind itself builds fine on Leopard with:

sudo port -v -s install libunwind +universal configure.compiler=gcc-4.2 build_arch=ppc universal_archs="x86_64 i386 ppc"

Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Attachment: ppc.patch added

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

Try applying the provided patch to the ld64 Portfile. I'm curious if ld64-127.7 now builds ok for Leopard/ppc.

comment:8 in reply to:  7 Changed 10 years ago by udbraumann

Have patched the Portfile, and now ld64-127.7 compiles for a while, but suddenly a file llvm-c/lto.h is missing:

...

:info:build /usr/bin/g++-4.2 -Os -Os  -arch ppc  -Isrc/abstraction -Isrc/ld -Isrc/ld/parsers -I/opt/local/include -I/opt/local/Developer/SDKs/Darwin9.sdk/usr/include  -c -o src/ld/parsers/lto_file.o src/ld/parsers/lto_file.cpp
:info:build src/ld/parsers/lto_file.cpp:49:24: error: llvm-c/lto.h: No such file or directory
:info:build src/ld/parsers/lto_file.cpp:114: error: ‘lto_module_t’ does not name a type

...

As far as I can see, there is even no llvm-c folder. What can I do now? Do you need the full main.log?

Last edited 10 years ago by udbraumann (previous) (diff)

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

Cc: ryandesign@… added

Cc Me!

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

Resolution: fixed
Status: newclosed

With r131450, I was able to build ld64-97.17 on Leopard for i386 and x86_64 with:

sudo port -v -s destroot ld64 cxx_stdlib=libstdc++
configure.compiler=gcc-4.2

(and manually editing the Portfile to force the 97 version).

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

I'm also setting up a universal i386/ppc prefix now to see if I can get 127 working for ppc.

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

Yep, seems to build on Leopard/ppc now.

comment:13 in reply to:  12 Changed 10 years ago by udbraumann

Thanks, but there is still some trouble

After issuing

$ sudo port selfupdate

I checked

$ sudo port outdated
The following installed ports are outdated:
automake                       1.14.1_2 < 1.15_0
ld64                           97.17_3 < 127.2_9
libunwind-headers              3.5.0_3 < 3.5.0_7
tcl                            8.6.1_0 < 8.6.3_0
tk                             8.6.1_2 < 8.6.3_0

Unfortunately this follows:

$ sudo port upgrade ld64
Error: Your platform cannot be configured without LTO support in ld64.  Please enable one of the llvmXX variants, and try again.
Error: Unable to open port: Your platform cannot be configured without LTO support in ld64.  Please enable one of the llvmXX variants, and try again.
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets

However, I have installed llvmXX variants:

$ sudo port installed | grep llvm
  cctools @806_4+llvm34 (active)
  llvm-3.1 @3.1_8 (active)
  llvm-3.4 @3.4.2_1 (active)
  llvm_select @1.0_0 (active)

What is still going wrong?

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

You have a couple llvm ports installed, but what the message is telling you is that you have not selected one of the llvm variants of the ld64 port.

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

ld64-97 can be installed without LTO support to enable bootstrapping llvm on Tiger. ld64-127 cannot be installed without LTO support. Leopard/ppc can now build ld64-127, so it needs to be built with LTO support (an +llvm variant needs to be active).

+llvm34 is a default variant for ld64 on Leopard, but port upgrade tries to preserve your chosen variants (in this case no llvm variant selected).

I suggest that you do:

sudo port -v -s upgrade ld64 +llvm34

comment:16 in reply to:  15 Changed 10 years ago by udbraumann

Has worked great, thanks, sorry for confusing variants with ports.

Note: See TracTickets for help on using tickets.