-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed libcxx math.h for doxygen #25895
Conversation
Doxygen includes math.h using "C" code which will fail compilation when including math.h due to a patch that was applied that assumed that "extern "C" {" is acceptable when compiling "C" code. By wrapping this line with #ifdef __cplusplus, Doxygen 1.11 compiles fine on Snow Leopard.
Notifying maintainers: |
What is going on here? P. S. Please mark as checked only those items which have actually been done. I have some doubts, for example, that anything at all was tested with |
Yes, I build on PowerPC. I have a G4 and a G5 Xserve on the rack for just such a thing. My websites are https://burgerbecky.com and https://logicware.com I'm the CEO of Olde Skuul, and I do vintage software development. I found this issue because I was building Doxygen for a G5 iMac, a G5 Xserve (Both running Leopard), but the main one was a Xeon XServe running Snow Leopard. I use Snow Leopard so buildbot can access CodeWarrior running under Carbon since it's the last OS that still supported Rosetta for PowerPC. Google Rebecca Heineman if you don't believe me. |
To trigger issue. Run a Snow Leopard Intel Mac. "port install doxygen". It will fail due to a compilation error due to code being compiled in C, that doesn't support "extern "C"" |
@burgerbecky Thank you for a detailed response. Perhaps I never saw errors with
|
I hope to see why clang is so darn slow on ppc. Likely vm is hit or massive stalls from load hit store. |
Which clang do you use on ppc? I think @kencu has hacked clang-5.0 ages ago to build on ppc, but it did not generate correct code, so was abandoned. By default in MacPorts no clang later than 3.x will even build on ppc, AFAIK. And those are useless anyway, even if built. |
math.h has been the same for years ( like 10 years.now ) and it has always worked fine. this math.h header should only be called in when using the c++ compiler anyway, and never when compiling C code. legacy-support was recently added to doxygen. for some reason now, the c++ header directory is being used when compiling C code in doxygen. So that is the real error to fix here. the 10.6 build log is here:
|
exactly WHY the cxxflags are being used when compiling C code is not yet clear to me from a casual look over the doxygen Portfile. |
there is an error in legacysupport-1.1 it looks like the cxxflags are being added to cppflags instead of cxxflags append ls_cache_cppflags " -nostdinc++ -isystem${prefix}/include/libcxx/v1" so that is probably the issue to fix. |
having said that, this commit may well be OK… the math.h header in llvm’s c++ directory is wrapped with a cplusplus test too: |
This is my exact error |
using the cxxflags when compiling C code was bound to eventually cause a failure. |
Can the workflow get approval? |
no, we can’t push this as is and shouldn’t tie down the CI either imho rebuilding (and revbumping) every single clang compiler will bring the buildbot sysyem to it’s knees for days. So it will have to be done in a piecemeal, spread-out way, starting with the compilers actually used on 10.6 (clang-11). And the proper fix for doxygen’s build failure is to fix legacysupport to modify the cxxflags instead of the cppflags anyway. notifying @cjones051073 to orchestrate |
Ken - no rev bump is done, or needed here, as the fixes only affect builds currently not working anyway. I do agree though I would first like to see someone test if fixing legacysupport addresses the issue. Thats not to say these changes couldn't perhaps also go in but I would prefer to see that route tested first. |
?? to get the new math.h installed will require revbumping any of these that built on 10.6, Chris. everything up to clang-17 has been built on 10.6, so they would all need revbumping. |
of course, we can skip the math.h fix as it is really unnecessary once legacysupport has been rewritten properly. |
I perhaps did not explain myself well. My point was in this case I agree rev bumping all LLVM versions, and this forcing the buildbots to build them all again, on all OSes versions, when the issue is only on one ancient OS, and seemingly (so far) only affecting one port (doxygen is completely wasteful and should be avoided. So, whilst you are correct 'by the book' the ports should be rev bump to force rebuilds, in this case I would not do it and just leave it to interest users to pick up themselves, given those affected are the very (very) small minority corner case. If you still disagree, and think the changes here have to go with a rev-bump, then I am going to object to merging them at all as I do not think the impact of the fix justifies all the builedbot build time it implies. |
If this PR changes files that are installed, the revision must be increased. It sounds like the changes in this PR are not the correct way to fix this problem. |
It appears the consensus is that this isn't the correct way to fix it. Combined with inactivity for 2 months, closing this PR. |
Doxygen includes math.h using "C" code which will fail compilation when including math.h due to a patch that was applied that assumed that "extern "C" {" is acceptable when compiling "C" code. By wrapping this line with #ifdef __cplusplus, Doxygen 1.11 compiles fine on Snow Leopard.
Description
When building Doxygen 1.11 on Snow Leopard, the compilation will fail due to math.h not being compatible with the C compiler that that port is using. Simply wrapping the 'extern "C" {' with #ifdef __cplusplus allowed doxygen to build with no errors.
Type(s)
Tested on
macOS x.y
Xcode x.y / Command Line Tools x.y.z
Verification
Have you
port lint --nitpick
?sudo port test
?sudo port -vst install
?