This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
update ARM architectural HAL
- From: Bart Veer <bartv at ecoscentric dot com>
- To: ecos-patches at sourceware dot org
- Date: Mon, 02 Feb 2009 19:00:55 +0000
- Subject: update ARM architectural HAL
This patch adds two calculated options to the ARM architectural HAL,
one for compiler flags, another for linker flags. The architectural
already knows whether it is building for ARM or thumb, whether or not
interworking is enabled, and whether or not the build is big-endian.
The new options provide the corresponding flags which then get picked
up by the platform HALs, and they also impose constraints on the
global flags. That avoids problems if e.g. the user decides to enable
thumb mode by adding -mthumb to CFLAGS instead of by enabling
CYGHWR_THUMB.
Bart
Index: current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/arch/current/ChangeLog,v
retrieving revision 1.113
diff -u -p -r1.113 ChangeLog
--- current/ChangeLog 29 Jan 2009 17:48:55 -0000 1.113
+++ current/ChangeLog 2 Feb 2009 18:15:26 -0000
@@ -1,3 +1,8 @@
+2009-02-02 Bart Veer <bartv@ecoscentric.com>
+
+ * cdl/hal_arm.cdl: add new architectural CFLAGS and LDFLAGS
+ options.
+
2008-10-07 Jonathan Larmour <jifl@eCosCentric.com>
* src/arm.ld: Discard C++ EH-related sections when we can't
Index: current/cdl/hal_arm.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/arch/current/cdl/hal_arm.cdl,v
retrieving revision 1.18
diff -u -p -r1.18 hal_arm.cdl
--- current/cdl/hal_arm.cdl 29 Jan 2009 17:48:55 -0000 1.18
+++ current/cdl/hal_arm.cdl 2 Feb 2009 18:15:26 -0000
@@ -130,6 +130,44 @@ cdl_package CYGPKG_HAL_ARM {
Use the CPU in big-endian mode."
}
+ cdl_option CYGBLD_ARCH_CFLAGS {
+ display "Architecture-specific compiler flags"
+ parent CYGBLD_GLOBAL_OPTIONS
+ flavor data
+ no_define
+ calculated { (CYGHWR_THUMB ? "-mthumb " : "") .
+ (CYGBLD_ARM_ENABLE_THUMB_INTERWORK ? "-mthumb-interwork " : "-mno-thumb-interwork ") .
+ (CYGHWR_HAL_ARM_BIGENDIAN ? "-mbig-endian " : "")
+ }
+ requires { CYGHWR_THUMB implies is_substr(CYGBLD_GLOBAL_CFLAGS, "-mthumb ") }
+ requires { !CYGHWR_THUMB implies !is_substr(CYGBLD_GLOBAL_CFLAGS, "-mthumb ") }
+ requires { CYGBLD_ARM_ENABLE_THUMB_INTERWORK implies is_substr(CYGBLD_GLOBAL_CFLAGS, "-mthumb-interwork") }
+ requires { CYGBLD_ARM_ENABLE_THUMB_INTERWORK implies !is_substr(CYGBLD_GLOBAL_CFLAGS, "-mno-thumb-interwork") }
+ requires { !CYGBLD_ARM_ENABLE_THUMB_INTERWORK implies !is_substr(CYGBLD_GLOBAL_CFLAGS, "-mthumb-interwork") }
+ requires { !CYGBLD_ARM_ENABLE_THUMB_INTERWORK implies is_substr(CYGBLD_GLOBAL_CFLAGS, "-mno-thumb-interwork") }
+ requires { CYGHWR_HAL_ARM_BIGENDIAN implies is_substr(CYGBLD_GLOBAL_CFLAGS, "-mbig-endian") }
+ requires { !CYGHWR_HAL_ARM_BIGENDIAN implies !is_substr(CYGBLD_GLOBAL_CFLAGS, "-mbig-endian") }
+ }
+
+ cdl_option CYGBLD_ARCH_LDFLAGS {
+ display "Architecture-specific linker flags"
+ parent CYGBLD_GLOBAL_OPTIONS
+ flavor data
+ no_define
+ calculated { (CYGHWR_THUMB ? "-mthumb " : "") .
+ (CYGBLD_ARM_ENABLE_THUMB_INTERWORK ? "-mthumb-interwork " : "-mno-thumb-interwork ") .
+ (CYGHWR_HAL_ARM_BIGENDIAN ? "-mbig-endian " : "")
+ }
+ requires { CYGHWR_THUMB implies is_substr(CYGBLD_GLOBAL_LDFLAGS, "-mthumb ") }
+ requires { !CYGHWR_THUMB implies !is_substr(CYGBLD_GLOBAL_LDFLAGS, "-mthumb ") }
+ requires { CYGBLD_ARM_ENABLE_THUMB_INTERWORK implies is_substr(CYGBLD_GLOBAL_LDFLAGS, "-mthumb-interwork") }
+ requires { CYGBLD_ARM_ENABLE_THUMB_INTERWORK implies !is_substr(CYGBLD_GLOBAL_LDFLAGS, "-mno-thumb-interwork") }
+ requires { !CYGBLD_ARM_ENABLE_THUMB_INTERWORK implies !is_substr(CYGBLD_GLOBAL_LDFLAGS, "-mthumb-interwork") }
+ requires { !CYGBLD_ARM_ENABLE_THUMB_INTERWORK implies is_substr(CYGBLD_GLOBAL_LDFLAGS, "-mno-thumb-interwork") }
+ requires { CYGHWR_HAL_ARM_BIGENDIAN implies is_substr(CYGBLD_GLOBAL_LDFLAGS, "-mbig-endian") }
+ requires { !CYGHWR_HAL_ARM_BIGENDIAN implies !is_substr(CYGBLD_GLOBAL_LDFLAGS, "-mbig-endian") }
+ }
+
cdl_interface CYGINT_HAL_ARM_ARCH_ARM7 {
display "The platform uses a processor with an ARM7 core"
}