ataradov / mcu-starter-projects

Simple starter projects for bare-metal MCU development
309 stars 41 forks source link

Errors when building with Clang #4

Open emolitor opened 3 years ago

emolitor commented 3 years ago

Annoyingly recent versions of Clang are always generating exidx which causes a link failure even when exceptions are explicitly disabled. To work around this I modified your linker script for the MCU I was testing, SAMD10, to exclude those sections [see following snippet]. Are you interested in me submitting patches like this to the mcu-starter-projects to build with Clang?

  /DISCARD/ :
  {
      // Clang always produces at least exidx so explicitly DISCARD as they are not needed
      *(.ARM.exidx);
      *(.ARM.exidx.*);
      *(.ARM.extab.*);
  }
ataradov commented 3 years ago

Sure, if the patch includes adding this to all ARM linker scripts, I'll accept it.

Generally, I'm focusing on GCC, so I'm not likely to accept more esoteric things from other compilers (#pragmas and other stuff like this). But if a minor code modification can make it compile with something else - it is fine.