Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#64920 closed enhancement (wontfix)

Allow universal variant for llvm-5.0

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: powerpc, leopard, ppc64 Cc:
Port: llvm-5.0

Description

For an unclear reason, llvm-5.0 lacks universal variant, and subsequently +universal is simply ignored, it gets built for a single arch. However it does build as +universal once muniversal 1.0 PortGroup is added and variant description is borrowed from earlier llvm:

platform darwin {
    supported_archs ppc ppc64 i386 x86_64
}

variant universal {
    build.env-append \
        UNIVERSAL=1 \
        UNIVERSAL_ARCH=[get_canonical_archs]
    destroot.env-append \
        UNIVERSAL=1 \
        UNIVERSAL_ARCH=[get_canonical_archs]

    post-extract {
        # workaround a bug in Apple's shipped gcc driver-driver, patched in
        # ours with driverdriver-num_infiles.patch
        if {${configure.compiler} eq "gcc-4.0" ||
            ${configure.compiler} eq "gcc-4.2" ||
            ${configure.compiler} eq "llvm-gcc-4.2"} {
            system "echo \"static int ___ignoreme;\" > ${worksrcpath}/tools/llvm-shlib/ignore.c"
        }
    }
}

Then I built it with macports-gcc-7:

36-109:~ svacchanda$ port -v installed llvm-5.0
The following ports are currently installed:
  llvm-5.0 @5.0.2_3 requested_variants='' platform='darwin 9' archs='ppc64' date='2022-04-01T05:40:26+0800'
  llvm-5.0 @5.0.2_3+universal (active) requested_variants='+universal' platform='darwin 9' archs='ppc ppc64' date='2022-04-01T08:52:50+0800'

Change History (2)

comment:1 Changed 2 years ago by kencu (Ken)

Resolution: wontfix
Status: newclosed

llvm-5.0 has a universal variant, and builds universal just fine and dandy -- however, it is only enabled to build universal as i386/x86_64, as PowerPC llvm-5.0 is broken and so it is not enabled in the main MacPorts repo.

Most of what you added is not used for the llvm-5.0 branch -- it was used for an older llvm build that built with autotools and is no longer used.

Someday, if Iain or somebody else actually fixes llvm-7.0 (or whichever) to actually work properly, then perhaps some kind soul might properly fix a build for PowerPC that might be accepted into MacPorts, once it is fully tested and vetted to work.

comment:2 in reply to:  1 Changed 2 years ago by barracuda156

Replying to kencu:

llvm-5.0 has a universal variant, and builds universal just fine and dandy -- however, it is only enabled to build universal as i386/x86_64, as PowerPC llvm-5.0 is broken and so it is not enabled in the main MacPorts repo.

Most of what you added is not used for the llvm-5.0 branch -- it was used for an older llvm build that built with autotools and is no longer used.

Someday, if Iain or somebody else actually fixes llvm-7.0 (or whichever) to actually work properly, then perhaps some kind soul might properly fix a build for PowerPC that might be accepted into MacPorts, once it is fully tested and vetted to work.

I had a lesser aim in mind, to build ld64 as +universal (ppc+ppc64), which fails with llvm-3.3 and llvm-3.4, but works with llvm-5.0 on PowerPC. ld64-97 +llvm50 works perfectly then.

Note: See TracTickets for help on using tickets.