From b1457b664b6e6d5933297c79a7d0497c5db311ac Mon Sep 17 00:00:00 2001 From: Shagun Agrawal Date: Tue, 30 Jul 2024 22:47:33 +0530 Subject: Fix linux specific compilation bug Add the line which specifies linux does not need executable stack at the end. --- .gitignore | 1 + src/cljcc/compiler.clj | 4 +++- src/cljcc/driver.clj | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1548a67..e6d2d5b 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ *.jar *.swp *~ +/test-programs /checkouts /classes /target diff --git a/src/cljcc/compiler.clj b/src/cljcc/compiler.clj index 6a4d13d..9e0a9a4 100644 --- a/src/cljcc/compiler.clj +++ b/src/cljcc/compiler.clj @@ -54,9 +54,11 @@ (defn il->assembly [il] (let [fn-assembly (emit-function-assembly (first il))] (if (= :linux (get-os)) - (conj fn-assembly linux-assembly-end) + (concat fn-assembly [linux-assembly-end]) fn-assembly))) +(conj [1 2 3] 1) + (defn join-assembly [assembly-lines] (str/join "\n" assembly-lines)) diff --git a/src/cljcc/driver.clj b/src/cljcc/driver.clj index ad9c3a4..e3c4822 100644 --- a/src/cljcc/driver.clj +++ b/src/cljcc/driver.clj @@ -91,6 +91,6 @@ (comment - (run "/Users/shagunagrawal/Development/c_tests/ex3.c" {}) + (run "./test-programs/ex1.c" {}) ,) -- cgit v1.2.3