diff options
| author | Shagun Agrawal <agrawalshagun07@gmail.com> | 2024-07-30 22:47:33 +0530 |
|---|---|---|
| committer | Shagun Agrawal <agrawalshagun07@gmail.com> | 2024-07-30 22:47:33 +0530 |
| commit | b1457b664b6e6d5933297c79a7d0497c5db311ac (patch) | |
| tree | 6b7b7ca580b1824c4de8cb8e7454d9c74787ecb7 | |
| parent | 30f2e3d8008d52cdccd6dcc5ba5c602079469f49 (diff) | |
Fix linux specific compilation bug
Add the line which specifies linux does not need executable stack at the
end.
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | src/cljcc/compiler.clj | 4 | ||||
| -rw-r--r-- | src/cljcc/driver.clj | 2 |
3 files changed, 5 insertions, 2 deletions
@@ -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" {}) ,) |
