diff --git a/newlib/libc/machine/arm/strlen-stub.c b/newlib/libc/machine/arm/strlen-stub.c index bcd3d2d46..ea45a3789 100644 --- a/newlib/libc/machine/arm/strlen-stub.c +++ b/newlib/libc/machine/arm/strlen-stub.c @@ -32,11 +32,14 @@ #include #if defined __OPTIMIZE_SIZE__ || defined PREFER_SIZE_OVER_SPEED -#if defined __thumb__ && !defined __thumb2__ +#if __ARM_ARCH_ISA_THUMB == 2 +/* Implemented in strlen.S. */ + +#elif defined (__ARM_ARCH_ISA_THUMB) /* Implemented in strlen.S. */ #else -/* Implemented in strlen.S. */ +#include "../../string/strlen.c" #endif diff --git a/newlib/libc/machine/arm/strlen.S b/newlib/libc/machine/arm/strlen.S index 57371453a..0435fb2de 100644 --- a/newlib/libc/machine/arm/strlen.S +++ b/newlib/libc/machine/arm/strlen.S @@ -27,11 +27,14 @@ #include "acle-compat.h" #if defined __OPTIMIZE_SIZE__ || defined PREFER_SIZE_OVER_SPEED -#if defined __thumb__ && !defined __thumb2__ +#if __ARM_ARCH_ISA_THUMB == 2 +#include "strlen-thumb2-Os.S" + +#elif defined (__ARM_ARCH_ISA_THUMB) #include "strlen-thumb1-Os.S" #else -#include "strlen-thumb2-Os.S" + /* Implemented in strlen-stub.c. */ #endif