#2219 closed defect (fixed)

sha512 compile issue on m32c/m32csim

Reported by: Joel Sherrill Owned by: Sebastian Huber
Priority: normal Milestone: 4.11
Component: unspecified Version: 4.11
Severity: blocker Keywords:
Cc: Blocked By:
Blocking:

Description

The m32c has a 24 bit address space but only a 16 bit size_t. This results in it not being able to index large arrays. I suspect this is part of the problem with the failure in sha512. But the warnings indicate a more fundamental 16/32 bit coding issue.

I propose the issue for the warnings get fixed and then sha512 disabled for m32c.

m32c-rtems4.11-gcc --pipe -DHAVE_CONFIG_H -I.. -I../../cpukit/../../../m32csim
/lib/include -mcpu=m32cm -O0 -g -Wall -Wmissing-prototypes -Wimplicit-function
-declaration -Wstrict-prototypes -Wnested-externs -MT libmd_a-sha512c.o -MD -MP

-MF .deps/libmd_a-sha512c.Tpo -c -o libmd_a-sha512c.o `test -f 'sha512c.c'
ec

ho '../../../../../../rtems/c/src/../../cpukit/libmd/'`sha512c.c
In file included from ../../../../../../rtems/c/src/../../cpukit/libmd/sha512c.c
:30:0:
../../cpukit/../../../m32csim/lib/include/sys/endian.h: In function 'be32dec':
../../cpukit/../../../m32csim/lib/include/sys/endian.h:102:2: warning: left shif
t count >= width of type [enabled by default]

return (((unsigned)p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);

../../cpukit/../../../m32csim/lib/include/sys/endian.h:102:2: warning: left shif
t count >= width of type [enabled by default]
../../cpukit/../../../m32csim/lib/include/sys/endian.h: In function 'le32dec':
../../cpukit/../../../m32csim/lib/include/sys/endian.h:126:2: warning: left shif
t count >= width of type [enabled by default]

return (((unsigned)p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]);

../../cpukit/../../../m32csim/lib/include/sys/endian.h:126:2: warning: left shift count >= width of type [enabled by default]
{standard input}: Assembler messages:
{standard input}:13: Error: dsp:16 immediate is out of range `add.l #-44060,sp'

Change History (5)

comment:1 Changed on Dec 15, 2014 at 7:33:30 AM by Sebastian Huber

I fixed the problems in <sys/endian.h>, but we still have a compiler error. I guess the used stack space is too big. I hesitate to add a #if !defined(m32c) to this file, are there alternatives, e.g. a Autoconf check?

Are there really 16-bit target RTEMS users?

comment:2 Changed on Dec 18, 2014 at 9:13:15 AM by Sebastian Huber

Priority: highestnormal

comment:3 Changed on Mar 4, 2015 at 10:00:12 PM by Gedare Bloom

You could do something like what is done for libdl in cpukit/configure.ac. Or you could fix the stack use problem. I didn't compile it myself, but I'd guess the uint64_t W[80] could be a problem since that is almost 1K itself.

comment:4 Changed on Mar 5, 2015 at 10:36:00 AM by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: newclosed

In 77510c72dc2c49c2ade13caada77efb18a1adeb8/rtems:

libmd: Disable SHA modules for m32c

Close #2219.

comment:5 Changed on Oct 10, 2017 at 6:35:44 AM by Sebastian Huber

Component: miscunspecified
Note: See TracTickets for help on using tickets.