Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Invalid architecture in build-script #9

Closed
m-lenz opened this issue Apr 30, 2019 · 6 comments
Closed

Invalid architecture in build-script #9

m-lenz opened this issue Apr 30, 2019 · 6 comments
Milestone

Comments

@m-lenz
Copy link

m-lenz commented Apr 30, 2019

The new version of the Raspberry-Pi image seems to be arm32v7:

uname -a : Linux raspberrypi3 4.9.80 #1 SMP armv7l armv7l armv7l GNU/Linux
But the current build-script only allows arm32v6 to be compiled.
This yields no immidiate issue, but will in the future and should be updated with newer raspi-versions

@m-lenz
Copy link
Author

m-lenz commented Apr 30, 2019

Compilation also yields warnings regarding the GCC-Compiler and the specified flags.

Starting with gcc 7.1 the code won't build anymore, due to outdated allocation-calls.

/usr/include/c++/6.4.0/bits/stl_algobase.h: In function '_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = true; _II = jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >*; _OI = __gnu_cxx::__normal_iterator<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >*, std::vector<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >, std::allocator<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > > > > >]':

Since the current stable release is gcc 8.3 the build-scripts should be updated to conform to modern standards. (~50-100 of these are thrown)

@m-lenz
Copy link
Author

m-lenz commented Apr 30, 2019

Also the c++-flag should be disabled, when compiling c. This is a negligible warning, but bloats the logs/std::out/std::err and makes information-extraction very complicated.

[ XY%] Building C object CMakeFiles/paho-lib.dir/app/3rd-party-libs/....c.o cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C

@rohoet rohoet added this to the 0.1 milestone May 2, 2019
@SebastianSchildt
Copy link
Contributor

@rai20 The problem with the -std=c++11 option can be fixed by replacing
add_compile_options(-std=c++11 )
with
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

I am not doing a pull request, because #8 is still an issue, I get the same error. Maybe you can check

@SebastianSchildt
Copy link
Contributor

@argerus The former comment changing the way compile options are set can also make the warnings go away, when building the kuksa-cloud-dashboard

@SebastianSchildt
Copy link
Contributor

Update:

No warnings on amd64 (GCC 7.4.0 and 6.4) and and ARM64 (gcc 6.4.0), only arm32v6 (gcc6.4) produces warnings

In file included from /app/kuksa-cloud-dashboard/../3rd-party-libs/jsoncons/json.hpp:24:0,
                 from /app/kuksa-cloud-dashboard/src/main.cpp:22:
/app/kuksa-cloud-dashboard/../3rd-party-libs/jsoncons/json_structures.hpp: In member function 'typename std::enable_if<jsoncons::is_stateless<A>::value, void>::type jsoncons::json_object<KeyT, Json, false>::set_(typename jsoncons::Json_object_<KeyT, Json>::key_storage_type&&, T&&) [with T = int&; A = std::allocator<char>; KeyT = std::__cxx11::basic_string<char>; Json = jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> >]':
/app/kuksa-cloud-dashboard/../3rd-party-libs/jsoncons/json_structures.hpp:1055:118: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >*, std::vector<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >, std::allocator<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > > > > >' will change in GCC 7.1
                                    [](const value_type& a, const string_view_type& k){return a.key().compare(k) < 0;});
                                                                                                                      ^
/app/kuksa-cloud-dashboard/../3rd-party-libs/jsoncons/json_structures.hpp: In member function 'typename std::enable_if<jsoncons::is_stateless<A>::value, void>::type jsoncons::json_object<KeyT, Json, false>::set_(typename jsoncons::Json_object_<KeyT, Json>::key_storage_type&&, T&&) [with T = int; A = std::allocator<char>; KeyT = std::__cxx11::basic_string<char>; Json = jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> >]':
/app/kuksa-cloud-dashboard/../3rd-party-libs/jsoncons/json_structures.hpp:1055:118: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >*, std::vector<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >, std::allocator<jsoncons::key_value_pair<std::__cxx11::basic_string<char>, jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > > > > >' will change in GCC 7.1
                                    [](const value_type& a, const string_view_type& k){return a.key().compare(k) < 0;});
                                                                   

It is from the included 3rd party lib. Do we even want to fix that?

@SebastianSchildt
Copy link
Contributor

Ok, it seems more of a compiler fix. So I vote won't fix:
https://stackoverflow.com/questions/48149323/what-does-the-the-gcc-warning-project-parameter-passing-for-x-changed-in-gcc-7

We are not linking to dynamic libs (the json stuff is header-only lib), so there should be no problem.

Warning could be disabled

https://stackoverflow.com/questions/52020305/what-exactly-does-gccs-wpsabi-option-do-what-are-the-implications-of-supressi
(tested, works)

But that is only cosemtic, so I rather keep it, as there might be situations where it is more important

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

No branches or pull requests

3 participants