#56274 closed defect (fixed)
terra @0.7 Fix broken compilation
Reported by: | lockhart (Thomas Lockhart) | Owned by: | ryandesign (Ryan Carsten Schmidt) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | haspatch maintainer | Cc: | kencu (Ken) |
Port: | terra |
Description
terra is very old code and clang++ has finally given up on some of the original constructs and class names. This patch for the Portfile fixes use of "array" as a class name and "typeof" (a gcc extension) by substituting "Array" and "decltype" instead.
Attachments (1)
Change History (16)
Changed 7 years ago by lockhart (Thomas Lockhart)
Attachment: | Portfile.diff added |
---|
comment:1 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Owner: | set to ryandesign |
---|---|
Status: | new → accepted |
Summary: | terra @ 0.7 Fix broken compilation → terra @0.7 Fix broken compilation |
Thanks, I expect this will fix what I reported in #56238.
Since this only fixes a build problem, not a runtime problem, I don't expect a revision increase to be necessary.
There is already a patchfile in this portfile to fix compiler issues. I'm inclined to include these new changes in that patchfile, rather than use reinplace
.
comment:2 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Your reinplace
also changed array2
to Array2
; I'm not including that in the patch, since while array
apparently has new meaning under recent C++, array2
doesn't.
comment:3 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | kencu added |
---|
Oh. Ken already committed your changes in [c9a1e98f66671e9813c9b6f69c8287fae558c8b5/macports-ports].
comment:4 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
comment:5 Changed 7 years ago by lockhart (Thomas Lockhart)
OK. The source code was last changed in 1996 so I'm just happy the stuff can compile. Thanks for applying patches!
comment:6 Changed 7 years ago by kencu (Ken)
Ah, sorry. And somehow I line-wrapped the "4" so it didnt' automatically close the ticket, to make it worse.
comment:7 Changed 7 years ago by kencu (Ken)
The new patches break builds on systems 10.8 or less.
It can be fixed by including the cxx11 1.1 PortGroup, and adding -std=c++11
to the build line. The easiest way I found to do that was to add it to the compiler spec as this port doesn't use configure. But I know this is cheating:
reinplace -E "s,@CXX@,${configure.cxx} -std=c++11,g" ${worksrcpath}/Makefile
Or we could use the old patch on older systems.
comment:8 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
I see you committed a fix in [a23f4698d61e570c089e223c7889b13ada989933/macports-ports].
comment:9 follow-up: 10 Changed 7 years ago by kencu (Ken)
Sorry to jam it in the optflags. Just easiest in the end I thought. It doesn't work on i386 for some reason (stdlib not set right?), but the others work. Still waiting on PPC, FWIW.
comment:10 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to kencu:
Sorry to jam it in the optflags. Just easiest in the end I thought.
It's certainly not an optimization flag...
It doesn't work on i386 for some reason (stdlib not set right?), but the others work.
The -stdlib
isn't set correctly anywhere, so I don't know why it works on other systems. There's no code in the portfile to set it. The port doesn't use the configure phase, which means the port is responsible for setting it manually.
comment:11 follow-up: 12 Changed 7 years ago by kencu (Ken)
Let me see what happens on PPC, and when I get some time I'll fix up the last few systems if you like.
comment:12 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to kencu:
I'll fix up the last few systems if you like.
where by "the last few systems" you mean all systems running 10.8 or earlier. The right stdlib is not being used. The binaries that got produced for 10.6, for example, are linked with /usr/lib/libstdc++.6.dylib, but the use of the cxx11 1.1 portgroup means that we wanted it to use the MacPorts copy of libstdc++, not the system's.
On the other hand, the fact that the build succeeded with the system's libstdc++ suggests the use of the cxx11 1.1 portgroup wasn't necessary, and that this code doesn't actually require a C++11-capable C++ library.
comment:14 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
I have no plans to deal with this port at the moment.
Fix compilation problems with newer language standards.