imay opened a new issue #2836: LLVM 3.4.2 may be not compatible with GCC 8 or 
higher
URL: https://github.com/apache/incubator-doris/issues/2836
 
 
   Today, I tried to compile Doris with GCC 8 and GCC 9, but failed. Besides 
some minor problems, That LLVM 3.4.2 is not compatible with GCC8+ is the 
biggest problem. And I have no idea to resolve.
   
   I write a test cpp file like following
   
   ```
   #include <boost/scoped_ptr.hpp>
   
   int main() {
   }
   ```
   
   Then I used `clang`  to compile this file with `-std=c++11` and gcc8 
toolchain, but failed. The command line looks like
   ```
   clang -gcc-toolchain gcc-8.3.0 -std=c++11 -I boost-include test.cc
   ```
   and the output error is
   ```
   In file included from test.cc:1:
   In file included from 
/home/disk1/doris-deps/thirdparty/installed/include/boost/scoped_ptr.hpp:14:
   In file included from 
/home/disk1/doris-deps/thirdparty/installed/include/boost/smart_ptr/scoped_ptr.hpp:23:
   In file included from 
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/memory:62:
   In file included from 
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/bits/stl_algobase.h:64:
   In file included from 
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/bits/stl_pair.h:59:
   In file included from 
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/bits/move.h:55:
   
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/type_traits:921:51:
 error: '_Tp' does not refer to
         a value
         : public __bool_constant<__is_constructible(_Tp, _Args...)>
                                                     ^
   
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/type_traits:919:21:
 note: declared here
     template<typename _Tp, typename... _Args>
                       ^
   
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/type_traits:922:5:
 error: expected class name
       { };
       ^
   
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/type_traits:1049:48:
 error: '_Tp' does not refer
         to a value
         : public __bool_constant<__is_assignable(_Tp, _Up)>
                                                  ^
   
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/type_traits:1047:21:
 note: declared here
     template<typename _Tp, typename _Up>
                       ^
   
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/type_traits:1050:5:
 error: expected class name
       { };
       ^
   In file included from test.cc:1:
   In file included from 
/home/disk1/doris-deps/thirdparty/installed/include/boost/scoped_ptr.hpp:14:
   In file included from 
/home/disk1/doris-deps/thirdparty/installed/include/boost/smart_ptr/scoped_ptr.hpp:23:
   In file included from 
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/memory:76:
   
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/bits/stl_function.h:418:10:
 error: use of
         undeclared identifier '__UINTPTR_TYPE__'
           return (__UINTPTR_TYPE__)__x > (__UINTPTR_TYPE__)__y;
                   ^
   
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/bits/stl_function.h:431:10:
 error: use of
         undeclared identifier '__UINTPTR_TYPE__'
           return (__UINTPTR_TYPE__)__x < (__UINTPTR_TYPE__)__y;
                   ^
   
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/bits/stl_function.h:444:10:
 error: use of
         undeclared identifier '__UINTPTR_TYPE__'
           return (__UINTPTR_TYPE__)__x >= (__UINTPTR_TYPE__)__y;
                   ^
   
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/bits/stl_function.h:457:10:
 error: use of
         undeclared identifier '__UINTPTR_TYPE__'
           return (__UINTPTR_TYPE__)__x <= (__UINTPTR_TYPE__)__y;
                   ^
   In file included from test.cc:1:
   In file included from 
/home/disk1/doris-deps/thirdparty/installed/include/boost/scoped_ptr.hpp:14:
   In file included from 
/home/disk1/doris-deps/thirdparty/installed/include/boost/smart_ptr/scoped_ptr.hpp:23:
   In file included from 
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/memory:80:
   In file included from 
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/bits/unique_ptr.h:36:
   
/home/disk1/doris-deps/toolchain/installed/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/utility:307:35:
 error: use of undeclared
         identifier '__integer_pack'
         using __type = _Index_tuple<__integer_pack(_Num)...>;
                                     ^
   9 errors generated.
   ```
   
   However, after I changed the `-gcc-toolchain` from `gcc8` to `gcc7`, it 
compiled successfully. If I used `gcc8` `-gcc-toolchain`, and removed 
`-std=c++11` flags, it also compiled successfully.
   
   So, I think the problem is that LLVM 3.4.2 is not compatible with GCC8 or 
higher.
   
   Because LLVM's new version API is not compatible with older version, it is 
difficult to change LLVM's version. However I think the LLVM is not used in 
current Doris version, maybe we can remove all LLVM related code. If we do 
this, we will get the following benefits:
   * We can make our code simpler
   * We can upgrade GCC version
   * In the future, when we need LLVM, we can use a higher version of LLVM.
   
   I will create another proposal to remove current LLVM code

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to