Multiple symbol definitions in archive files (with mbed and Nordic BLE soft device)

I’ve been trying to build the mbed heart rate monitor with PlatformIO, but a gdb stack trace shows an error while initializing the BLE soft device. Looking at the generated firmware.elf, it looks like it contains the stub for createBLEInstance from FEATURE_BLE/source/BLE.cpp, instead of the actual implementation that’s in FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/nRF5xn.cpp.

Running pio run -v shows:

arm-none-eabi-g++ -o .pioenvs/nrf51_dk/firmware.elf  ...... -L.pioenvs/nrf51_dk -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -lc .pioenvs/nrf51_dk/lib/libnrf51-sdk_ID328.a .pioenvs/nrf51_dk/lib/libble_ID296.a .pioenvs/nrf51_dk/lib/libble-nrf51822_ID378.a -Wl,--end-group

Looking at the archives, libble_ID296.a contains the stub, and libble-nrf51822_ID378.a contains the implementation. Is this not working because the linker looks in libble_ID296.a first, and if so, how can I get this working correctly?

This is my platformio.ini:

platform = nordicnrf51
board = seeedTinyBLE
framework = mbed
lib_deps = ble-nrf51822
upload_protocol = stlink


Please file an issue here