summaryrefslogtreecommitdiff
path: root/src/SDCCglue.c
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2019-10-23 03:57:38 +0200
committerXavier ASUS <xavi92psx@gmail.com>2019-10-23 03:57:38 +0200
commit9c47d08e98953623ceac02c8422863e593deb40e (patch)
tree69c881d20ac0bc878bdd91da8dc2e668374a3dbc /src/SDCCglue.c
parent4df948b3c184864525e7fa7e26ab380a70d644cd (diff)
downloadsdcc-gas-9c47d08e98953623ceac02c8422863e593deb40e.tar.gz
Implemented -c support for --gas
STM8 code generator was generating some instructions in a "ld register, (#%d, register)" way, causing assembling errors on stm8-as. This is because stm8-as does not require the '#' character. A quick and dirty workaround has been implemented for this. Added new warning W_IGNORED_OPT_IN_ASM, which warns the user when both "--no-optsdcc-in-asm" and "--gas" are used (the first is ignored when the latter is active since GNU as does not accept the .optsdcc directive, as opposed to asxxx).
Diffstat (limited to 'src/SDCCglue.c')
-rw-r--r--src/SDCCglue.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/SDCCglue.c b/src/SDCCglue.c
index dfb988b..d584303 100644
--- a/src/SDCCglue.c
+++ b/src/SDCCglue.c
@@ -2357,8 +2357,10 @@ glue (void)
tfprintf (asmFile, "\t!module\n", moduleName);
if (mcs51_like)
{
- if(!options.noOptsdccInAsm)
+ if(!options.noOptsdccInAsm && !options.gasOutput)
fprintf (asmFile, "\t.optsdcc -m%s", port->target);
+ else if (options.gasOutput && options.noOptsdccInAsm)
+ werror(W_IGNORED_OPT_IN_ASM);
switch (options.model)
{
@@ -2398,8 +2400,11 @@ glue (void)
}
else if (!TARGET_PIC_LIKE && !options.noOptsdccInAsm)
{
- fprintf (asmFile, "\t.optsdcc -m%s\n", port->target);
+ if(!options.gasOutput)
+ fprintf (asmFile, "\t.optsdcc -m%s", port->target);
}
+ else if (options.noOptsdccInAsm && options.gasOutput)
+ werror(W_IGNORED_OPT_IN_ASM);
tfprintf (asmFile, "\t!fileprelude\n");