Skip to content

Commit dd3ba97

Browse files
authored
Merge pull request #5845 from martin-frbg/pizlonator-filc
Add support for compiling with the Fil-C Memory Safe C toolchain
2 parents b997290 + aae0092 commit dd3ba97

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

Makefile.system

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,11 @@ ifneq ($(C_COMPILER), SUN)
16481648
CCOMMON_OPT += -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME
16491649
endif
16501650
endif
1651+
ifeq ( ,$(findstring pizfix,$(CEXTRALIB)))
16511652
CCOMMON_OPT += -DASMNAME=$(FU)$(*F) -DASMFNAME=$(FU)$(*F)$(BU) -DNAME=$(*F)$(BU) -DCNAME=$(*F) -DCHAR_NAME=\"$(*F)$(BU)\" -DCHAR_CNAME=\"$(*F)\"
1653+
else
1654+
CCOMMON_OPT += -DASMNAME=$(FU)pizlonated_$(*F) -DASMFNAME=$(FU)pizlonated_$(*F)$(BU) -DNAME=$(*F)$(BU) -DCNAME=$(*F) -DCHAR_NAME=\"$(*F)$(BU)\" -DCHAR_CNAME=\"$(*F)\"
1655+
endif
16521656

16531657
ifeq ($(CORE), PPC440)
16541658
CCOMMON_OPT += -DALLOC_QALLOC

common_linux.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ extern long int syscall (long int __sysno, ...);
7070
static inline int my_mbind(void *addr, unsigned long len, int mode,
7171
unsigned long *nodemask, unsigned long maxnode,
7272
unsigned flags) {
73-
#if defined (__LSB_VERSION__) || defined(ARCH_ZARCH)
73+
#if defined (__LSB_VERSION__) || defined(ARCH_ZARCH) || defined(__PIZLONATOR_WAS_HERE__)
7474
// So far, LSB (Linux Standard Base) don't support syscall().
7575
// https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3482
7676
return 0;

common_x86_64.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,15 @@ static __inline void blas_lock(volatile BLASULONG *address){
8383
while (*address) {YIELDING;}
8484

8585
#ifndef C_MSVC
86+
#ifdef __PIZLONATOR_WAS_HERE__
87+
ret=__atomic_exchange_n(address, 1, __ATOMIC_SEQ_CST);
88+
#else
8689
__asm__ __volatile__(
8790
"xchgl %0, %1\n"
8891
: "=r"(ret), "=m"(*address)
8992
: "0"(1), "m"(*address)
9093
: "memory");
94+
#endif
9195
#else
9296
ret=InterlockedExchange64((volatile LONG64 *)(address), 1);
9397
#endif
@@ -237,7 +241,7 @@ static __inline unsigned int blas_quickdivide(unsigned int x, unsigned int y){
237241

238242
y = blas_quick_divide_table[y];
239243

240-
__asm__ __volatile__ ("mull %0" :"=d" (result), "+a"(x) : "0" (y));
244+
__asm__ __volatile__ ("mull %0" :"=d" (result), "+a"(x) : "0" (y) : "cc");
241245
return result;
242246
}
243247
#endif

0 commit comments

Comments
 (0)