Skip to content

Commit e38ba1e

Browse files
committed
fixes for building on ARM
1 parent e6c5ef1 commit e38ba1e

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@
2424

2525

2626
CC ?= clang
27-
CFLAGS = $(CDEFS) -std=c11 -g0 -Ofast -mssse3 -fstrict-aliasing -ffast-math -Wno-parentheses
27+
28+
.if $(MACHINE) == "i386" || $(MACHINE) == "amd64" || $(MACHINE) == "x86_64"
29+
CFLAGS = $(CDEFS) -march=native -mssse3 -ffast-math
30+
.elif $(MACHINE) == "arm"
31+
CFLAGS = $(CDEFS) -fsigned-char
32+
.else
33+
CFLAGS = $(CDEFS)
34+
.endif
35+
36+
CFLAGS += -std=c11 -g0 -Ofast -fstrict-aliasing -Wno-parentheses
2837
PREFIX ?= /usr/local
2938

3039
HEADERS = binutils.h store.h

binutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void deallocate(void **p, bool cleanout)
141141
}
142142
}
143143

144-
void deallocate_batch(bool cleanout, ...)
144+
void deallocate_batch(unsigned cleanout, ...)
145145
{
146146
void **p;
147147
va_list vl;

binutils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ typedef long long llong;
412412
k = (int)strlen(src);
413413

414414
if (!m)
415-
n = k;
415+
n = m = k;
416416
else
417417
n = (k < m) ? k : m-1;
418418

@@ -497,4 +497,4 @@ extern ssize_t gAllocationTotal;
497497
void *allocate(ssize_t size, bool cleanout);
498498
void *reallocate(void *p, ssize_t size, bool cleanout, bool free_on_error);
499499
void deallocate(void **p, bool cleanout);
500-
void deallocate_batch(bool cleanout, ...);
500+
void deallocate_batch(unsigned cleanout, ...);

0 commit comments

Comments
 (0)