Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang-13.0.0: NetBSD<10 does not provide state_not_recoverable #51554

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR52587
Status NEW
Importance P normal
Reported by Thomas Klausner (tk@giga.or.at)
Reported on 2021-11-22 15:53:26 -0800
Last modified on 2021-11-22 15:53:26 -0800
Version 13.0
Hardware All NetBSD
CC blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
In NetBSD before release 10 (which is not out yet), the C headers do not
provide ENOTRECOVERABLE, and thus the C++ headers do not provide
std::errc::state_not_recoverable.

This leads to the following compilation problem on NetBSD 9:

[ 65%] Building CXX object
lib/Interpreter/CMakeFiles/obj.clangInterpreter.dir/IncrementalParser.cpp.o
/usr/pkgsrc/lang/clang/work/clang-
13.0.0.src/lib/Interpreter/IncrementalParser.cpp: In lambda function:
/usr/pkgsrc/lang/clang/work/clang-
13.0.0.src/lib/Interpreter/IncrementalParser.cpp:56:28: error:
'state_not_recoverable' is not a member of 'std::errc'
                 std::errc::state_not_recoverable,
                            ^~~~~~~~~~~~~~~~~~~~~
*** Error code 1

As a workaround I used:
CXXFLAGS=-D_GLIBCXX_HAVE_ENOTRECOVERABLE=1 -DENOTRECOVERABLE=98
and clang-13.0.0 built successfully.

I don't know the proper fix. Can a different std::errc code be used in
IncrementalParser.cpp?

(This problem does not occur any longer on NetBSD-current and will be fixed in
NetBSD 10.)