+2013-12-18 Vladimir Serbinenko <phcoder@gmail.com>
+
+ Allow compilation without thumb-interwork as long as no thumb is
+ involved or only thumb2 is used.
+
2013-12-18 Vladimir Serbinenko <phcoder@gmail.com>
Use -Wl,--no-relax rather than -mno-relax for uniformity.
much bigger binaries.
earlier versions not tested
Note: clang 3.2 or later works for arm
+ None of tested clang versions generated usable thumb code
earlier versions not tested
Note: clang 3.3 or later works for arm64
earlier versions have no arm64 support
LDFLAGS_PLATFORM = -Wl,--no-relax
endif
if COND_arm
- CFLAGS_PLATFORM += -mthumb-interwork
- CCASFLAGS_PLATFORM = -mthumb-interwork
if !COND_emu
LDFLAGS_PLATFORM = -Wl,--wrap=__clear_cache
endif
if test "x$grub_cv_cc_mlong_calls" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -mlong-calls"
fi
+ AC_CACHE_CHECK([whether option -mthumb-interwork works], grub_cv_cc_mthumb_interwork, [
+ CFLAGS="$TARGET_CFLAGS -mthumb-interwork -Werror"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+ [grub_cv_cc_mthumb_interwork=yes],
+ [grub_cv_cc_mthumb_interwork=no])
+ ])
+ if test "x$grub_cv_cc_mthumb_interwork" = xyes; then
+ TARGET_CFLAGS="$TARGET_CFLAGS -mthumb-interwork"
+ elif test "x$grub_cv_cc_target_clang" = xno ; then
+ AC_MSG_ERROR([your compiler doesn't support -mthumb-interwork])
+ else
+ CFLAGS="$TARGET_CFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+#if defined (__thumb__) && !defined (__thumb2__)
+#error thumb without interworking
+#endif
+]])],
+ [no_interwork_ok=yes],
+ [no_interwork_ok=no])
+ if test x$no_interwork_ok = xno ; then
+ AC_MSG_ERROR([attempt to compile to thumb with no thumb interwork])
+ fi
+ fi
fi
#