Skip to content

Commit cf8a1d5

Browse files
Fix llvmflang-trunk build by using gcc 9.4.0 instead of 9.2.0 (#56)
The flang build has been failing for a long time with errors about constant expressions: ``` /root/llvm-project/flang/include/flang/Common/enum-class.h: In static member function 'static std::string_view Fortran::parser::DefinedOperator::EnumToString(Fortran::parser::DefinedOperator::IntrinsicOperator)': /root/llvm-project/flang/include/flang/Parser/parse-tree.h:600:3: in 'constexpr' expansion of 'Fortran::common::EnumNames<17>(((const char*)(& vaArgs)))' /root/llvm-project/flang/include/flang/Common/enum-class.h:51:16: error: '(((const char*)(& vaArgs)) == 0)' is not a constant expression 51 | } else if (!start) { | ^~~~~~ ``` There is a source level workaround for this (pass `__VA_ARGS__` directly to `EnumNames`) but the resulting build fails some basic tests, so I don't think it would be a good idea to use it. My local system has a gcc 9.4.0 which compiles and tests all pass. I was able to reproduce the 9.2.0 failure locally, but not on Compiler Explorer. I am missing some aspect of how this macro is used I expect. This change relates to compiler-explorer/compiler-explorer#4334.
1 parent 9f78585 commit cf8a1d5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

build/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ lifetime-trunk)
7979
LLVM_ENABLE_RUNTIMES=""
8080
;;
8181
llvmflang-trunk)
82+
# Does not compile with 9.2.0.
83+
GCC_VERSION=9.4.0
8284
BRANCH=main
8385
URL=https://github.com/llvm/llvm-project.git
8486
VERSION=llvmflang-trunk-$(date +%Y%m%d)

0 commit comments

Comments
 (0)