msp430-elf incorrect hwmult in newlib

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

msp430-elf incorrect hwmult in newlib

Peter Bigot-4
Unrelated to the issue of hard-coding MCUs, this one needs attention from
Red Hat:

The short version is newlib gets built with support only for a default
-mhwmult=16 which causes the MCU to reset when invoking strtoul in an
application targeting -mhwmult=f5series, because there is no MPY peripheral
at the addresses where the operands are written.  mhwmult needs to be one
of the features that distinguish multilib selection.

It'd also probably be better to make the default in msp430_output_labelref
select msp430_no_hwmult which will (at least theoretically) work on every

Confirmed present in today's trunk revisions of gcc, binutils, and newlib
using the build script at:

I'm working around it by defaulting gcc to select f5series since those are
the MCUs I'm developing with this week.


>From d6a368e5ca6cfbf7c99be1df07770779da2a5dc4 Mon Sep 17 00:00:00 2001
From: "Peter A. Bigot" <[hidden email]>
Date: Sat, 15 Nov 2014 21:11:12 -0600
Subject: [PATCH] HACK: msp430 use -mhwmult=auto select f5_series

Work around
 gcc/config/msp430/msp430.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c
index fe97f27..e4d20b2 100644
--- a/gcc/config/msp430/msp430.c
+++ b/gcc/config/msp430/msp430.c
@@ -2173,7 +2173,7 @@ msp430_use_f5_series_hwmult (void)
   static const char * cached_match = NULL;
   static bool         cached_result;

-  if (msp430_hwmult_type == F5SERIES)
+  if ((msp430_hwmult_type == F5SERIES) || (msp430_hwmult_type == AUTO))
     return true;

   if (target_mcu == NULL || msp430_hwmult_type != AUTO)

Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
Mspgcc-users mailing list
[hidden email]