understanding gcc's header choices and how to fix them

Ken Cunningham ken.cunningham.webuse at gmail.com
Mon May 28 03:58:33 UTC 2018


There have been some improvements to the headers for libgcc to better support the math issues found on 10.5 and 10.6 (the missing llrintf, etc that lead to all the std::math functions being disabled). These missing functions cause a lot of headaches building c++ software on these older systems.

<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79017>

I would like to see if I can get these improvements to ripple down to the older gcc versions, esp gcc48 and gcc6, as those two versions are actively used on older systems.

I believe understand that there is one copy of libstdc++ installed by the latest functional version of gcc, at present gcc7.

All the versions of gcc from gcc45 to gcc7 use that same library.

But the improvements are mainly in the headers, not in the library, and as far as I can tell, each version of gcc uses it's own set of headers (despite all linking with the same libgcc in the end). 

I think this happens because of this config.arg:

--with-gxx-include-dir=${prefix}/include/${name}/c++/ \

I'm not totally certain how that can work (I guess libgcc must maintain pretty strict backwards compatibility to allow that).

So

1. do I have that pretty much correct?

2. How can I give gcc48 the fixes done in the above link for gcc7?  Should I  try to find a way to make gcc48 use the gcc7 libgcc headers instead? Would that be a good idea (I presume it was not done for a reason)? Or would I need to roll the header fixes back into every version of gcc that I'm interested in fixing?

Thanks 

Ken


More information about the macports-dev mailing list