Skip to content

Commit 1fbfbc1

Browse files
author
Hubert Badocha
committed
DBG
1 parent 34f5196 commit 1fbfbc1

File tree

4 files changed

+40
-22
lines changed

4 files changed

+40
-22
lines changed

arch/arm/v7a/reboot.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,28 @@ int reboot_reason(uint32_t *val)
5252
*val = pctl.reboot.reason;
5353
return 0;
5454
}
55+
56+
57+
#include <arch.h>
58+
59+
#ifdef __IEEE754_SQRT
60+
double __ieee754_sqrt(double x)
61+
{
62+
/* clang-format off */
63+
__asm__ volatile ("vsqrt.f64 %P0, %P1" : "=w"(x) : "w"(x));
64+
/* clang-format on */
65+
66+
return x;
67+
}
68+
#endif
69+
70+
#ifdef __IEEE754_SQRTF
71+
float __ieee754_sqrtf(float x)
72+
{
73+
/* clang-format off */
74+
__asm__ volatile ("vsqrt.f32 %0, %1" : "=t"(x) : "t"(x));
75+
/* clang-format on */
76+
77+
return x;
78+
}
79+
#endif

include/arch/armv7a/arch.h

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,21 @@
3535
#if __ARM_FP & 8
3636
#define __IEEE754_SQRT
3737

38-
static inline double __ieee754_sqrt(double x)
39-
{
40-
/* clang-format off */
41-
__asm__ volatile ("vsqrt.f64 %P0, %P1" : "=w"(x) : "w"(x));
42-
/* clang-format on */
38+
double __ieee754_sqrt(double x);
4339

44-
return x;
45-
}
4640
#endif
4741

4842
#define __IEEE754_SQRTF
4943

50-
static inline float __ieee754_sqrtf(float x)
51-
{
52-
/* clang-format off */
53-
__asm__ volatile ("vsqrt.f32 %0, %1" : "=t"(x) : "t"(x));
54-
/* clang-format on */
44+
float __ieee754_sqrtf(float x);
45+
5546

56-
return x;
57-
}
5847
#endif
5948

6049
#define _PAGE_SIZE 0x1000
6150
#define SIZE_PAGE _Pragma("GCC warning \"'SIZE_PAGE' is deprecated. Use _PAGE_SIZE from arch.h or PAGE_SIZE from limits.h (POSIX only)\"") _PAGE_SIZE
6251

6352
#define __LIBPHOENIX_ARCH_TLS_SUPPORTED
53+
#define __LIBPHOENIX_ARCH_HAVE__TLS_GET_ADDR
6454

6555
#endif

rtld/stubs.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ __attribute__((weak)) void *dlsym(void *restrict a, const char *restrict b)
5252
}
5353

5454

55-
/* Stub __tls_get_addr implementations.
56-
* They can be overriden on platforms requiring __tls_get_addr in PIC compiled platforms(eg. RISC-V, ARM).
57-
* The override work due to linking order. */
55+
/* Allow override on platforms requiring __tls_get_addr in PIC compiled libraries(eg. RISC-V, ARM). */
56+
#ifndef __LIBPHOENIX_ARCH_HAVE__TLS_GET_ADDR
57+
58+
/* Stub __tls_get_addr implementations. */
5859
__attribute__((weak)) void *__tls_get_addr(void *d)
5960
{
6061
abort();
@@ -65,3 +66,5 @@ __attribute__((weak)) void *___tls_get_addr(void *d)
6566
{
6667
abort();
6768
}
69+
70+
#endif

shared.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,20 @@ ifneq ($(TOOLCHAIN_BUILD),y)
6767

6868
install-shared: rootfs-install-shared-toolchain-libs install-shared-toolchain-libs
6969

70-
GLOBAL_SYSROOT := $$($(CC) --print-sysroot)
70+
TOOLCHAIN_LIBS_PATH := $(shell $(CC) --print-sysroot)/lib/$(MULTILIB_DIR)
7171

7272
rootfs-install-shared-toolchain-libs install-shared-toolchain-libs: TOOLCHAIN_LIBS_PATH := $(TOOLCHAIN_LIBS_PATH)
7373

7474

7575
# TODO: do not hardcode versions of libs
7676
rootfs-install-shared-toolchain-libs: $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)/$(REALNAME)
77-
$(SIL)cp $(GLOBAL_SYSROOT)/lib/libstdc++.so.6.28 $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)
78-
$(SIL)cp $(GLOBAL_SYSROOT)/lib/libgcc_s.so.1 $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)
77+
$(SIL)cp $(TOOLCHAIN_LIBS_PATH)/libstdc++.so.6.28 $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)
78+
$(SIL)cp $(TOOLCHAIN_LIBS_PATH)/libgcc_s.so.1 $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)
7979

8080

8181
install-shared-toolchain-libs: install-shared-libs
82-
$(SIL)ln -sf $(GLOBAL_SYSROOT)/lib/libstdc++.so.6.28 $(LIBC_INSTALL_DIR)
83-
$(SIL)ln -sf $(GLOBAL_SYSROOT)/lib/libgcc_s.so.1 $(LIBC_INSTALL_DIR)
82+
$(SIL)ln -sf $(TOOLCHAIN_LIBS_PATH)/libstdc++.so.6.28 $(LIBC_INSTALL_DIR)
83+
$(SIL)ln -sf $(TOOLCHAIN_LIBS_PATH)/libgcc_s.so.1 $(LIBC_INSTALL_DIR)
8484
$(SIL)(cd $(LIBC_INSTALL_DIR) && \
8585
ln -sf libstdc++.so.6.28 libstdc++.so.6 && ln -sf libstdc++.so.6.28 libstdc++.so && \
8686
ln -sf libgcc_s.so.1 libgcc_s.so \

0 commit comments

Comments
 (0)