IUCompilerCourse / public-student-support-code

Public helper code for p423/p523 students (Racket)
MIT License
155 stars 74 forks source link

Add support for M1 Mac (ARM) #13

Open vjspranav opened 2 years ago

vjspranav commented 2 years ago

Having -march=x86-64 in utilities.rkt seems to be causing issue with aarch64 M1 architecture The error on running make-test: The clang compiler doesn't support "-march=-x86-64"

rundong08 commented 2 years ago

Here's a workaround: To compile the runtime.c file to get runtime.o:

cc -arch x86_64 -march=x86-64 -c runtime.c

And in utilities.rkt, add the -arch x86_64 option to the corresponding gcc call.

Note on M1 mac -march=x86-64 is only available when you use -arch x86_64 option.