leaningtech/cheerp-meta

Missing header in cheerp-compiler source

bradwhitehead2 opened this issue · 2 comments

Using cheerp 2.6 and gcc (GCC) 11.1.1 20210428 (Red Hat 11.1.1-1), and following the Linux build instructions, the compiler compilation errors out with:

> ```
In file included from ~/cheerp/cheerp-compiler/llvm/utils/benchmark/src/benchmark_register.cc:15:
> ~/cheerp/cheerp-compiler/llvm/utils/benchmark/src/benchmark_register.h: In function ‘void AddRange(std::vector<T>*, T, T, int)’:
> ~/cheerp/cheerp-compiler/llvm/utils/benchmark/src/benchmark_register.h:17:30: error: ‘numeric_limits’ is not a member of ‘std’
>    17 |   static const T kmax = std::numeric_limits<T>::max();
>       |                              ^~~~~~~~~~~~~~

This is followed by several subsequent errors, traceable to the failed std::numeric_limits compile
 
The problem is that the reference to the limits header is missing from 'cheerp-compiler/llvm/utils/benchmark/src/benchmark_register.h'

Solution, add `'#include <limits>'` to 'cheerp-compiler/llvm/utils/benchmark/src/benchmark_register.h' and re-run ninja.  Compile goes to completion.

Thanks for signaling + fixing this problem.
This commit in LLVM upstream: llvm/llvm-project@b498303 has exactly the same fix you found, I will check with the team but I think we will cherry-pick it so as to include the fix.

Thanks again, we look forward to any other feedback you might have on Cheerp

It's fixed in the current master:
leaningtech/cheerp-compiler@6b1ff4f.