aboutsummaryrefslogtreecommitdiff
path: root/arm-asm.c
diff options
context:
space:
mode:
authorgrischka <grischka>2017-02-23 08:41:57 +0100
committergrischka <grischka>2017-02-23 08:41:57 +0100
commit569255e6c40f45a0d78b409c05353d4c1de6ca43 (patch)
tree5ec1e51fe2a233d74d5570af8fb62ac41fd25989 /arm-asm.c
parent576bee9a37cbe53227a27308a1b8ccc25e9b0e35 (diff)
downloadtinycc-569255e6c40f45a0d78b409c05353d4c1de6ca43.tar.gz
tinycc-569255e6c40f45a0d78b409c05353d4c1de6ca43.tar.bz2
cross-compilers: allow individual configuration
since configure supports only native configuration a file 'cross-tcc.mak' needs to be created manually. It is included in the Makefile if present. # ---------------------------------------------------- # Example config-cross.mak: # # windows -> i386-linux cross-compiler # (it expects the linux files in <prefix>/i386-linux) ROOT-i386 = {B}/i386-linux CRT-i386 = $(ROOT-i386)/usr/lib LIB-i386 = $(ROOT-i386)/lib:$(ROOT-i386)/usr/lib INC-i386 = {B}/lib/include:$(ROOT-i386)/usr/include DEF-i386 += -D__linux__ # ---------------------------------------------------- Also: - use libtcc1-<target>.a instead of directories - add dummy arm assembler - remove include dependencies from armeabi.c/lib-arm64.c - tccelf/ld_add_file: add SYSROOT (when defined) to absolute filenames coming from ld-scripts
Diffstat (limited to 'arm-asm.c')
-rw-r--r--arm-asm.c83
1 files changed, 83 insertions, 0 deletions
diff --git a/arm-asm.c b/arm-asm.c
new file mode 100644
index 0000000..5840cde
--- /dev/null
+++ b/arm-asm.c
@@ -0,0 +1,83 @@
+/*************************************************************/
+/*
+ * ARM dummy assembler for TCC
+ *
+ */
+
+#ifdef TARGET_DEFS_ONLY
+
+#define CONFIG_TCC_ASM
+#define NB_ASM_REGS 16
+
+ST_FUNC void g(int c);
+ST_FUNC void gen_le16(int c);
+ST_FUNC void gen_le32(int c);
+
+/*************************************************************/
+#else
+/*************************************************************/
+
+/* XXX: make it faster ? */
+ST_FUNC void g(int c)
+{
+ int ind1;
+ if (nocode_wanted)
+ return;
+ ind1 = ind + 1;
+ if (ind1 > cur_text_section->data_allocated)
+ section_realloc(cur_text_section, ind1);
+ cur_text_section->data[ind] = c;
+ ind = ind1;
+}
+
+ST_FUNC void gen_le16 (int i)
+{
+ g(i);
+ g(i>>8);
+}
+
+ST_FUNC void gen_le32 (int i)
+{
+ gen_le16(i);
+ gen_le16(i>>16);
+}
+
+ST_FUNC void gen_expr32(ExprValue *pe)
+{
+ gen_le32(pe->v);
+}
+
+ST_FUNC void asm_opcode(TCCState *s1, int opcode)
+{
+}
+
+ST_FUNC void subst_asm_operand(CString *add_str, SValue *sv, int modifier)
+{
+}
+
+/* generate prolog and epilog code for asm statement */
+ST_FUNC void asm_gen_code(ASMOperand *operands, int nb_operands,
+ int nb_outputs, int is_output,
+ uint8_t *clobber_regs,
+ int out_reg)
+{
+}
+
+ST_FUNC void asm_compute_constraints(ASMOperand *operands,
+ int nb_operands, int nb_outputs,
+ const uint8_t *clobber_regs,
+ int *pout_reg)
+{
+}
+
+ST_FUNC void asm_clobber(uint8_t *clobber_regs, const char *str)
+{
+}
+
+ST_FUNC int asm_parse_regvar (int t)
+{
+ return -1;
+}
+
+/*************************************************************/
+#endif /* ndef TARGET_DEFS_ONLY */