From 73257eeda0dc8be73c5784584eaba1144186f376 Mon Sep 17 00:00:00 2001 From: zhangyuan21 Date: Thu, 4 May 2023 13:04:59 +0800 Subject: [PATCH] libs/libc: fixed armv7-m strcmp build issue Signed-off-by: zhangyuan21 --- .../machine/arm/armv7-m/gnu/arch_strcmp.S | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/libs/libc/machine/arm/armv7-m/gnu/arch_strcmp.S b/libs/libc/machine/arm/armv7-m/gnu/arch_strcmp.S index 878a14a791..7ae553be94 100644 --- a/libs/libc/machine/arm/armv7-m/gnu/arch_strcmp.S +++ b/libs/libc/machine/arm/armv7-m/gnu/arch_strcmp.S @@ -34,6 +34,28 @@ #include "arm_asm.h" +#ifdef __ARM_BIG_ENDIAN +#define S2LO lsl +#define S2LOEQ lsleq +#define S2HI lsr +#define MSB 0x000000ff +#define LSB 0xff000000 +#define BYTE0_OFFSET 24 +#define BYTE1_OFFSET 16 +#define BYTE2_OFFSET 8 +#define BYTE3_OFFSET 0 +#else /* not __ARM_BIG_ENDIAN */ +#define S2LO lsr +#define S2LOEQ lsreq +#define S2HI lsl +#define BYTE0_OFFSET 0 +#define BYTE1_OFFSET 8 +#define BYTE2_OFFSET 16 +#define BYTE3_OFFSET 24 +#define MSB 0xff000000 +#define LSB 0x000000ff +#endif /* not __ARM_BIG_ENDIAN */ + /* Parameters and result. */ #define src1 r0 #define src2 r1 @@ -46,6 +68,14 @@ #define tmp1 r12 #define syndrome r12 /* Overlaps tmp1 */ + .macro def_fn f p2align=0 + .text + .p2align \p2align + .global \f + .type \f, %function +\f: + .endm + .thumb .syntax unified def_fn strcmp