Changes between Initial Version and Version 1 of Ticket #64525, comment 9


Ignore:
Timestamp:
Jan 27, 2022, 8:22:38 AM (3 years ago)
Author:
barracuda156
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #64525, comment 9

    initial v1  
    11Replying to [comment:8 kencu]:
    2 > Replying to [comment:4 barracuda156]:
    3 >
    4 > You have, in MacPorts, the ld that comes with Xcode (which is usually also the one installed in the system at /usr) although with 10.6.8 that can be confused as there are several choices for Xcode.
    5 >
    6 > You have ld64-97, and ld64-127.
    7 >
    8 > After that, PowerPC support is not present in MacPorts linkers.
    9 >
    10 > We used to think that ld64-97 was best for Tiger, and ld64-127 was best for Leopard PPC, but explorations over the past month that we have done, as you know, show that ld64-97 is probably today the most reliable general linker for PowerPC code.
    11 >
    12 > It is still not 100% clear if there are cases where certain things will not build with ld64-97 but do build with ld64-127 that might mess that up, for example rpath support, etc, etc, etc.
    13 >
    14 > > And how can I switch between these? `--with-ld=` works sometimes, but often is not recognized by compiler or build system (or maybe I use it in a wrong way).
    15 >
    16 > That is not always simple to say. Each compiler has a default linker that it knows where to find. It can be hard to override that default linker by using build or configure lines, so what MacPorts did instead is change what that default linker points to by using the ld64 "shim" port that installs symlinks to the desired linker.
    17 >
    18 > But that is default linker for the whole system, and it's not simple to change on a build-by-build basis.
    19 >
    20 > If you want the compiler to use a linker other than a default linker, you need to explore what environment variables and build arguments that compiler is prepared to respond to. Some trial-and-error can be involved.
    21 >
    22 > See <https://stackoverflow.com/questions/40470931/how-to-specify-alternate-linker-command-when-linking-with-cc> for example, and <https://gcc.gnu.org/onlinedocs/gccint/Driver.html#Driver> and probably many other google hits that might well be better.
     2
     3(I have written a long comment but due to connection cut it is gone.)
     4
     5Thank you for the info. I will go through these links.
     6
     7As I have mentioned, I have two installations of 10.6.8 now, one with latest supported Xcode where I was building for x86_64+ppc and another with Xcode 3.2 (for compatibility with 10.6 PPC).
     8It is possible that Xcode 3.2 linkers have problems building some software (like ld64-127 has problems with ppc64). However I have built gcc7 and many ports using a linker and tools from 10A190/10A222 without issues.