Skip to content

Commit ceabe73

Browse files
authored
Merge v7-M and v7E-M library variants (#482)
The only differece between v7-M and v7E-M is the DSP extension, which is not useful for the C/C++ libraries, so we can simplify things by just having v7-M builds. This fills in a gap of (v7-M, fpv4-sp-d16, hard-float), which we did not previously have a valid library for.
1 parent d95a4fa commit ceabe73

File tree

4 files changed

+34
-42
lines changed

4 files changed

+34
-42
lines changed

CMakeLists.txt

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,25 +1654,9 @@ add_library_variants_for_cpu(
16541654
)
16551655
add_library_variants_for_cpu(
16561656
armv7m
1657-
SUFFIX soft_nofp
1658-
COMPILE_FLAGS "-mfloat-abi=soft -march=armv7m -mfpu=none"
1659-
MULTILIB_FLAGS "--target=thumbv7m-unknown-none-eabi -mfpu=none"
1660-
PICOLIBC_BUILD_TYPE "minsize"
1661-
QEMU_MACHINE "mps2-an385"
1662-
QEMU_CPU "cortex-m3"
1663-
BOOT_FLASH_ADDRESS 0x00000000
1664-
BOOT_FLASH_SIZE 0x1000
1665-
FLASH_ADDRESS 0x21000000
1666-
FLASH_SIZE 0x600000
1667-
RAM_ADDRESS 0x21600000
1668-
RAM_SIZE 0xa00000
1669-
STACK_SIZE 4K
1670-
)
1671-
add_library_variants_for_cpu(
1672-
armv7em
16731657
SUFFIX hard_fpv4_sp_d16
1674-
COMPILE_FLAGS "-mfloat-abi=hard -march=armv7em -mfpu=fpv4-sp-d16"
1675-
MULTILIB_FLAGS "--target=thumbv7em-unknown-none-eabihf -mfpu=fpv4-sp-d16"
1658+
COMPILE_FLAGS "-mfloat-abi=hard -march=armv7m -mfpu=fpv4-sp-d16"
1659+
MULTILIB_FLAGS "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv4-sp-d16"
16761660
PICOLIBC_BUILD_TYPE "minsize"
16771661
QEMU_MACHINE "mps2-an386"
16781662
QEMU_CPU "cortex-m4"
@@ -1685,10 +1669,10 @@ add_library_variants_for_cpu(
16851669
STACK_SIZE 4K
16861670
)
16871671
add_library_variants_for_cpu(
1688-
armv7em
1672+
armv7m
16891673
SUFFIX hard_fpv5_d16
1690-
COMPILE_FLAGS "-mfloat-abi=hard -march=armv7em -mfpu=fpv5-d16"
1691-
MULTILIB_FLAGS "--target=thumbv7em-unknown-none-eabihf -mfpu=fpv5-d16"
1674+
COMPILE_FLAGS "-mfloat-abi=hard -march=armv7m -mfpu=fpv5-d16"
1675+
MULTILIB_FLAGS "--target=thumbv7m-unknown-none-eabihf -mfpu=fpv5-d16"
16921676
PICOLIBC_BUILD_TYPE "minsize"
16931677
QEMU_MACHINE "mps2-an500"
16941678
QEMU_CPU "cortex-m7"
@@ -1705,12 +1689,12 @@ add_library_variants_for_cpu(
17051689
# no-fpu variant to win, it has to be in multilab.yaml after all other
17061690
# fpu variants. The order of variants in multilab.yaml depends on the order
17071691
# of the add_library_variant calls. So the add_library_variant that adds
1708-
# the soft_nofp for armv7em is placed after all other armv7em variants.
1692+
# the soft_nofp for armv7m is placed after all other armv7m variants.
17091693
add_library_variants_for_cpu(
1710-
armv7em
1694+
armv7m
17111695
SUFFIX soft_nofp
1712-
COMPILE_FLAGS "-mfloat-abi=soft -march=armv7em -mfpu=none"
1713-
MULTILIB_FLAGS "--target=thumbv7em-unknown-none-eabi -mfpu=none"
1696+
COMPILE_FLAGS "-mfloat-abi=soft -march=armv7m -mfpu=none"
1697+
MULTILIB_FLAGS "--target=thumbv7m-unknown-none-eabi -mfpu=none"
17141698
PICOLIBC_BUILD_TYPE "minsize"
17151699
QEMU_MACHINE "mps2-an386"
17161700
QEMU_CPU "cortex-m4"

test-support/picolibc-test-wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
# computations on types implemented in software
1818
# https://github.com/picolibc/picolibc/pull/500
1919
"picolibc_armv7m_soft_fpv4_sp_d16-build/test/math_errhandling",
20-
"picolibc_armv7em_hard_fpv4_sp_d16-build/test/math_errhandling",
20+
"picolibc_armv7m_hard_fpv4_sp_d16-build/test/math_errhandling",
2121
"picolibc_armv8.1m.main_hard_fp_nomve-build/test/math_errhandling",
2222
"picolibc_armv7m_soft_fpv4_sp_d16_exn_rtti-build/test/math_errhandling",
23-
"picolibc_armv7em_hard_fpv4_sp_d16_exn_rtti-build/test/math_errhandling",
23+
"picolibc_armv7m_hard_fpv4_sp_d16_exn_rtti-build/test/math_errhandling",
2424
"picolibc_armv8.1m.main_hard_fp_nomve_exn_rtti-build/test/math_errhandling",
2525
"picolibc_armv8.1m.main_hard_nofp_mve-build/test/fenv",
2626
"picolibc_armv8.1m.main_hard_nofp_mve-build/test/math_errhandling",

test/multilib/armv7em.test

Lines changed: 0 additions & 11 deletions
This file was deleted.

test/multilib/armv7m.test

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
1-
# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none | FileCheck %s
2-
# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none -mfloat-abi=softfp | FileCheck %s
3-
# CHECK: arm-none-eabi/armv7m_soft_nofp_exn_rtti{{$}}
4-
# CHECK-EMPTY:
1+
# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none | FileCheck %s --check-prefix=NONE
2+
# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=none -mfloat-abi=softfp | FileCheck %s --check-prefix=NONE
3+
# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=none -mfloat-abi=softfp | FileCheck %s --check-prefix=NONE
4+
# NONE: arm-none-eabi/armv7m_soft_nofp_exn_rtti{{$}}
5+
# NONE-EMPTY:
56

67
# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4 %s
78
# RUN: %clang -print-multi-directory --target=armv7m-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4 %s
9+
# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv4-sp-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4 %s
10+
# RUN: %clang -print-multi-directory --target=armv7em-none-eabi -mfpu=fpv5-d16 -mfloat-abi=softfp | FileCheck --check-prefix=SOFT-FPV4 %s
811
# SOFT-FPV4: arm-none-eabi/armv7m_soft_fpv4_sp_d16_exn_rtti{{$}}
912
# SOFT-FPV4-EMPTY:
13+
#
14+
# RUN: %clang -print-multi-directory --target=armv7m-none-eabihf -mfpu=fpv4-sp-d16 | FileCheck --check-prefix=FPV4 %s
15+
# RUN: %clang -print-multi-directory --target=armv7em-none-eabihf -mfpu=fpv4-sp-d16 | FileCheck --check-prefix=FPV4 %s
16+
# FPV4: arm-none-eabi/armv7m_hard_fpv4_sp_d16_exn_rtti{{$}}
17+
# FPV4-EMPTY:
18+
#
19+
# RUN: %clang -print-multi-directory --target=armv7m-none-eabihf -mfpu=fpv5-d16 | FileCheck --check-prefix=FPV5 %s
20+
# RUN: %clang -print-multi-directory --target=armv7em-none-eabihf -mfpu=fpv5-d16 | FileCheck --check-prefix=FPV5 %s
21+
# FPV5: arm-none-eabi/armv7m_hard_fpv5_d16_exn_rtti{{$}}
22+
# FPV5-EMPTY:
23+
24+
# %clang -print-multi-directory --target=arm-none-eabi -mcpu=cortex-m3 | FileCheck %s --check-prefix=NONE
25+
# %clang -print-multi-directory --target=arm-none-eabi -mcpu=cortex-m4 | FileCheck %s --check-prefix=SOFT-FPV4
26+
# %clang -print-multi-directory --target=arm-none-eabihf -mcpu=cortex-m4 | FileCheck %s --check-prefix=FPV4
27+
# %clang -print-multi-directory --target=arm-none-eabi -mcpu=cortex-m7 | FileCheck %s --check-prefix=SOFT-FPV4
28+
# %clang -print-multi-directory --target=arm-none-eabihf -mcpu=cortex-m7 | FileCheck %s --check-prefix=FPV4

0 commit comments

Comments
 (0)