compiling without -fno-rtti and -fexceptions

I'm using a c++ library that relies on exceptions and rtti calls, so to compile that I removed following 2 lines from .arduino15/packages/arduino/hardware/mbed/1.1.3/variants/ARDUINO_NANO33BLE/cxxflags.txt

  • -fno-exceptions
  • -fno-rtti

It compiles fine, but throws error during linking

../arduino_cache_117965/core/core_arduino_mbed_nano33ble_db1fcdb59f6c7c2458afdb11bf5b803d.a(PluggableUSBDevice.cpp.o):(.rodata._ZTIN7arduino18PluggableUSBDeviceE+0x8): undefined reference to `typeinfo for USBDevice'
../arduino_cache_117965/core/core_arduino_mbed_nano33ble_db1fcdb59f6c7c2458afdb11bf5b803d.a(USBCDC.cpp.o):(.rodata._ZTIN7arduino6USBCDC10AsyncWriteE[_ZTIN7arduino6USBCDC10AsyncWriteE]+0x8): undefined reference to `typeinfo for AsyncOp'
../arduino_cache_117965/core/core_arduino_mbed_nano33ble_db1fcdb59f6c7c2458afdb11bf5b803d.a(USBCDC.cpp.o):(.rodata._ZTIN7arduino6USBCDC9AsyncReadE[_ZTIN7arduino6USBCDC9AsyncReadE]+0x8): undefined reference to `typeinfo for AsyncOp'
Multiple libraries were found for "Arduino_LSM9DS1.h"
 Used: /home/aits/Arduino/libraries/Arduino_LSM9DS1
Multiple libraries were found for "Wire.h"
 Used: /home/aits/.arduino15/packages/arduino/hardware/mbed/1.1.3/libraries/Wire
../arduino_cache_117965/core/core_arduino_mbed_nano33ble_db1fcdb59f6c7c2458afdb11bf5b803d.a(USBCDC.cpp.o):(.rodata._ZTIN7arduino6USBCDC9AsyncWaitE[_ZTIN7arduino6USBCDC9AsyncWaitE]+0x8): undefined reference to `typeinfo for AsyncOp'
Multiple libraries were found for "deepC.h"
 Used: /home/aits/Arduino/libraries/deepC
../arduino_cache_117965/core/core_arduino_mbed_nano33ble_db1fcdb59f6c7c2458afdb11bf5b803d.a(USBCDC.cpp.o):(.rodata._ZTIN7arduino6USBCDCE+0x8): undefined reference to `typeinfo for arduino::internal::PluggableUSBModule'
../arduino_cache_117965/core/core_arduino_mbed_nano33ble_db1fcdb59f6c7c2458afdb11bf5b803d.a(USBSerial.cpp.o):(.rodata._ZTIN7arduino9USBSerialE+0x18): undefined reference to `typeinfo for mbed::Stream'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Nano 33 BLE.

Quick questions:

  • Is there a (however expensive) way to build a bundle on for Arduino Nano 33 BLE?
  • If not, does this limitation comes from Cortex M4?

Helpful pointers for further guidance will be appreciated.

Thanks.

This is not a limitation caused by the Cortex-M4 but a design decision by the mbed OS developers. The following post likely answers your question.

https://os.mbed.com/forum/bugs-suggestions/topic/4494/?page=1#comment-22376