Bug 14540 - GDB for ARM target fails to build with clang
Summary: GDB for ARM target fails to build with clang
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: sim (show other bugs)
Version: 7.5
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-02 10:39 UTC by Emmanuel Blot
Modified: 2012-09-03 11:13 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emmanuel Blot 2012-09-02 10:39:47 UTC
clang compiler throws the following error:

armsupp.c:639:7: error: non-void function 'ARMul_MRC' should return a value [-Wreturn-type]
      return;

for arm-eabi generic target.

host is OS X 10.8.1

It seems the function:


ARMword
ARMul_MRC (ARMul_State * state, ARMword instr)
{
  unsigned cpab;
  ARMword result = 0;

  if (! CP_ACCESS_ALLOWED (state, CPNum))
    {
      ARMul_UndefInstr (state, instr);
      return;
    }

   ...
}

is actually missing an error value.
Comment 1 Sourceware Commits 2012-09-03 10:13:23 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	nickc@sourceware.org	2012-09-03 10:13:12

Modified files:
	sim/arm        : ChangeLog armsupp.c 

Log message:
	PR sim/14540
	* armsupp.c (ARMul_MRC): Return 0 if access to the MRC instruction
	is denied.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/sim/arm/ChangeLog.diff?cvsroot=src&r1=1.118&r2=1.119
http://sourceware.org/cgi-bin/cvsweb.cgi/src/sim/arm/armsupp.c.diff?cvsroot=src&r1=1.11&r2=1.12
Comment 2 Nick Clifton 2012-09-03 10:14:55 UTC
Hi Emmanual,

  Thank you for reporting this problem.  I have applied a simple fix - to have ARMul_MRC return 0 when the instruction is not allowed.

Cheers
  Nick
Comment 3 Emmanuel Blot 2012-09-03 11:13:05 UTC
Hi Nick,

Ok, thanks.