This is an archive of the discontinued LLVM Phabricator instance.

[flang] Tweak the conditions for the GCC 7/libstdc++ workaround
ClosedPublic

Authored by mstorsjo on Jun 23 2021, 4:41 AM.

Details

Summary

This adjusts the workaround from D104731.

The issue lies in libstdc++'s classes, not GCC itself, and manifests
itself in the same way if building e.g. with clang while using
libstdc++ headers from GCC 7 (e.g. if building with Clang on Ubuntu 18.04,
while using the system default C++ library).

Therefore, change the condition to look for the version of libstdc++
instead of the compiler.

Diff Detail

Event Timeline

mstorsjo requested review of this revision.Jun 23 2021, 4:41 AM
mstorsjo created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2021, 4:41 AM
klausler accepted this revision.Jun 23 2021, 10:41 AM

Thanks for improving this patch.

flang/include/flang/Evaluate/type.h
145

You don't need to check whether _GLIBCXX_RELEASE is defined; if it is not, it'll be replaced with 0 and the test will fail anyway.

225

Same here.

This revision is now accepted and ready to land.Jun 23 2021, 10:41 AM
mstorsjo added inline comments.Jun 23 2021, 10:52 AM
flang/include/flang/Evaluate/type.h
145

Ok, although leaving out that check cause warnings if building with -Wundef.

klausler added inline comments.Jun 23 2021, 11:37 AM
flang/include/flang/Evaluate/type.h
145

Then please leave the check in place; we build f18 with -Werror.

This revision was landed with ongoing or failed builds.Jun 23 2021, 1:20 PM
This revision was automatically updated to reflect the committed changes.