Repository: iree-org/iree

Issue #1269: gcc fails on typedef of iree_atomic_intptr_t
Created: 2020-03-26T11:45:31Z
Building IREE with gcc 8.3 or 9.3, the build fails due to
/home/mbrehler/repos/iree/iree/base/atomics.h:72:9: error: ‘_Atomic’ does not name a type
   72 | typedef _Atomic __INTPTR_TYPE__ iree_atomic_intptr_t;
      |         ^

This results in
/home/mbrehler/repos/iree/iree/base/atomics.h:97:22: error: ‘iree_atomic_intptr_t’ was not declared in this scope; did you mean ‘iree_atomic_store’?
   97 | static_assert(sizeof(iree_atomic_intptr_t) == sizeof(intptr_t),
      |                      ^~~~~~~~~~~~~~~~~~~~
      |                      iree_atomic_store

and further the missing iree_atomic_intptr_t does effect iree/vm/module.h and iree/vm/ref.h.
Reproducible with #1268 merged.

Duplicate issue #1726: Build failure atomic_intptr
Created: 2020-04-29T10:30:59Z
The current IREE trunk (commit id below) doesn't build out of the box. This is with GCC 9.3.1, and with Ninja - everything default and no other options.
commit 5fcadd0 (HEAD -> master, rigin/master, origin/HEAD)
Author: Hanhan Wang hanchung@google.com
Date:   Tue Apr 28 18:03:54 2020 -0700
FAILED: iree/vm/CMakeFiles/iree_vm_stack_test.dir/stack_test.cc.o 
/usr/lib64/ccache/c++  -D__CLANG_SUPPORT_DYN_ANNOTATION__ -I../ -I. -I../third_party/llvm-project/llvm/include -Ithird_party/llvm-project/llvm/include -I../third_party/llvm-project/mlir/include -Ithird_party/llvm-project/llvm/tools/mlir/include -I../third_party/tensorflow -Ibuild_tools/third_party/tensorflow -I../third_party/google_tracing_framework/bindings/cpp/include -I../third_party/abseil-cpp -isystem ../third_party/googletest/googlemock/include -isystem ../third_party/googletest/googlemock -isystem ../third_party/googletest/googletest/include -isystem ../third_party/googletest/googletest -Wno-unused-parameter -Wno-undef -O2 -DNDEBUG -fPIE   -Wno-unused-parameter -Wno-undef -std=gnu++14 -MD -MT iree/vm/CMakeFiles/iree_vm_stack_test.dir/stack_test.cc.o -MF iree/vm/CMakeFiles/iree_vm_stack_test.dir/stack_test.cc.o.d -o iree/vm/CMakeFiles/iree_vm_stack_test.dir/stack_test.cc.o -c ../iree/vm/stack_test.cc
In file included from ../iree/vm/module.h:21,
                 from ../iree/vm/stack.h:23,
                 from ../iree/vm/stack_test.cc:15:
../iree/base/atomics.h:72:9: error: ‘_Atomic’ does not name a type
   72 | typedef _Atomic __INTPTR_TYPE__ iree_atomic_intptr_t;
      |         ^~~~~~~
../iree/base/atomics.h:97:22: error: ‘iree_atomic_intptr_t’ was not declared in this scope; did you mean ‘iree_atomic_store’?
   97 | static_assert(sizeof(iree_atomic_intptr_t) == sizeof(intptr_t),
      |                      ^~~~~~~~~~~~~~~~~~~~
      |                      iree_atomic_store
In file included from ../iree/vm/stack.h:23,
                 from ../iree/vm/stack_test.cc:15:
../iree/vm/module.h:97:3: error: ‘iree_atomic_intptr_t’ does not name a type; did you mean ‘iree_atomic_store’?
   97 |   iree_atomic_intptr_t ref_count;
      |   ^~~~~~~~~~~~~~~~~~~~
      |   iree_atomic_store
In file included from ../iree/vm/stack.h:24,
                 from ../iree/vm/stack_test.cc:15:
../iree/vm/ref.h:64:3: error: ‘iree_atomic_intptr_t’ does not name a type; did you mean ‘iree_atomic_store’?
   64 |   iree_atomic_intptr_t counter;
      |   ^~~~~~~~~~~~~~~~~~~~
      |   iree_atomic_store

Closing comment (2020-04-29T10:41:39Z): Indeed, gcc is not yet fully supported, see the note here. The build failure you're seeing is reported in #1269.