diff --git a/doc/cl65.sgml b/doc/cl65.sgml
index 2a3e61828..b83cd96f3 100644
--- a/doc/cl65.sgml
+++ b/doc/cl65.sgml
@@ -103,6 +103,7 @@ Long options:
--memory-model model Set the memory model
--module Link as a module
--module-id id Specify a module id for the linker
+ --no-rtl Don't link default runtime library
--o65-model model Override the o65 model
--obj file Link this object file
--obj-path path Specify an object file search path
@@ -185,6 +186,11 @@ There are a few remaining options that control the behaviour of cl65:
seem to use cc65 to develop for the C64.
+ --no-rtl
+
+ This option disables default runtime library of target system.
+
+
-Wa options, --asm-args options
Pass options directly to the assembler. This may be used to pass options
diff --git a/src/cl65/main.c b/src/cl65/main.c
index 118acfb03..1e64af787 100644
--- a/src/cl65/main.c
+++ b/src/cl65/main.c
@@ -139,6 +139,7 @@ static int Module = 0;
/* Name of the target specific runtime library */
static char* TargetLib = 0;
+static int NoRTL = 0;
@@ -414,6 +415,12 @@ static void SetTargetFiles (void)
const char* TargetName = GetTargetName (Target);
unsigned TargetNameLen = strlen (TargetName);
+ if (NoRTL)
+ {
+ /* Default RunTime Library is disabled */
+ return;
+ }
+
/* Set the library file */
TargetLib = xmalloc (TargetNameLen + 4 + 1);
memcpy (TargetLib, TargetName, TargetNameLen);
@@ -812,6 +819,7 @@ static void Usage (void)
" --memory-model model\t\tSet the memory model\n"
" --module\t\t\tLink as a module\n"
" --module-id id\t\tSpecify a module ID for the linker\n"
+ " --no-rtl\t\t\tDon't link default runtime library\n"
" --o65-model model\t\tOverride the o65 model\n"
" --obj file\t\t\tLink this object file\n"
" --obj-path path\t\tSpecify an object file search path\n"
@@ -1167,6 +1175,15 @@ static void OptModuleId (const char* Opt attribute ((unused)), const char* Arg)
+static void OptNoRTL (const char* Opt attribute ((unused)),
+ const char* Arg attribute ((unused)))
+/* Disable default runtime library */
+{
+ NoRTL = 1;
+}
+
+
+
static void OptO65Model (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --o65-model option */
{
@@ -1369,6 +1386,7 @@ int main (int argc, char* argv [])
{ "--memory-model", 1, OptMemoryModel },
{ "--module", 0, OptModule },
{ "--module-id", 1, OptModuleId },
+ { "--no-rtl", 0, OptNoRTL },
{ "--o65-model", 1, OptO65Model },
{ "--obj", 1, OptObj },
{ "--obj-path", 1, OptObjPath },