Skip to content

Commit

Permalink
Add support for Mips.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcjm committed Jan 19, 2016
1 parent 72a1c60 commit 468c0b5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,9 @@
/* Define if the host is Itanium */
#undef HOSTARCHITECTURE_IA64

/* Define if the host is Mips (32-bit) */
#undef HOSTARCHITECTURE_MIPS

/* Define if the host is a Power PC (32 bit) */
#undef HOSTARCHITECTURE_PPC

Expand Down
6 changes: 6 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -21811,6 +21811,12 @@ $as_echo "#define HOSTARCHITECTURE_IA64 1" >>confdefs.h

polyarch=interpret
;;
mips)

$as_echo "#define HOSTARCHITECTURE_MIPS 1" >>confdefs.h

polyarch=interpret
;;
*) as_fn_error $? "Poly/ML is not supported for this architecture" "$LINENO" 5 ;;
esac

Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,10 @@ case "${host_cpu}" in
AC_DEFINE([HOSTARCHITECTURE_IA64], [1], [Define if the host is Itanium])
polyarch=interpret
;;
mips)
AC_DEFINE([HOSTARCHITECTURE_MIPS], [1], [Define if the host is Mips (32-bit)])
polyarch=interpret
;;
*) AC_MSG_ERROR([Poly/ML is not supported for this architecture]) ;;
esac

Expand Down
4 changes: 4 additions & 0 deletions libpolyml/elfexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ void ELFExport::exportStore(void)
fhdr.e_machine = EM_AARCH64;
directReloc = R_AARCH64_ABS64;
useRela = true;
#elif defined(HOSTARCHITECTURE_MIPS)
fhdr.e_machine = EM_MIPS;
directReloc = R_MIPS_32;
useRela = true;
#else
#error "No support for exporting on this architecture"
#endif
Expand Down

0 comments on commit 468c0b5

Please sign in to comment.