Ok, I tried to compile libopencm3 with CodeSourcery toolchain from here:
https://sourcery.mentor.com/GNUToolchain/release2635

and everything builds fine. So it would be fine to update README file mentioning that one should use CodeSourcery toolchain and not toolchain from Debian repos. This patch can be abandoned.