Fixes a GCC build issue (an instance of unallowed typename keyword use) in and restores https://reviews.llvm.org/D148393
Details
Diff Detail
Event Timeline
Folks, the same two bots that failed on the previous check-in that this one attempts to fix continue to fail, but with a different problem down the build line. Both are doing GCC builds that are now complaining about unresolved C++ runtime references that can apparently be fixed by adding -lstdc++ to the cmake linker set up. Not sure why this not being picked up by default in GCC configs - others (clang, MSVC, etc.) look OK.
also seeing bot fails here: https://lab.llvm.org/buildbot/#/builders/193/builds/30195
please revert and fix
And this patch introduces a lot of new warnings. Please fix them.
/home/ac.shilei.tian/Documents/vscode/llvm-project/openmp/runtime/src/kmp_collapse.cpp:303:44: warning: unused typedef 'UT' [-Wunused-local-typedef] typedef typename traits_t<T>::unsigned_t UT; ^ /home/ac.shilei.tian/Documents/vscode/llvm-project/openmp/runtime/src/kmp_collapse.cpp:304:42: warning: unused typedef 'ST' [-Wunused-local-typedef] typedef typename traits_t<T>::signed_t ST; ^ /home/ac.shilei.tian/Documents/vscode/llvm-project/openmp/runtime/src/kmp_collapse.cpp:379:42: warning: unused typedef 'ST' [-Wunused-local-typedef] typedef typename traits_t<T>::signed_t ST; ^ /home/ac.shilei.tian/Documents/vscode/llvm-project/openmp/runtime/src/kmp_collapse.cpp:378:44: warning: unused typedef 'UT' [-Wunused-local-typedef] typedef typename traits_t<T>::unsigned_t UT; ^ /home/ac.shilei.tian/Documents/vscode/llvm-project/openmp/runtime/src/kmp_collapse.cpp:510:42: warning: unused typedef 'ST' [-Wunused-local-typedef] typedef typename traits_t<T>::signed_t ST; ^ /home/ac.shilei.tian/Documents/vscode/llvm-project/openmp/runtime/src/kmp_collapse.cpp:574:42: warning: unused typedef 'ST' [-Wunused-local-typedef] typedef typename traits_t<T>::signed_t ST; ^ /home/ac.shilei.tian/Documents/vscode/llvm-project/openmp/runtime/src/kmp_collapse.cpp:984:42: warning: unused typedef 'ST' [-Wunused-local-typedef] typedef typename traits_t<T>::signed_t ST; ^ /home/ac.shilei.tian/Documents/vscode/llvm-project/openmp/runtime/src/kmp_collapse.cpp:988:11: warning: unused typedef 'big_span_t' [-Wunused-local-typedef] big_span_t; ^ /home/ac.shilei.tian/Documents/vscode/llvm-project/openmp/runtime/src/kmp_collapse.cpp:983:44: warning: unused typedef 'UT' [-Wunused-local-typedef] typedef typename traits_t<T>::unsigned_t UT; ^ /home/ac.shilei.tian/Documents/vscode/llvm-project/openmp/runtime/src/kmp_collapse.cpp:1213:44: warning: unused typedef 'UT' [-Wunused-local-typedef] typedef typename traits_t<T>::unsigned_t UT; ^ /home/ac.shilei.tian/Documents/vscode/llvm-project/openmp/runtime/src/kmp_collapse.cpp:1214:42: warning: unused typedef 'ST' [-Wunused-local-typedef] typedef typename traits_t<T>::signed_t ST; ^ 11 warnings generated.
I get the same errors, I'm going to go ahead and revert this. Someone will need to check to make sure that we're setting the correct language for the linking job.
openmp/runtime/src/kmp_collapse.h | ||
---|---|---|
17 | vector cannot be used here because it requires the standard C++ library. libomp is a C library *written in C++ syntax with header only STL*. |
openmp/runtime/src/kmp_collapse.h | ||
---|---|---|
17 | yes, realized that after the failures. It's strange the pre-commit build allows C++ runtime usage. |
Just an FYI to everyone: There are no real pre-merge checks for the openmp project anymore. The "build and test" step is just a setup, then report. No actual building or testing takes place.
openmp is in the excluded list.
... INFO Get list of projects affected by the change. INFO Projects directly modified by this patch: openmp INFO projects: {'openmp'} INFO added set() projects as they are affected INFO all affected projects(*) {'openmp'} INFO added set() projects as they are affected INFO all excluded projects(*) {'libcxxabi', 'libc', 'lldb', 'bolt', 'openmp', 'compiler-rt', 'cross-project-tests', 'check-cxxabi', 'libcxx'} INFO effective projects list set() INFO windows_projects: [] INFO Files modified by this patch: ...
Could someone in the know comment whether the openmp removal was unrelated to the previous GCC build failures, or it was in which case what action may be required to restore it now that this is being fixed? Thanks
I'll unblock it for now though I didn't test it because I lost my development environment.
openmp/runtime/src/kmp_collapse.cpp | ||
---|---|---|
133 | I'm not sure if we can use std::abs here w/o pulling in <cmath>. However, libomp doesn't depend on libm anyway, so we might probably just want to "reinvent the wheels" for std::abs here. |
openmp/runtime/src/kmp_collapse.cpp | ||
---|---|---|
133 | If this was C++23 we could rely on them being constexpr. I think most implementations will provide this without cmath, but it's certainly possible to call into libm so it's safest to avoid the reference. |
vector cannot be used here because it requires the standard C++ library. libomp is a C library *written in C++ syntax with header only STL*.