Opened 13 years ago

Closed 11 years ago

Last modified 10 years ago

#31777 closed defect (fixed)

openjade fails to build with clang

Reported by: fgp (Florian G. Pflug) Owned by: drkp (Dan Ports)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: clang universal haspatch Cc: mamiano@…, ryandesign (Ryan Carsten Schmidt), m.rick@…
Port: openjade

Description (last modified by ryandesign (Ryan Carsten Schmidt))

XCode 4.2's clang fails to build openjade, but llvm-gcc-4.2 works. Also, universal builds don't work because libtool doesn't use the magic "-arch ..." incantations when invoking the compiler.

(More generally, i386 builds fail on machines where x86_64 is the default. Thus, putting openjade into the muniversal portgroup doesn't fix the problems with +universal)

I've fixed both problems by

  • Setting configure.compiler to llvm-gcc-4.2 if it's set to clang
  • Using reinplace to patch libtool's CC and CXX settings

Patch for the Portfile is attached.

Attachments (1)

macports.openjade.noclang.universal.diff (1.3 KB) - added by fgp (Florian G. Pflug) 13 years ago.
Use llvm-gcc-4.2 instead of clang, and patch libtool to make +universal work

Download all attachments as: .zip

Change History (14)

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: haspatch added

comment:2 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Unconditionally using ${configure.universal_ldflags} is probably wrong; it would make non-universal builds be universal. Instead you probably want [get_canonical_archflags].

comment:3 Changed 13 years ago by fgp (Florian G. Pflug)

I've replaced ${configure.universal_ldflags} with [get_canonical_archflags] as suggested, and verified that both universal and non-universal builds work and produce the correct binary.

I've only tested on Mac OS X 10.6 with XCode 4.2, though (i.e. universal means i386 and x86_64, non-universal means just x86_64), since that's the only machine available to me.

Patch was updated.

Changed 13 years ago by fgp (Florian G. Pflug)

Use llvm-gcc-4.2 instead of clang, and patch libtool to make +universal work

comment:4 Changed 13 years ago by drkp (Dan Ports)

Owner: changed from macports-tickets@… to dports@…
Status: newassigned

comment:5 Changed 13 years ago by drkp (Dan Ports)

Cc: mamiano@… added

#32612 seems like a duplicate.

comment:6 Changed 13 years ago by drkp (Dan Ports)

I forced llvm-gcc-4.2 instead of clang in r88163. I did the same for opensp in r88162 because openjade seemed to be failing to build when opensp was built with clang.

Still looking at the universal part of the patch. Patching libtool seems like a bit of a hack; will see if I can come up with something else.

comment:7 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

Patching libtool isn't so awful; we were already doing it in this port (and in others of this vintage); now we'd just be patching it even better to support -arch flags.

comment:8 in reply to:  7 ; Changed 13 years ago by drkp (Dan Ports)

Resolution: fixed
Status: assignedclosed

Replying to ryandesign@…:

Patching libtool isn't so awful; we were already doing it in this port (and in others of this vintage); now we'd just be patching it even better to support -arch flags.

Yeah, I was hoping we could just replace it with a newer version of libtool, but that's not looking like an easy task given some of the other things that are going on with openjade's build system. Let's go with patching libtool. Applied in r88165.

I was also thrown off by some linker errors that turned out to be caused by openjade trying to link against libraries from an already-installed version of itself. Fixed that in r88165 too. (It's possible that's the problem I was seeing earlier and r88162 was unnecessary; testing that now.)

comment:9 in reply to:  8 Changed 13 years ago by drkp (Dan Ports)

Replying to dports@…:

(It's possible that's the problem I was seeing earlier and r88162 was unnecessary; testing that now.)

No, apparently not. For the record, r88162 does seem to be necessary after all.

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

Resolution: fixed
Status: closedreopened
Summary: openjade @1.3.2 clang fails, use llvm-gcc-4.2 instead, and also support +universalopenjade fails to build with clang

We need to fix the issues building this with clang. Reopening

comment:11 in reply to:  10 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: reopenedclosed

Replying to jeremyhu@…:

We need to fix the issues building this with clang.

r115260

comment:12 Changed 10 years ago by m.rick@…

@ryandesign

This bug doesn't seem to have been fixed at all… cannot build OpenJade 1.3.2 under Maverick … So I cannot build the folioing ports depending on it : Viking and Gnumeric and there are probably plenty of others …

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

Cc: m.rick@… added

@m.rick: Please file a new ticket. This one was fixed 7 months ago.

Note: See TracTickets for help on using tickets.