Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STL warnings when compiling for ARM32 #77

Closed
dsobotta opened this issue Dec 6, 2021 · 1 comment · Fixed by #203
Closed

STL warnings when compiling for ARM32 #77

dsobotta opened this issue Dec 6, 2021 · 1 comment · Fixed by #203

Comments

@dsobotta
Copy link
Contributor

dsobotta commented Dec 6, 2021

Occurs whether on an arm32 host, or cross-compiling. Build succeeds and binaries/tests work as expected.

~/git/toit# make tools-arm32
GO111MODULE=on GOBIN=/root/git/toit/build go get github.com/toitlang/tpkg/cmd/toitpkg@"v0.0.0-20211126161923-c00da039da00"
go: found github.com/toitlang/tpkg/cmd/toitpkg in github.com/toitlang/tpkg v0.0.0-20211126161923-c00da039da00
cd tools/toitlsp; CGO_ENABLED=1 GODEBUG=netdns=go go build  -ldflags "-X main.date=2021-12-06T09:56:17Z" -tags 'netgo osusergo' -o ../../build/toitlsp .
mkdir -p build/arm32/
(cd build/arm32 && cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../toolchains/arm32.cmake)
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python (found version "3.9.2") 
-- Found Perl: /usr/bin/perl (found version "5.32.1") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/arm-linux-gnueabihf-gcc
-- Configuring done
-- Generating done
-- Build files have been written to: /root/git/toit/build/arm32
(cd build/arm32 && ninja build_toitvm)
[264/324] Building CXX object src/compiler/CMakeFiles/toit_compiler.dir/filesystem_archive.cc.o
In file included from /usr/arm-linux-gnueabihf/include/c++/10/vector:66,
                 from ../../src/compiler/filesystem_archive.cc:17:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_uninitialized.h: In function ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator<nlohmann::basic_json<>*>; _ForwardIterator = nlohmann::basic_json<>*; _Tp = nlohmann::basic_json<>]’:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_uninitialized.h:323:5: note: parameter passing for argument of type ‘std::move_iterator<nlohmann::basic_json<>*>’ changed in GCC 7.1
  323 |     __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
      |     ^~~~~~~~~~~~~~~~~~~~~~
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_uninitialized.h:323:5: note: parameter passing for argument of type ‘std::move_iterator<nlohmann::basic_json<>*>’ changed in GCC 7.1
In file included from /usr/arm-linux-gnueabihf/include/c++/10/vector:60,
                 from ../../src/compiler/filesystem_archive.cc:17:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_algobase.h: In function ‘_OI std::move(_II, _II, _OI) [with _II = __gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >; _OI = std::back_insert_iterator<std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >]’:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_algobase.h:593:5: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >’ changed in GCC 7.1
  593 |     move(_II __first, _II __last, _OI __result)
      |     ^~~~
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_algobase.h:593:5: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >’ changed in GCC 7.1
In file included from ../../src/compiler/filesystem_archive.cc:18:
../../src/compiler/third_party/nlohmann/json.hpp: In member function ‘void nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType>::json_value::destroy(nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType>::value_t) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long long int; NumberUnsignedType = long long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; BinaryType = std::vector<unsigned char>]’:
../../src/compiler/third_party/nlohmann/json.hpp:17059:26: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >’ changed in GCC 7.1
17059 |                 std::move(array->begin(), array->end(), std::back_inserter(stack));
      |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/compiler/third_party/nlohmann/json.hpp:17080:30: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >’ changed in GCC 7.1
17080 |                     std::move(current_item.m_value.array->begin(), current_item.m_value.array->end(),
      |                     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17081 |                               std::back_inserter(stack));
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/arm-linux-gnueabihf/include/c++/10/map:60,
                 from ../../src/compiler/third_party/nlohmann/json.hpp:62,
                 from ../../src/compiler/filesystem_archive.cc:18:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_tree.h: In member function ‘std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_hint_unique_pos(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> > >; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> > >]’:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_tree.h:2193:5: note: parameter passing for argument of type ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> >, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> > >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> > > >::const_iterator’ changed in GCC 7.1
 2193 |     _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/arm-linux-gnueabihf/include/c++/10/vector:72,
                 from ../../src/compiler/filesystem_archive.cc:17:
/usr/arm-linux-gnueabihf/include/c++/10/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_fill_insert(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = nlohmann::basic_json<>; _Alloc = std::allocator<nlohmann::basic_json<> >]’:
/usr/arm-linux-gnueabihf/include/c++/10/bits/vector.tcc:509:5: note: parameter passing for argument of type ‘std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >::iterator’ changed in GCC 7.1
  509 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
