Bug ID 1106014
Summary cross-arm-none-gcc8-8.1.1+r262873-1.3.x86_64 -mcpu=cortex-m0plus emits incorrect arch
Classification openSUSE
Product openSUSE Tumbleweed
Version Current
Hardware Other
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component Development
Assignee bnc-team-screening@forge.provo.novell.com
Reporter william@blackhats.net.au
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

Hi,

The cross-arm-none-gcc8 package in OpenSUSE may have an incorrect definition
for -mcpu=cortex-m0plus. 

On Fedora27 compiling the code found in the tomu-sample repo causes the ELF to
have the following details:

No version information found in this file. 
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "Cortex-M0+"
  Tag_CPU_arch: v6S-M
  Tag_CPU_arch_profile: Microcontroller
  Tag_THUMB_ISA_use: Thumb-1
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: small
  Tag_ABI_optimization_goals: Aggressive Size

Please note the Tap_CPU_arch.

On OpenSUSE the following is shown:

No version information found in this file. 
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "ARM v6K"
  Tag_CPU_arch: v6K
  Tag_CPU_arch_profile: Microcontroller
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: small
  Tag_ABI_optimization_goals: Aggressive Size

This causes the development board to fail to initialise as it is the wrong CPU
arch. There are other platforms (arch linux, macOSX) where they correctly emit
armv6s-m for -mcpu=cortex-m0plus.

Version of affected packages:

cross-arm-binutils-2.31-1.1.x86_64
cross-arm-none-newlib-devel-3.0.0-2.5.x86_64
cross-arm-none-gcc8-8.1.1+r262873-1.3.x86_64

Reproduction:

https://github.com/im-tomu/tomu-samples

Follow the readme, or:

git submodule init
git submodule update

make -C libopencm3
make -C usb_simple

readelf -A usb_simple/usb_simple.elf


You are receiving this mail because: