aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--LICENSE19
-rw-r--r--README.md23
-rw-r--r--main.c3
3 files changed, 45 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..666ea7a
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2025 lsof
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..895dd15
--- /dev/null
+++ b/README.md
@@ -0,0 +1,23 @@
+`antcc` is a C compiler using its own custom backend. Currently still in a
+experimental stage.
+
+# Supported targets
+
+- For now just x86-64 POSIX (Sys-V + ELF). Only tested on linux so far.
+
+# Building
+
+```
+make # outputs ./antcc executable
+# or
+make opt #compile with optimizations
+# or
+make dbg #compile with UBsan and Asan
+```
+
+
+# Usage
+
+The driver is still incomplete but it mimics that of compilers like gcc.
+`antcc` compiles translation units to object files directly, but the driver
+will invoke an external linker command to output an executable if `-c` isn't passed.
diff --git a/main.c b/main.c
index a51eae2..7335dd3 100644
--- a/main.c
+++ b/main.c
@@ -132,6 +132,7 @@ optparse(char **args)
else if (args[1]) task.out = *++args;
else goto Bad;
} else if (*arg == 'f') {
+ /* -fabc / -fno-abc flags */
const char *flag = arg+1;
bool set = 1;
if (!strncmp(flag, "no-", 3)) {
@@ -295,6 +296,8 @@ prihelp(void)
" -o <file> \tPlace the output into <file>\n"
" -v \tVerbose output\n"
" -c \tEmit object file but do not link\n"
+ " -fpie \tEmit code for position independent executable\n"
+ " -fpic \tEmit position independent code\n"
);
}