In file included from /usr/arm-linux-gnueabihf/include/c++/10/vector:66,
                 from ../../src/compiler/filesystem_archive.cc:17:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_uninitialized.h:333:41: note: parameter passing for argument of type ‘std::move_iterator<nlohmann::basic_json<>*>’ changed in GCC 7.1
  333 |       return std::__uninitialized_copy_a(_GLIBCXX_MAKE_MOVE_ITERATOR(__first),
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  334 |       _GLIBCXX_MAKE_MOVE_ITERATOR(__last),
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  335 |       __result, __alloc);
      |       ~~~~~~~~~~~~~~~~~~                 
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_uninitialized.h:333:41: note: parameter passing for argument of type ‘std::move_iterator<nlohmann::basic_json<>*>’ changed in GCC 7.1
  333 |       return std::__uninitialized_copy_a(_GLIBCXX_MAKE_MOVE_ITERATOR(__first),
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  334 |       _GLIBCXX_MAKE_MOVE_ITERATOR(__last),
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  335 |       __result, __alloc);
      |       ~~~~~~~~~~~~~~~~~~                 
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_uninitialized.h:347:2: note: parameter passing for argument of type ‘std::move_iterator<nlohmann::basic_json<>*>’ changed in GCC 7.1
  346 |       return std::__uninitialized_copy_a
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  347 |  (_GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(__first),
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  348 |   _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(__last), __result, __alloc);
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_uninitialized.h:347:2: note: parameter passing for argument of type ‘std::move_iterator<nlohmann::basic_json<>*>’ changed in GCC 7.1
  346 |       return std::__uninitialized_copy_a
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  347 |  (_GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(__first),
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  348 |   _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(__last), __result, __alloc);
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/arm-linux-gnueabihf/include/c++/10/vector:67,
                 from ../../src/compiler/filesystem_archive.cc:17:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_vector.h: In member function ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType>::value_type& nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType>::operator[](nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType>::size_type) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long long int; NumberUnsignedType = long long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; BinaryType = std::vector<unsigned char>]’:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_vector.h:1338:16: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >’ changed in GCC 7.1
 1338 |  _M_fill_insert(begin() + __offset, __n, __x);
      |  ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[284/324] Building CXX object src/compiler/CMakeFiles/toit_compiler.dir/program_builder.cc.o
In file included from /usr/arm-linux-gnueabihf/include/c++/10/vector:72,
                 from ../../src/compiler/program_builder.h:18,
                 from ../../src/compiler/program_builder.cc:16:
/usr/arm-linux-gnueabihf/include/c++/10/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const long long unsigned int&}; _Tp = long long unsigned int; _Alloc = std::allocator<long long unsigned int>]’:
/usr/arm-linux-gnueabihf/include/c++/10/bits/vector.tcc:426:7: note: parameter passing for argument of type ‘std::vector<long long unsigned int, std::allocator<long long unsigned int> >::iterator’ changed in GCC 7.1
  426 |       vector<_Tp, _Alloc>::
      |       ^~~~~~~~~~~~~~~~~~~
In file included from /usr/arm-linux-gnueabihf/include/c++/10/vector:67,
                 from ../../src/compiler/program_builder.h:18,
                 from ../../src/compiler/program_builder.cc:16:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_vector.h: In member function ‘int toit::compiler::ProgramBuilder::add_double(double)’:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_vector.h:1198:21: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<long long unsigned int*, std::vector<long long unsigned int, std::allocator<long long unsigned int> > >’ changed in GCC 7.1
 1198 |    _M_realloc_insert(end(), __x);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /usr/arm-linux-gnueabihf/include/c++/10/vector:72,
                 from ../../src/compiler/program_builder.h:18,
                 from ../../src/compiler/program_builder.cc:16:
/usr/arm-linux-gnueabihf/include/c++/10/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const long long int&}; _Tp = long long int; _Alloc = std::allocator<long long int>]’:
/usr/arm-linux-gnueabihf/include/c++/10/bits/vector.tcc:426:7: note: parameter passing for argument of type ‘std::vector<long long int, std::allocator<long long int> >::iterator’ changed in GCC 7.1
  426 |       vector<_Tp, _Alloc>::
      |       ^~~~~~~~~~~~~~~~~~~
In file included from /usr/arm-linux-gnueabihf/include/c++/10/vector:67,
                 from ../../src/compiler/program_builder.h:18,
                 from ../../src/compiler/program_builder.cc:16:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_vector.h: In member function ‘int toit::compiler::ProgramBuilder::add_integer(int64)’:
/usr/arm-linux-gnueabihf/include/c++/10/bits/stl_vector.h:1198:21: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int, std::allocator<long long int> > >’ changed in GCC 7.1
 1198 |    _M_realloc_insert(end(), __x);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
[324/324] Generating ../bin/toitvm_boot.snapshot
@erikcorry
Copy link

nlohmann/json#658 says we need to add -Wno-psabi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants