IUCompilerCourse / public-student-support-code

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

-arch option unavailable on Linux systems #28

Closed joshuacrotts closed 1 year ago

joshuacrotts commented 1 year ago

The patch from using the -march flag to -arch in commit d732589 breaks compilation on Linux systems since -arch is only supported by Clang.

To fix, we can add a binding to compiler-tests-suite that removes the flag for non-MacOS ARM-based systems.

(let ([gcc-cmd (if (and (equal? (system-type 'os) 'macosx)
                        (equal? (system-type 'arch) 'aarch64))
                   "gcc -g -std=c99 -arch x86_64"
                   "gcc -g -std=c99")])
  (let ([gcc-output (system (format "~a runtime.o ./tests/~a.s -o ./tests/~a.out" gcc-cmd test-name test-name))])
    ...
jsiek commented 1 year ago

fixed, thanks!