Skip to content

Commit d95103a

Browse files
committed
We can't get the function name on armv7l, sadly
1 parent e64d3e2 commit d95103a

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/libblastrampoline.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ int32_t find_symbol_idx(const char * name) {
2222
// This function un-smuggles our name index from the scratch register it was placed
2323
// into by the trampoline; We really need this to be the first thing `lbt_default_func_print_error()`
2424
// calls, so that our temporary register doesn't get clobbered by other code.
25-
__attribute__((always_inline)) inline unsigned int get_forward_name_idx() {
25+
__attribute__((always_inline)) inline uintptr_t get_forward_name_idx() {
2626
uintptr_t idx;
2727
#if defined(ARCH_aarch64)
2828
asm("\t mov %0,x17" : "=r"(idx));
2929
#elif defined(ARCH_arm)
30-
asm("\t mov %%r12,%0" : "=r"(idx));
30+
// armv7l only has a single volatile register for use, which is already in use
31+
// to calculate the jump target, so we can't smuggle the information out. :(
32+
return ((uintptr_t)-1);
3133
#elif defined(ARCH_i686)
3234
asm("\t mov %%eax,%0" : "=r"(idx));
3335
#elif defined(ARCH_powerpc64le)

src/trampolines/trampolines_arm.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
.cfi_startproc; \
77
MANGLE(UNDERSCORE(name))##:; \
88
ldr ip, CONCAT(.L,NAMEADDR(name)); \
9-
ldr r12,=#SYMBOL_IDX(idx); \
109
CONCAT(.L,MANGLE(UNDERSCORE(name))): ;\
1110
add ip, pc, ip; \
1211
ldr pc, [ip]; \
1312
.align 2; \
1413
CONCAT(.L,NAMEADDR(name))##: ; \
1514
.word NAMEADDR(name)##-(CONCAT(.L,MANGLE(UNDERSCORE(name))) + 8); \
1615
.cfi_endproc; \
17-
.ltorg; \
1816

1917
// Generate both `dgemm_` and `dgemm_64_`
2018
#include "ilp64_doubling.h"

test/direct.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ end
203203
Base.Libc.flush_cstdio();
204204
end
205205
close(io.in)
206-
@test chomp(String(read(io))) == "Error: no BLAS/LAPACK library loaded for cblas_sbstobf16()\nError: no BLAS/LAPACK library loaded for cblas_sbstobf1664_()"
206+
if Sys.ARCH != :arm
207+
@test chomp(String(read(io))) == "Error: no BLAS/LAPACK library loaded for cblas_sbstobf16()\nError: no BLAS/LAPACK library loaded for cblas_sbstobf1664_()"
208+
else
209+
@test chomp(String(read(io))) == "Error: no BLAS/LAPACK library loaded for (unknown function)\nError: no BLAS/LAPACK library loaded for (unknown function)"
210+
end
207211

208212
# Override the default function to keep track of people who try to call uninitialized BLAS functions
209213
@test lbt_get_default_func(lbt_handle) != C_NULL

0 commit comments

Comments
 (0)