-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AppleM1: Support Apple Silicon M1(aarch64), #30
- Loading branch information
Showing
14 changed files
with
284 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
.PHONY: default clean pre | ||
.PHONY: default clean | ||
|
||
CFLAGS=-g -O0 | ||
|
||
default: ./jmpbuf pre | ||
OS_NAME = $(shell uname -s) | ||
ST_TARGET = linux-debug | ||
ifeq ($(OS_NAME), Darwin) | ||
ST_TARGET = darwin-debug | ||
CPU_ARCHS = $(shell g++ -dM -E - </dev/null |grep -q '__x86_64' && echo x86_64) | ||
CPU_ARCHS += $(shell g++ -dM -E - </dev/null |grep -q '__aarch64' && echo arm64) | ||
CFLAGS += -arch $(CPU_ARCHS) | ||
endif | ||
|
||
default: ./jmpbuf ./jmpbuf.E.c | ||
|
||
./jmpbuf: jmpbuf.c | ||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -o $@ $^ $(LDLIBS) | ||
|
||
pre: jmpbuf.c | ||
./jmpbuf.E.c: jmpbuf.c | ||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -E -o jmpbuf.E.c $^ $(LDLIBS) | ||
|
||
clean: | ||
rm -f jmpbuf jmpbuf.E.c | ||
rm -rf jmpbuf jmpbuf.E.c jmpbuf.dSYM | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pcs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.PHONY: clean | ||
|
||
CFLAGS=-g -O0 | ||
|
||
OS_NAME = $(shell uname -s) | ||
ST_TARGET = linux-debug | ||
ifeq ($(OS_NAME), Darwin) | ||
ST_TARGET = darwin-debug | ||
CPU_ARCHS = $(shell g++ -dM -E - </dev/null |grep -q '__x86_64' && echo x86_64) | ||
CPU_ARCHS += $(shell g++ -dM -E - </dev/null |grep -q '__aarch64' && echo arm64) | ||
CFLAGS += -arch $(CPU_ARCHS) | ||
endif | ||
|
||
./pcs: pcs.c | ||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -o $@ $^ $(LDLIBS) | ||
|
||
clean: | ||
rm -rf pcs pcs.dSYM | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* SPDX-License-Identifier: MIT */ | ||
/* Copyright (c) 2022 Winlin */ | ||
|
||
void foo() { | ||
} | ||
|
||
void foo2(char a) { | ||
} | ||
|
||
void foo3(int a) { | ||
} | ||
|
||
void foo4(long a) { | ||
} | ||
|
||
void foo5(long long a) { | ||
} | ||
|
||
long foo6(long a) { | ||
return a + 1; | ||
} | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
foo(); | ||
foo2('s'); | ||
foo3(0x7); | ||
foo4(0x7); | ||
foo5(0x7); | ||
foo6(0x7); | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
stack | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.PHONY: clean | ||
|
||
CFLAGS=-g -O0 | ||
|
||
OS_NAME = $(shell uname -s) | ||
ST_TARGET = linux-debug | ||
ifeq ($(OS_NAME), Darwin) | ||
ST_TARGET = darwin-debug | ||
CPU_ARCHS = $(shell g++ -dM -E - </dev/null |grep -q '__x86_64' && echo x86_64) | ||
CPU_ARCHS += $(shell g++ -dM -E - </dev/null |grep -q '__aarch64' && echo arm64) | ||
CFLAGS += -arch $(CPU_ARCHS) | ||
endif | ||
|
||
./stack: stack.c | ||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -o $@ $^ $(LDLIBS) | ||
|
||
clean: | ||
rm -rf stack stack.dSYM | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* SPDX-License-Identifier: MIT */ | ||
/* Copyright (c) 2022 Winlin */ | ||
|
||
long foo() { | ||
char c; | ||
int i; | ||
long l; | ||
long long ll; | ||
return c + i + l + ll; | ||
} | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
foo(); | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters