Bug 198204 - lang/gnatdroid-binutils: fix undefined behavior in gas's tc-arm.c
Summary: lang/gnatdroid-binutils: fix undefined behavior in gas's tc-arm.c
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: John Marino
URL:
Keywords:
Depends on:
Blocks: 197395
  Show dependency treegraph
 
Reported: 2015-03-02 20:21 UTC by Dimitry Andric
Modified: 2015-03-03 12:53 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (marino)


Attachments
Fix undefined behavior in gas/contrib/tc-arm.c's rotate_left() macro (1.37 KB, patch)
2015-03-02 20:21 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2015-03-02 20:21:07 UTC
Created attachment 153690 [details]
Fix undefined behavior in gas/contrib/tc-arm.c's rotate_left() macro

In bug 197395, which is about an exp-run for clang 3.6.0, a failure was reported for gnatdroid-armv7:

http://pb2.nyi.freebsd.org/data/headi386PR197395-default/2015-02-27_12h37m23s/logs/errors/gnatdroid-armv7-20141023.log

This failure is due to gas emitting "Error: invalid constant (ff) after fixup" on valid assembly, such as "mov ip, #0xff".  It turns out this is due to undefined behavior in gas, specifically in gas/config/tc-arm.c, in the rotate_left() macro, which was fixed by this upstream commit:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=d840c081f8082e8b9e63fead5306643975a97bb3

The attachment fixes this in the same manner as bug 197806 for devel/binutils.
Comment 1 John Marino freebsd_committer freebsd_triage 2015-03-02 20:24:18 UTC
Do you know if the problem is fixed in binutils 2.25 already?  maybe we should just upgrade to the latest version instead?
Comment 2 John Marino freebsd_committer freebsd_triage 2015-03-02 20:27:02 UTC
nevermind; I see it's broken on 2.25 too.
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-03-03 12:53:21 UTC
A commit references this bug:

Author: marino
Date: Tue Mar  3 12:52:26 UTC 2015
New revision: 380357
URL: https://svnweb.freebsd.org/changeset/ports/380357

Log:
  lang/gnatdroid-binutils: Fix undefined behavior in arm gas

  This patch fixes build on clang 3.6 -- all binutils ports need it.

  PR:		198204
  Submitted by:	dim@

Changes:
  head/lang/gnatdroid-binutils/Makefile
  head/lang/gnatdroid-binutils/files/patch-gas__config__tc-arm.c
Comment 4 John Marino freebsd_committer freebsd_triage 2015-03-03 12:53:55 UTC
thanks!