Add support for runtime selection of float ABI

This commit is contained in:
Thomas Preud'homme
2014-01-07 15:23:54 +08:00
parent 70a088af87
commit b6247d1f3c
7 changed files with 114 additions and 71 deletions

21
tcc.h
View File

@ -221,21 +221,24 @@
# endif
# elif defined __GNU__
# define CONFIG_TCC_ELFINTERP "/lib/ld.so"
# elif defined TCC_ARM_HARDFLOAT
# define CONFIG_TCC_ELFINTERP "/lib/ld-linux-armhf.so.3"
# elif defined TCC_ARM_EABI
# define CONFIG_TCC_ELFINTERP "/lib/ld-linux.so.3"
# elif defined(TCC_TARGET_X86_64)
# define CONFIG_TCC_ELFINTERP "/lib64/ld-linux-x86-64.so.2"
# elif defined(TCC_UCLIBC)
# define CONFIG_TCC_ELFINTERP "/lib/ld-uClibc.so.0"
# elif defined(TCC_TARGET_PE)
# define CONFIG_TCC_ELFINTERP "-"
# else
# elif !defined(TCC_ARM_EABI)
# define CONFIG_TCC_ELFINTERP "/lib/ld-linux.so.2"
# endif
#endif
/* var elf_interp dans *-gen.c */
#ifdef CONFIG_TCC_ELFINTERP
# define DEFAULT_ELFINTERP(s) CONFIG_TCC_ELFINTERP
#else
# define DEFAULT_ELFINTERP(s) default_elfinterp(s)
#endif
/* library to use with CONFIG_USE_LIBGCC instead of libtcc1.a */
#define TCC_LIBGCC USE_MUADIR(CONFIG_SYSROOT "/" CONFIG_LDDIR) "/libgcc_s.so.1"
@ -561,6 +564,9 @@ struct TCCState {
/* compile with built-in memory and bounds checker */
int do_bounds_check;
#endif
#ifdef TCC_TARGET_ARM
enum float_abi float_abi; /* float ABI of the generated code*/
#endif
addr_t text_addr; /* address of text section */
int has_text_addr;
@ -1329,7 +1335,10 @@ ST_FUNC void gen_opl(int op);
/* ------------ arm-gen.c ------------ */
#ifdef TCC_TARGET_ARM
ST_FUNC void arm_init_types(void);
#ifdef TCC_ARM_EABI
ST_FUNC char *default_elfinterp(struct TCCState *s);
#endif
ST_FUNC void arm_init(struct TCCState *s);
ST_FUNC uint32_t encbranch(int pos, int addr, int fail);
ST_FUNC void gen_cvt_itof1(int t);
#endif