Bug 196408 - devel/libffi: Broken on arm with latest clang-3.5 import
Summary: devel/libffi: Broken on arm with latest clang-3.5 import
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Some People
Assignee: Sean Bruno
URL: http://chips.ysv.freebsd.org/data/11a...
Keywords: easy, needs-qa
Depends on:
Blocks:
 
Reported: 2014-12-31 23:29 UTC by Sean Bruno
Modified: 2015-02-16 07:14 UTC (History)
3 users (show)

See Also:
koobs: exp-run+


Attachments
s/stmeqia/stmiaeq/ for arm (566 bytes, patch)
2015-01-01 00:14 UTC, Sean Bruno
no flags Details | Diff
Update libffi to 3.2.1 (6.55 KB, patch)
2015-01-01 00:24 UTC, Kubilay Kocak
no flags Details | Diff
Still needs one more substitution due to clang3.5 (308 bytes, patch)
2015-01-01 00:31 UTC, Sean Bruno
no flags Details | Diff
Combined patch (3.2.1 + Clang 3.5/arm) (6.68 KB, patch)
2015-01-01 11:02 UTC, Kubilay Kocak
no flags Details | Diff
Combined patch v2 (3.2.1 + Clang 3.5/arm + GCC 4.2.1) (6.88 KB, patch)
2015-01-02 00:08 UTC, Kubilay Kocak
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Bruno freebsd_committer 2014-12-31 23:29:31 UTC
newly updated head system building ports.  It looks like clang3.5 has a problem with the assembler generated by libffi on ARMv6.libtool: compile:  /nxb-bin/usr/bin/cc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O -pipe -fno-strict-aliasing -Wall -fexceptions -MT src/java_raw_api.lo -MD -MP -MF src/.deps/java_raw_api.Tpo -c ../src/java_raw_api.c -o src/java_raw_api.o >/dev/null 2>&1
depbase=`echo src/closures.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; /bin/sh ./libtool --tag=CC    --mode=compile /nxb-bin/usr/bin/cc -DHAVE_CONFIG_H -I. -I..   -I. -I../include -Iinclude -I../src   -O -pipe  -fno-strict-aliasing -Wall -fexceptions -MT src/closures.lo -MD -MP -MF $depbase.Tpo -c -o src/closures.lo ../src/closures.c && mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  /nxb-bin/usr/bin/cc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O -pipe -fno-strict-aliasing -Wall -fexceptions -MT src/closures.lo -MD -MP -MF src/.deps/closures.Tpo -c ../src/closures.c  -fPIC -DPIC -o src/.libs/closures.o
libtool: compile:  /nxb-bin/usr/bin/cc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O -pipe -fno-strict-aliasing -Wall -fexceptions -MT src/closures.lo -MD -MP -MF src/.deps/closures.Tpo -c ../src/closures.c -o src/closures.o >/dev/null 2>&1
depbase=`echo src/arm/sysv.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; /bin/sh ./libtool    --mode=compile /nxb-bin/usr/bin/cc -DHAVE_CONFIG_H -I. -I..   -I. -I../include -Iinclude -I../src  -I. -I../include -Iinclude -I../src -O -pipe  -fno-strict-aliasing -MT src/arm/sysv.lo -MD -MP -MF $depbase.Tpo -c -o src/arm/sysv.lo ../src/arm/sysv.S && mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  /nxb-bin/usr/bin/cc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -O -pipe -fno-strict-aliasing -MT src/arm/sysv.lo -MD -MP -MF src/arm/.deps/sysv.Tpo -c ../src/arm/sysv.S  -fPIC -DPIC -o src/arm/.libs/sysv.o
../src/arm/sysv.S:224:2: error: invalid instruction
 stmeqia r2, {r0, r1}
 ^
../src/arm/sysv.S:413:2: error: invalid instruction
 stmeqia r2, {r0, r1}
 ^
*** Error code 1
Comment 1 Sean Bruno freebsd_committer 2015-01-01 00:14:44 UTC
Created attachment 151167 [details]
s/stmeqia/stmiaeq/ for arm

Upstream has completely rewritten this port.  For now, this is sufficient to move forward after the clang-3.5 import and switch to integrated-as as the default.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2015-01-01 00:24:43 UTC
Created attachment 151168 [details]
Update libffi to 3.2.1

Test against this patch updating libffi to 3.2.1 which has maintainer approval
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2015-01-01 00:27:01 UTC
Comment on attachment 151167 [details]
s/stmeqia/stmiaeq/ for arm

Unobsolete sbruno's patch
Comment 4 Sean Bruno freebsd_committer 2015-01-01 00:31:55 UTC
Created attachment 151169 [details]
Still needs one more substitution due to clang3.5
Comment 5 Sean Bruno freebsd_committer 2015-01-01 00:39:32 UTC
patch will be re-built and an exp-run will be requested.
Comment 6 Sean Bruno freebsd_committer 2015-01-01 02:44:25 UTC
Upstream issue opened.

https://github.com/atgreen/libffi/issues/162
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2015-01-01 11:02:59 UTC
Created attachment 151187 [details]
Combined patch (3.2.1 + Clang 3.5/arm)

Combined patch:

- Update to 3.2.1
- Add LICENSE_FILE
- Use OPTIONS helpers
- Backport: Fix for testsuite using clang [1]
- Backport: Fix build with Clang 3.5 on ARM [2]

[1] https://github.com/atgreen/libffi/commit/b5ade2
[2] https://github.com/atgreen/libffi/issues/162
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2015-01-01 11:03:22 UTC
Request exp-run
Comment 9 Antoine Brodin freebsd_committer 2015-01-01 16:16:10 UTC
One comment:  the inclusion of bsd.port.options.mk looks useless

One question:  is this normal:

                === libffi Summary ===

# of unexpected failures        685
# of unresolved testcases       685
Comment 10 Antoine Brodin freebsd_committer 2015-01-01 16:43:54 UTC
Needs more homework before requesting an exp-run
Comment 11 Kubilay Kocak freebsd_committer freebsd_triage 2015-01-02 00:08:45 UTC
Created attachment 151199 [details]
Combined patch v2 (3.2.1 + Clang 3.5/arm + GCC 4.2.1)

- Update to 3.2.1
- Add LICENSE_FILE
- Use OPTIONS helpers (remove bsd.port.options.mk)
- Backport: Fix for testsuite using clang [1]
- Patch build with Clang 3.5 on ARM [2]
- Patch libffi.exp to remove -Wno-psabi for GCC 4.2.1 too [3]
GCC 4.2.1 uninitialized variable test failures have been reported usptream [3]

[1] https://github.com/atgreen/libffi/commit/b5ade2
[2] https://github.com/atgreen/libffi/issues/162
[3] https://github.com/atgreen/libffi/issues/161
[4] https://github.com/atgreen/libffi/issues/163
Comment 12 Kubilay Kocak freebsd_committer freebsd_triage 2015-01-02 00:09:51 UTC
reported upstream [3] 

was supposed to be

reported upstream [4]
Comment 13 Antoine Brodin freebsd_committer 2015-01-02 09:43:58 UTC
Take for exp-run
Comment 14 Antoine Brodin freebsd_committer 2015-01-04 22:09:17 UTC
Exp-run looks good
Comment 15 commit-hook freebsd_committer 2015-01-05 11:50:47 UTC
A commit references this bug:

Author: sbruno
Date: Mon Jan  5 11:50:24 UTC 2015
New revision: 376293
URL: https://svnweb.freebsd.org/changeset/ports/376293

Log:
  Update libffi to 3.2.1
  - Add LICENSE_FILE
  - Use OPTIONS helpers
  - Backport: Fix for testsuite using clang [1]
  - Backport: Fix build with Clang 3.5 on ARM [2]

  PR:		196408
  Submitted by:	koobs
  Approved by:	mentor (implicit)
  Relnotes:	yes

Changes:
  head/devel/libffi/Makefile
  head/devel/libffi/distinfo
  head/devel/libffi/files/patch-b5ade2
  head/devel/libffi/files/patch-configure
  head/devel/libffi/files/patch-src_arm_sysv.S
  head/devel/libffi/pkg-plist