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

Convert the C++ support to use exceptions for "proper" language support. #40

Draft
wants to merge 4 commits into
base: cpp_fixes
Choose a base branch
from

Conversation

dkfellows
Copy link
Member

Alas, these don't actually work yet, as we've not got the code to implement exceptions (which is what all the log output below is really saying).

/Users/dkf/git/spinnaker_tools/lib/libspin1_api.a(sark.o): In function `c_main':
/Users/dkf/git/spinnaker_tools/sark/sark_cpp.cpp:11: undefined reference to `__cxa_begin_catch'
/Users/dkf/git/spinnaker_tools/sark/sark_cpp.cpp:11: undefined reference to `__cxa_end_catch'
/Users/dkf/git/spinnaker_tools/sark/sark_cpp.cpp:14: undefined reference to `__cxa_begin_catch'
/Users/dkf/git/spinnaker_tools/sark/sark_cpp.cpp:11: undefined reference to `__cxa_end_catch'
/Users/dkf/git/spinnaker_tools/sark/sark_cpp.cpp:14: undefined reference to `__cxa_end_catch'
/Users/dkf/git/spinnaker_tools/sark/sark_cpp.cpp:14: undefined reference to `__cxa_end_cleanup'
/Users/dkf/git/spinnaker_tools/lib/libspin1_api.a(sark.o):(.ARM.extab.text.c_main+0x0): undefined reference to `__gxx_personality_v0'
build/gnu/hello_cpp.o: In function `operator new(unsigned int)':
/Users/dkf/git/spinnaker_tools/include/sark_cpp.h:13: undefined reference to `__cxa_allocate_exception'
/Users/dkf/git/spinnaker_tools/include/sark_cpp.h:13: undefined reference to `__cxa_throw'
/Users/dkf/git/spinnaker_tools/include/sark_cpp.h:13: undefined reference to `vtable for std::bad_alloc'
/Users/dkf/git/spinnaker_tools/include/sark_cpp.h:13: undefined reference to `std::bad_alloc::~bad_alloc()'
build/gnu/hello_cpp.o:(.rodata._ZTISt9exception[typeinfo for std::exception]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
build/gnu/hello_cpp.o:(.rodata._ZTISt9bad_alloc[typeinfo for std::bad_alloc]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/opt/local/lib/gcc/arm-none-eabi/5.4.0/libgcc.a(unwind-arm.o): In function `get_eit_entry':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_arm-none-eabi-gcc/arm-none-eabi-gcc/work/gcc-5.4.0/libgcc/unwind-arm-common.inc:266: undefined reference to `__exidx_start'
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_arm-none-eabi-gcc/arm-none-eabi-gcc/work/gcc-5.4.0/libgcc/unwind-arm-common.inc:266: undefined reference to `__exidx_end'
/opt/local/lib/gcc/arm-none-eabi/5.4.0/../../../../arm-none-eabi/lib/libc.a(lib_a-abort.o): In function `abort':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_arm-none-eabi-gcc/arm-none-eabi-gcc/work/gcc-5.4.0/newlib/libc/stdlib/abort.c:63: undefined reference to `_exit'
/opt/local/lib/gcc/arm-none-eabi/5.4.0/../../../../arm-none-eabi/lib/libc.a(lib_a-signalr.o): In function `_kill_r':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_arm-none-eabi-gcc/arm-none-eabi-gcc/work/gcc-5.4.0/newlib/libc/reent/signalr.c:61: undefined reference to `_kill'
/opt/local/lib/gcc/arm-none-eabi/5.4.0/../../../../arm-none-eabi/lib/libc.a(lib_a-signalr.o): In function `_getpid_r':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_arm-none-eabi-gcc/arm-none-eabi-gcc/work/gcc-5.4.0/newlib/libc/reent/signalr.c:96: undefined reference to `_getpid'
/opt/local/lib/gcc/arm-none-eabi/5.4.0/../../../../arm-none-eabi/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_arm-none-eabi-gcc/arm-none-eabi-gcc/work/gcc-5.4.0/newlib/libc/reent/sbrkr.c:58: undefined reference to `_sbrk'
collect2: error: ld returned 1 exit status
make: *** [build/gnu/hello_cpp.elf] Error 1

@alan-stokes alan-stokes added the incomplete_left_for_further_release Not ready for merging label Aug 3, 2017
@alan-stokes alan-stokes added this to the 5.0.0 milestone Aug 3, 2017
Alas, these don't actually work yet, as we've not got the code to
implement exceptions.

/Users/dkf/git/spinnaker_tools/lib/libspin1_api.a(sark.o): In function
`c_main':
/Users/dkf/git/spinnaker_tools/sark/sark_cpp.cpp:11: undefined reference
to `__cxa_begin_catch'
/Users/dkf/git/spinnaker_tools/sark/sark_cpp.cpp:11: undefined reference
to `__cxa_end_catch'
/Users/dkf/git/spinnaker_tools/sark/sark_cpp.cpp:14: undefined reference
to `__cxa_begin_catch'
/Users/dkf/git/spinnaker_tools/sark/sark_cpp.cpp:11: undefined reference
to `__cxa_end_catch'
/Users/dkf/git/spinnaker_tools/sark/sark_cpp.cpp:14: undefined reference
to `__cxa_end_catch'
/Users/dkf/git/spinnaker_tools/sark/sark_cpp.cpp:14: undefined reference
to `__cxa_end_cleanup'
/Users/dkf/git/spinnaker_tools/lib/libspin1_api.a(sark.o):(.ARM.extab.text.c_main+0x0):
undefined reference to `__gxx_personality_v0'
build/gnu/hello_cpp.o: In function `operator new(unsigned int)':
/Users/dkf/git/spinnaker_tools/include/sark_cpp.h:13: undefined
reference to `__cxa_allocate_exception'
/Users/dkf/git/spinnaker_tools/include/sark_cpp.h:13: undefined
reference to `__cxa_throw'
/Users/dkf/git/spinnaker_tools/include/sark_cpp.h:13: undefined
reference to `vtable for std::bad_alloc'
/Users/dkf/git/spinnaker_tools/include/sark_cpp.h:13: undefined
reference to `std::bad_alloc::~bad_alloc()'
build/gnu/hello_cpp.o:(.rodata._ZTISt9exception[typeinfo for
std::exception]+0x0): undefined reference to `vtable for
__cxxabiv1::__class_type_info'
build/gnu/hello_cpp.o:(.rodata._ZTISt9bad_alloc[typeinfo for
std::bad_alloc]+0x0): undefined reference to `vtable for
__cxxabiv1::__si_class_type_info'
/opt/local/lib/gcc/arm-none-eabi/5.4.0/libgcc.a(unwind-arm.o): In
function `get_eit_entry':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_arm-none-eabi-gcc/arm-none-eabi-gcc/work/gcc-5.4.0/libgcc/unwind-arm-common.inc:266:
undefined reference to `__exidx_start'
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_arm-none-eabi-gcc/arm-none-eabi-gcc/work/gcc-5.4.0/libgcc/unwind-arm-common.inc:266:
undefined reference to `__exidx_end'
/opt/local/lib/gcc/arm-none-eabi/5.4.0/../../../../arm-none-eabi/lib/libc.a(lib_a-abort.o):
In function `abort':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_arm-none-eabi-gcc/arm-none-eabi-gcc/work/gcc-5.4.0/newlib/libc/stdlib/abort.c:63:
undefined reference to `_exit'
/opt/local/lib/gcc/arm-none-eabi/5.4.0/../../../../arm-none-eabi/lib/libc.a(lib_a-signalr.o):
In function `_kill_r':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_arm-none-eabi-gcc/arm-none-eabi-gcc/work/gcc-5.4.0/newlib/libc/reent/signalr.c:61:
undefined reference to `_kill'
/opt/local/lib/gcc/arm-none-eabi/5.4.0/../../../../arm-none-eabi/lib/libc.a(lib_a-signalr.o):
In function `_getpid_r':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_arm-none-eabi-gcc/arm-none-eabi-gcc/work/gcc-5.4.0/newlib/libc/reent/signalr.c:96:
undefined reference to `_getpid'
/opt/local/lib/gcc/arm-none-eabi/5.4.0/../../../../arm-none-eabi/lib/libc.a(lib_a-sbrkr.o):
In function `_sbrk_r':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_arm-none-eabi-gcc/arm-none-eabi-gcc/work/gcc-5.4.0/newlib/libc/reent/sbrkr.c:58:
undefined reference to `_sbrk'
collect2: error: ld returned 1 exit status
make: *** [build/gnu/hello_cpp.elf] Error 1
@dkfellows dkfellows removed the incomplete_left_for_further_release Not ready for merging label Sep 29, 2017
@dkfellows dkfellows modified the milestones: 5.0.0, 5.1.0 Aug 12, 2019
@dkfellows dkfellows modified the milestones: 5.1.0, 6.0.0 Nov 22, 2019
@lplana lplana marked this pull request as draft September 19, 2020 09:15
@dkfellows dkfellows modified the milestones: 6.0.0, Bluesky Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants