From 3ae1586d3ffc7dc2e093dfb963fb7bf0c6826b1a Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Tue, 23 Jun 2026 21:08:15 +0200 Subject: [PATCH 1/4] Add tool prefix to symbols when compiling with the fil-c memory checker --- Makefile.system | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.system b/Makefile.system index 095608e83a..92665abe95 100644 --- a/Makefile.system +++ b/Makefile.system @@ -1648,7 +1648,11 @@ ifneq ($(C_COMPILER), SUN) CCOMMON_OPT += -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME endif endif +ifeq (,findstring pizfix,$(CEXTRALIB)) CCOMMON_OPT += -DASMNAME=$(FU)$(*F) -DASMFNAME=$(FU)$(*F)$(BU) -DNAME=$(*F)$(BU) -DCNAME=$(*F) -DCHAR_NAME=\"$(*F)$(BU)\" -DCHAR_CNAME=\"$(*F)\" +else +CCOMMON_OPT += -DASMNAME=$(FU)pizlonated_$(*F) -DASMFNAME=$(FU)pizlonated_$(*F)$(BU) -DNAME=$(*F)$(BU) -DCNAME=$(*F) -DCHAR_NAME=\"$(*F)$(BU)\" -DCHAR_CNAME=\"$(*F)\" +endif ifeq ($(CORE), PPC440) CCOMMON_OPT += -DALLOC_QALLOC From 08c8c1051f0b6f022ea21515543aa7f4c2abb228 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Tue, 23 Jun 2026 21:12:07 +0200 Subject: [PATCH 2/4] fil-c memory safety checker doesn't support syscall 237 (mbind) yet --- common_linux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common_linux.h b/common_linux.h index 5a1c4e1508..83111d2069 100644 --- a/common_linux.h +++ b/common_linux.h @@ -70,7 +70,7 @@ extern long int syscall (long int __sysno, ...); static inline int my_mbind(void *addr, unsigned long len, int mode, unsigned long *nodemask, unsigned long maxnode, unsigned flags) { -#if defined (__LSB_VERSION__) || defined(ARCH_ZARCH) +#if defined (__LSB_VERSION__) || defined(ARCH_ZARCH) || defined(__PIZLONATOR_WAS_HERE__) // So far, LSB (Linux Standard Base) don't support syscall(). // https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3482 return 0; From afcba13127baae7bf454f7088f4b9aaa195362aa Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Tue, 23 Jun 2026 21:14:39 +0200 Subject: [PATCH 3/4] Use atomic_exchange builtin for spinlock with fil-c, add cc clobber to quickdivide --- common_x86_64.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common_x86_64.h b/common_x86_64.h index 143e188a79..f3e936174c 100644 --- a/common_x86_64.h +++ b/common_x86_64.h @@ -83,11 +83,15 @@ static __inline void blas_lock(volatile BLASULONG *address){ while (*address) {YIELDING;} #ifndef C_MSVC +#ifdef __PIZLONATOR_WAS_HERE__ + ret=__atomic_exchange_n(address, 1, __ATOMIC_SEQ_CST); +#else __asm__ __volatile__( "xchgl %0, %1\n" : "=r"(ret), "=m"(*address) : "0"(1), "m"(*address) : "memory"); +#endif #else ret=InterlockedExchange64((volatile LONG64 *)(address), 1); #endif @@ -237,7 +241,7 @@ static __inline unsigned int blas_quickdivide(unsigned int x, unsigned int y){ y = blas_quick_divide_table[y]; - __asm__ __volatile__ ("mull %0" :"=d" (result), "+a"(x) : "0" (y)); + __asm__ __volatile__ ("mull %0" :"=d" (result), "+a"(x) : "0" (y) : "cc"); return result; } #endif From aae00921a94d0e87e746240814d09fc166fedb2a Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Wed, 24 Jun 2026 00:19:32 +0200 Subject: [PATCH 4/4] Fix conditional --- Makefile.system | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.system b/Makefile.system index 92665abe95..635b3d660f 100644 --- a/Makefile.system +++ b/Makefile.system @@ -1648,7 +1648,7 @@ ifneq ($(C_COMPILER), SUN) CCOMMON_OPT += -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME endif endif -ifeq (,findstring pizfix,$(CEXTRALIB)) +ifeq ( ,$(findstring pizfix,$(CEXTRALIB))) CCOMMON_OPT += -DASMNAME=$(FU)$(*F) -DASMFNAME=$(FU)$(*F)$(BU) -DNAME=$(*F)$(BU) -DCNAME=$(*F) -DCHAR_NAME=\"$(*F)$(BU)\" -DCHAR_CNAME=\"$(*F)\" else CCOMMON_OPT += -DASMNAME=$(FU)pizlonated_$(*F) -DASMFNAME=$(FU)pizlonated_$(*F)$(BU) -DNAME=$(*F)$(BU) -DCNAME=$(*F) -DCHAR_NAME=\"$(*F)$(BU)\" -DCHAR_CNAME=\"$(*F)\"