meh.. @simonedegiacomi you got gdb or something to get some more info why it crashes?
I can't run gdb on the EV3, but I tried to run it on a raspberry (I know it's not the same architecture, but it semes to work). When running the program I get:
(gdb) run Starting program: /tmp/hellow.elf Program received signal SIGSEGV, Segmentation fault. x00011c68 in strchr ()
One is C and the other C++.
they both work :thumbsup:
Great, thank you!
I noticed that your configuration doesn't support pthread, am I right? I built the toolchain myself (on the rpi) and it works, I just changed these two lines in the configuration to also support pthread:
- PTXCONF_CROSS_GCC_THREADS_SINGLE=y - PTXCONF_CROSS_GCC_THREADS="single" --- + PTXCONF_CROSS_GCC_THREADS_POSIX=y + PTXCONF_CROSS_GCC_THREADS="posix"
Last question: do you have any idea why the binaries built with this compiler weight more that the ones built with the buildroot compiler?
For the same program:
ptxbuild compiler: 1.2MB
builtroot compiler: 334KB
g++ main.cpp static-libstdc++ -std=c++11 -pthread -Os -fdata-sections -ffunction-sections, -Wl,--gc-sections)
-sto the compiler command line and see the difference?
SIGALRMthat checks which polls for the back button and calls
_Exit()if it was pressed.
SIGALRMto trigger every second. Having pthreads, just to poll and exit, feels overkill.