Opened 5 years ago

Closed 2 years ago

#58834 closed defect (fixed)

gimp nm issues on 10.5

Reported by: rmottola (Riccardo) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version:
Keywords: leopard Cc:
Port: gimp2

Description

gimp fails to build on 10.5 because the system nm is too old and the error is then confusing, as if a command is missing on the command line:

libtool: link: /usr/bin/nm -p  .libs/gimpmodule.o .libs/pygimp-item.o .libs/pygimp-display.o .libs/pygimp-drawable.o .libs/pygimp-image.o .libs/pygimp-parasite.o .libs/pygimp-pdb.o .libs/pygimp-tile.o .libs/pygimp-vectors.o   |  | /opt/local/bin/gsed 's/.* //' | sort | uniq .libs/gimp.exp
../../libtool: eval: line 1734: syntax error near unexpected token `|'

The fix (proven to work) is to use macports nm. Ken suggested to add this to the portfile and it works (taken from an even older fix by Jeremy):

if {${os.platform} eq "darwin" && ${os.major} < 10} {
    depends_build-append port:cctools
    configure.env-append NM=${prefix}/bin/nm
    configure.args-append lt_cv_path_NM=${prefix}/bin/nm
} 

Change History (8)

comment:1 Changed 5 years ago by jmroot (Joshua Root)

Owner: set to dbevans
Status: newassigned

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

Keywords: nm removed

comment:3 Changed 5 years ago by kencu (Ken)

The issue here really isn't with gimp, of course; any time a relatively new version of clang builds objects on 10.5, the stock version of nm will barf on them.

If there was only some way we could force the cctools version of nm to be used based on the clang version used to build objects, we could fix all the ports at once. In the meantime, we have to piecemeal them one by one as they come up.

At present, it appears that the nm used on 10.6.8 is new enough to handle things, but no doubt there will come a day when that changes and we need to force a newer nm there as well.

If you're a bit of a hacker, you can just change /usr/bin/nm to be the cctools version with a symlink (saving the original, of course) and then you're good to go forever, but for that, you need to know what you're doing and what you did.

comment:4 Changed 5 years ago by rmottola (Riccardo)

Well, why symlink... if the above change to the portfile works? I prefer not to change things outside MacPorts itself

comment:5 Changed 5 years ago by rmottola (Riccardo)

Just to remind everybody that this still applies. I'd put the fix in the receipe.. as with many other things, without the need to hack outside MacPorts tree... or we need some other "support" for enabling a specific NM instead of the system one (best solution)

comment:6 Changed 5 years ago by rmottola (Riccardo)

I noticed what we already have this hack for gimp2:

if {[vercmp $xcodeversion 4.3] < 0 && [string match "*macports*" ${configure.compiler}]} {
    # Xcode 4.2 fails with load commands in the newer toolchain
    depends_build-append port:cctools

    configure.env-append \
        AR=${prefix}/bin/ar \
        RANLIB=${prefix}/bin/ranlib
}

so the other hack for NM is not that out of place, maybe these thigns can be streamlined though.

comment:7 Changed 3 years ago by mascguy (Christopher Nielsen)

Owner: changed from dbevans to mascguy

comment:8 Changed 2 years ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: assignedclosed

In 3079a45d022b0d1976c8ec9df0e230432b435046/macports-ports (master):

gimp2/gimp2-devel: fix nm issues on 10.5
Fixes: #58834

Note: See TracTickets for help on using tickets.