I am trying to cross compile boost 1.63 for Raspberry Pi, i.e. for an ARM core. But the build fails for boost-coroutine and boost-context. Here is my build log http://sprunge.us/NVDd As far as I can see from development files in https://github.com/ boostorg/context/tree/develop/src/asm ARM is supported at least by boost-context. Is there anything I can do about or any progress for this issue? If not, is there an older version I should try? Regards
http://www.boost.org/doc/libs/1_63_0/libs/context/doc/html/context/architect... architecture=arm <address-model>=32 <binary-format>=elf <abi>=aapcs
Thanks Oliver, this helped to get rid of platform not supported error. But I am still struggling with another error: 'exception_ptr' is not a member of 'std'. Build log: http://sprunge.us/hMVe I am pretty sure it is defined for arm: $ sed -n "64p" ../arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/include/c++/6.3.0/bits/exception_ptr.h exception_ptr current_exception() _GLIBCXX_USE_NOEXCEPT; Any ideas on how to solve this? 2017-05-13 13:39 GMT+02:00 Oliver Kowalke via Boost-users < boost-users@lists.boost.org>:
http://www.boost.org/doc/libs/1_63_0/libs/context/doc/html/ context/architectures/crosscompiling.html
architecture=arm <address-model>=32 <binary-format>=elf <abi>=aapcs
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
exception_ptr is part of C++11 but not used in boost.coroutine (and the fcontext-API of boost.context) - you could apply -std=c++11(cxxflags) or check why C++11 code is used
No matter if I add -std=c++11 to the flags, I still get the error message: http://sprunge.us/gSXb This is my compiler's configuration: http://sprunge.us/iaWZ I'm not sure how to check why C++11 code is used though. 2017-05-13 15:02 GMT+02:00 Oliver Kowalke via Boost-users < boost-users@lists.boost.org>:
exception_ptr is part of C++11 but not used in boost.coroutine (and the fcontext-API of boost.context) - you could apply -std=c++11(cxxflags) or check why C++11 code is used
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
Since you're using GCC 6.3, which defaults to -std=c++14, specifying -std=c++11 explicitly should not be necessary. But what's shown by `b2` in your previous post (http://sprunge.us/hMVe) suggests many of C++11 features are not supported by your compiler ('Boost.Config Feature Check: cxx11_..: no'). So I think you may want to check which compiler is called by `b2`, there may be some other old compiler being called.
On 13 May 2017, at 21:17, Daniel Estermann via Boost-users
wrote: No matter if I add -std=c++11 to the flags, I still get the error message: http://sprunge.us/gSXb This is my compiler's configuration: http://sprunge.us/iaWZ I'm not sure how to check why C++11 code is used though.
2017-05-13 15:02 GMT+02:00 Oliver Kowalke via Boost-users
: exception_ptr is part of C++11 but not used in boost.coroutine (and the fcontext-API of boost.context) - you could apply -std=c++11(cxxflags) or check why C++11 code is used _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
Sorry about my previous post, it should be irrelevant here since you tried to compile `execution_context.cpp` by calling GCC directly in the shell and still failed. Still not clear why `b2` believes many of C++11 features are absent and why std::exception_ptr is not recognized though..
On 13 May 2017, at 22:21, d25fe0be@outlook.com wrote:
Since you're using GCC 6.3, which defaults to -std=c++14, specifying -std=c++11 explicitly should not be necessary.
But what's shown by `b2` in your previous post (http://sprunge.us/hMVe) suggests many of C++11 features are not supported by your compiler ('Boost.Config Feature Check: cxx11_..: no').
So I think you may want to check which compiler is called by `b2`, there may be some other old compiler being called.
On 13 May 2017, at 21:17, Daniel Estermann via Boost-users
wrote: No matter if I add -std=c++11 to the flags, I still get the error message: http://sprunge.us/gSXb This is my compiler's configuration: http://sprunge.us/iaWZ I'm not sure how to check why C++11 code is used though.
2017-05-13 15:02 GMT+02:00 Oliver Kowalke via Boost-users
: exception_ptr is part of C++11 but not used in boost.coroutine (and the fcontext-API of boost.context) - you could apply -std=c++11(cxxflags) or check why C++11 code is used _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
It may be worth to try to compile the following code snippet to see if your compiler is working as expected: $ cat t.cpp #include <exception> std::exception_ptr x; int main() {} $ g++-6 ./t.cpp $ Perhaps your compiler (or libstdc++) is broken in some way.
On 13 May 2017, at 21:17, Daniel Estermann via Boost-users
wrote: No matter if I add -std=c++11 to the flags, I still get the error message: http://sprunge.us/gSXb This is my compiler's configuration: http://sprunge.us/iaWZ I'm not sure how to check why C++11 code is used though.
2017-05-13 15:02 GMT+02:00 Oliver Kowalke via Boost-users
: exception_ptr is part of C++11 but not used in boost.coroutine (and the fcontext-API of boost.context) - you could apply -std=c++11(cxxflags) or check why C++11 code is used _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
Thanks for the minimal example hint. Here is what I get:
$ arm-unknown-linux-gnueabihf-gcc -xc++ - < #include <exception> std::exception_ptr x; int main() {} EOF
<stdin>:3:6: error: 'exception_ptr' in namespace 'std' does not name a type 2017-05-13 17:05 GMT+02:00 d25fe0be@outlook.com It may be worth to try to compile the following code snippet to see if
your compiler is working as expected: $ cat t.cpp
#include <exception> std::exception_ptr x; int main() {}
$ g++-6 ./t.cpp
$ Perhaps your compiler (or libstdc++) is broken in some way. On 13 May 2017, at 21:17, Daniel Estermann via Boost-users <
boost-users@lists.boost.org> wrote: No matter if I add -std=c++11 to the flags, I still get the error
message: http://sprunge.us/gSXb
This is my compiler's configuration: http://sprunge.us/iaWZ
I'm not sure how to check why C++11 code is used though. 2017-05-13 15:02 GMT+02:00 Oliver Kowalke via Boost-users <
boost-users@lists.boost.org>:
exception_ptr is part of C++11 but not used in boost.coroutine (and the
fcontext-API of boost.context) -
you could apply -std=c++11(cxxflags) or check why C++11 code is used _______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
https://lists.boost.org/mailman/listinfo.cgi/boost-users _______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
https://lists.boost.org/mailman/listinfo.cgi/boost-users
your compiler is not C++11! 2017-05-13 12:11 GMT-04:00 Daniel Estermann via Boost-users < boost-users@lists.boost.org>:
Thanks for the minimal example hint. Here is what I get:
$ arm-unknown-linux-gnueabihf-gcc -xc++ - <
#include <exception>
std::exception_ptr x;
int main() {}
EOF <stdin>:3:6: error: 'exception_ptr' in namespace 'std' does not name a type
2017-05-13 17:05 GMT+02:00 d25fe0be@outlook.com
: It may be worth to try to compile the following code snippet to see if your compiler is working as expected:
$ cat t.cpp #include <exception>
std::exception_ptr x;
int main() {} $ g++-6 ./t.cpp $
Perhaps your compiler (or libstdc++) is broken in some way.
On 13 May 2017, at 21:17, Daniel Estermann via Boost-users < boost-users@lists.boost.org> wrote:
No matter if I add -std=c++11 to the flags, I still get the error message: http://sprunge.us/gSXb This is my compiler's configuration: http://sprunge.us/iaWZ I'm not sure how to check why C++11 code is used though.
2017-05-13 15:02 GMT+02:00 Oliver Kowalke via Boost-users < boost-users@lists.boost.org>: exception_ptr is part of C++11 but not used in boost.coroutine (and the fcontext-API of boost.context) - you could apply -std=c++11(cxxflags) or check why C++11 code is used
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Daniel *L'action accède à la perfection quand, bien que vivant, vous êtes déjà mort* *Bunan*
Try compiling it with '-v' (g++ -v t.cpp) so that the include search paths are printed ('#include <...> search starts here: ...'), and examine them to see if there is some other implementation (which presumably does not implement std::exception_ptr) of STL is included and takes precedence over the libstdc++ coming with GCC 6.3. If there is, I suggest you do a clean build of your cross-compiling toolchain. I also noticed that this time you're using `arm-unknown-linux-gnueabihf-gcc` (an unknown version) instead of `arm-unknown-linux-gnueabi-gcc` (which should be 6.3.0 from your previous post), and they seems to be two different installations. I'm not sure if this is related, but there's a chance that the two installations are messed together in some way, which may cause some problems.
On 14 May 2017, at 00:11, Daniel Estermann via Boost-users
wrote: Thanks for the minimal example hint. Here is what I get:
$ arm-unknown-linux-gnueabihf-gcc -xc++ - <
#include <exception>
std::exception_ptr x;
int main() {}
EOF <stdin>:3:6: error: 'exception_ptr' in namespace 'std' does not name a type
2017-05-13 17:05 GMT+02:00 d25fe0be@outlook.com
: It may be worth to try to compile the following code snippet to see if your compiler is working as expected: $ cat t.cpp #include <exception>
std::exception_ptr x;
int main() {} $ g++-6 ./t.cpp $
Perhaps your compiler (or libstdc++) is broken in some way.
On 13 May 2017, at 21:17, Daniel Estermann via Boost-users
wrote: No matter if I add -std=c++11 to the flags, I still get the error message: http://sprunge.us/gSXb This is my compiler's configuration: http://sprunge.us/iaWZ I'm not sure how to check why C++11 code is used though.
2017-05-13 15:02 GMT+02:00 Oliver Kowalke via Boost-users
: exception_ptr is part of C++11 but not used in boost.coroutine (and the fcontext-API of boost.context) - you could apply -std=c++11(cxxflags) or check why C++11 code is used _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
Thank you again for your responses. First of all to clarify the my different logs with gnueabihf and gnueabi. The one of them runs in my native environment, i.e. in Cygwin, the other one in a Virtual Box on a Linux. To make sure that the errors are not Cygwin related. So these installations aren't mixed.
First, why in the world do you want to declare an exception variable apart from a try/catch block? I think this it sufficient to see if that type is declared at all.
From compiling the example with '-v' I learned the location of the included exception header. At the end of this header I saw:
#if (__cplusplus >= 201103L) && (ATOMIC_INT_LOCK_FREE > 1)
#include
Try compiling it with '-v' (g++ -v t.cpp) so that the include search paths are printed ('#include <...> search starts here: ...'), and examine them to see if there is some other implementation (which presumably does not implement std::exception_ptr) of STL is included and takes precedence over the libstdc++ coming with GCC 6.3.
If there is, I suggest you do a clean build of your cross-compiling toolchain.
I also noticed that this time you're using `arm-unknown-linux-gnueabihf-gcc` (an unknown version) instead of `arm-unknown-linux-gnueabi-gcc` (which should be 6.3.0 from your previous post), and they seems to be two different installations. I'm not sure if this is related, but there's a chance that the two installations are messed together in some way, which may cause some problems.
On 14 May 2017, at 00:11, Daniel Estermann via Boost-users < boost-users@lists.boost.org> wrote:
Thanks for the minimal example hint. Here is what I get:
$ arm-unknown-linux-gnueabihf-gcc -xc++ - <
#include <exception>
std::exception_ptr x;
int main() {}
EOF <stdin>:3:6: error: 'exception_ptr' in namespace 'std' does not name a type
2017-05-13 17:05 GMT+02:00 d25fe0be@outlook.com
: It may be worth to try to compile the following code snippet to see if your compiler is working as expected: $ cat t.cpp #include <exception>
std::exception_ptr x;
int main() {} $ g++-6 ./t.cpp $
Perhaps your compiler (or libstdc++) is broken in some way.
On 13 May 2017, at 21:17, Daniel Estermann via Boost-users < boost-users@lists.boost.org> wrote:
No matter if I add -std=c++11 to the flags, I still get the error message: http://sprunge.us/gSXb This is my compiler's configuration: http://sprunge.us/iaWZ I'm not sure how to check why C++11 code is used though.
2017-05-13 15:02 GMT+02:00 Oliver Kowalke via Boost-users < boost-users@lists.boost.org>: exception_ptr is part of C++11 but not used in boost.coroutine (and the fcontext-API of boost.context) - you could apply -std=c++11(cxxflags) or check why C++11 code is used
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
I have to add that it seems to have nothing to do with my cross compiler
though. I must have bumped into a known gcc bug, which was fixed only in
version 7.0.0: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938
Marked as duplicate std::future must be affected as well:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735
I am a bit surprised the code compiled on Pi, but I think they fixed that
somehow in their own branch of gcc (since its version is 4.9.2*-10*)
pi@rpi1 ~ $ g++ -v
...
gcc version 4.9.2 (Raspbian 4.9.2-10)
2017-05-13 20:15 GMT+02:00 Daniel Estermann
Thank you again for your responses.
First of all to clarify the my different logs with gnueabihf and gnueabi. The one of them runs in my native environment, i.e. in Cygwin, the other one in a Virtual Box on a Linux. To make sure that the errors are not Cygwin related. So these installations aren't mixed.
First, why in the world do you want to declare an exception variable apart from a try/catch block? I think this it sufficient to see if that type is declared at all.
From compiling the example with '-v' I learned the location of the included exception header. At the end of this header I saw:
#if (__cplusplus >= 201103L) && (ATOMIC_INT_LOCK_FREE > 1) #include
#include #endif Playing around with #error's I found out ATOMIC_INT_LOCK_FREE is set to 1 so this condition isn't fulfilled. The next thing i tried out is to comment that condition. The result was:
/cygdrive/d/Development/x-tools/arm-unknown-linux- gnueabihf/arm-unknown-linux-gnueabihf/include/c++/6.3.0/bits/nested_exception.h:43:4: error: #error This platform does not support exception propagation.
I checked then if this example compiles on Pi. It worked. So it seems I have to rebuild my cross-compiler. Do you maybe know which option should I pay attention to, to have this option set?
2017-05-13 18:41 GMT+02:00 d25fe0be@outlook.com
: Try compiling it with '-v' (g++ -v t.cpp) so that the include search paths are printed ('#include <...> search starts here: ...'), and examine them to see if there is some other implementation (which presumably does not implement std::exception_ptr) of STL is included and takes precedence over the libstdc++ coming with GCC 6.3.
If there is, I suggest you do a clean build of your cross-compiling toolchain.
I also noticed that this time you're using `arm-unknown-linux-gnueabihf-gcc` (an unknown version) instead of `arm-unknown-linux-gnueabi-gcc` (which should be 6.3.0 from your previous post), and they seems to be two different installations. I'm not sure if this is related, but there's a chance that the two installations are messed together in some way, which may cause some problems.
On 14 May 2017, at 00:11, Daniel Estermann via Boost-users < boost-users@lists.boost.org> wrote:
Thanks for the minimal example hint. Here is what I get:
$ arm-unknown-linux-gnueabihf-gcc -xc++ - <
#include <exception>
std::exception_ptr x;
int main() {}
EOF <stdin>:3:6: error: 'exception_ptr' in namespace 'std' does not name a type
2017-05-13 17:05 GMT+02:00 d25fe0be@outlook.com
: It may be worth to try to compile the following code snippet to see if your compiler is working as expected: $ cat t.cpp #include <exception>
std::exception_ptr x;
int main() {} $ g++-6 ./t.cpp $
Perhaps your compiler (or libstdc++) is broken in some way.
On 13 May 2017, at 21:17, Daniel Estermann via Boost-users < boost-users@lists.boost.org> wrote:
No matter if I add -std=c++11 to the flags, I still get the error message: http://sprunge.us/gSXb This is my compiler's configuration: http://sprunge.us/iaWZ I'm not sure how to check why C++11 code is used though.
2017-05-13 15:02 GMT+02:00 Oliver Kowalke via Boost-users < boost-users@lists.boost.org>: exception_ptr is part of C++11 but not used in boost.coroutine (and the fcontext-API of boost.context) - you could apply -std=c++11(cxxflags) or check why C++11 code is used
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
I am a bit surprised the code compiled on Pi, but I think they fixed that somehow in their own branch of gcc (since its version is 4.9.2-10)
pi@rpi1 ~ $ g++ -v ... gcc version 4.9.2 (Raspbian 4.9.2-10)
Try `gcc -dM - -E < /dev/null | grep __GCC_ATOMIC_INT_LOCK_FREE`, it should output 2 in you Pi, and output 1 when using your cross-compiler. And ATOMIC_INT_LOCK_FREE is defined to be __GCC_ATOMIC_INT_LOCK_FREE, so the code compiles.
Playing around with #error's I found out ATOMIC_INT_LOCK_FREE is set to 1 so this condition isn't fulfilled. The next thing i tried out is to comment that condition. The result was:
/cygdrive/d/Development/x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/include/c++/6.3.0/bits/nested_exception.h:43:4: error: #error This platform does not support exception propagation.
I checked then if this example compiles on Pi. It worked. So it seems I have to rebuild my cross-compiler. Do you maybe know which option should I pay attention to, to have this option set?
According to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938, configure GCC with '-with-arch=armv7-a' should do the job (setting __GCC_ATOMIC_INT_LOCK_FREE / ATOMIC_INT_LOCK_FREE to 2), IIUC. FWIW, as pointed out by frankhb1989 in that post (#11), the behavior of GCC 6.3 should be a violation of the standard. Also, starting from GCC 7.1, ATOMIC_INT_LOCK_FREE is no longer tested for exception-related stuffs. You may give it a try as well. ps: It seems that in GCC 6.3, 'future' is also relying on ATOMIC_INT_LOCK_FREE to be 2. This restrictions is removed in GCC 7.1 as well.
According to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938, configure GCC with '-with-arch=armv7-a' should do the job (setting __GCC_ATOMIC_INT_LOCK_FREE / ATOMIC_INT_LOCK_FREE to 2), IIUC. Forgot to mention that use -with-arch=armv7-a (or whatever ISA on which atomic_int is always lock free) only if your target supports it, otherwise GCC 7.1 may be the only choice.
I rebuilt the cross-compiler with flag -with-arch=armv6 - this is what Raspberry Pi's CPU actually is It looked like it helped! Thank you all for the support! 2017-05-13 21:21 GMT+02:00 d25fe0be--- via Boost-users < boost-users@lists.boost.org>:
According to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938, configure GCC with '-with-arch=armv7-a' should do the job (setting __GCC_ATOMIC_INT_LOCK_FREE / ATOMIC_INT_LOCK_FREE to 2), IIUC.
Forgot to mention that use -with-arch=armv7-a (or whatever ISA on which atomic_int is always lock free) only if your target supports it, otherwise GCC 7.1 may be the only choice.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
On Sat, May 13, 2017 at 12:11 PM, Daniel Estermann via Boost-users
Thanks for the minimal example hint. Here is what I get:
$ arm-unknown-linux-gnueabihf-gcc -xc++ - <
#include <exception>
std::exception_ptr x;
int main() {}
EOF <stdin>:3:6: error: 'exception_ptr' in namespace 'std' does not name a type
First, why in the world do you want to declare an exception variable apart from a try/catch block? Second, more obvious, that std::exception_ptr may not actually be defined. That's up to you. http://www.cplusplus.com/reference/exception/exception/ Otherwise, you're probably really close to building for ARM.
2017-05-13 17:05 GMT+02:00 d25fe0be@outlook.com
: It may be worth to try to compile the following code snippet to see if your compiler is working as expected:
$ cat t.cpp #include <exception>
std::exception_ptr x;
int main() {} $ g++-6 ./t.cpp $
Perhaps your compiler (or libstdc++) is broken in some way.
On 13 May 2017, at 21:17, Daniel Estermann via Boost-users
wrote: No matter if I add -std=c++11 to the flags, I still get the error message: http://sprunge.us/gSXb This is my compiler's configuration: http://sprunge.us/iaWZ I'm not sure how to check why C++11 code is used though.
2017-05-13 15:02 GMT+02:00 Oliver Kowalke via Boost-users
: exception_ptr is part of C++11 but not used in boost.coroutine (and the fcontext-API of boost.context) - you could apply -std=c++11(cxxflags) or check why C++11 code is used _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (5)
-
d25fe0be@outlook.com
-
Daniel Anderson
-
Daniel Estermann
-
Michael Powell
-
Oliver Kowalke