Bug 196408

Summary: devel/libffi: Broken on arm with latest clang-3.5 import
Product: Ports & Packages Reporter: Sean Bruno <sbruno>
Component: Individual Port(s)Assignee: Sean Bruno <sbruno>
Status: Closed FIXED    
Severity: Affects Some People CC: emaste, koobs, zeising
Priority: --- Keywords: easy, needs-qa
Version: LatestFlags: koobs: exp-run+
Hardware: arm   
OS: Any   
URL: http://chips.ysv.freebsd.org/data/11armv6-11armv6/2014-12-31_22h53m26s/logs/errors/libffi-3.0.13_3.log
Attachments:
Description Flags
s/stmeqia/stmiaeq/ for arm
none
Update libffi to 3.2.1
none
Still needs one more substitution due to clang3.5
none
Combined patch (3.2.1 + Clang 3.5/arm)
none
Combined patch v2 (3.2.1 + Clang 3.5/arm + GCC 4.2.1) none

Description Sean Bruno freebsd_committer freebsd_triage 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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 2015-01-02 09:43:58 UTC
Take for exp-run
Comment 14 Antoine Brodin freebsd_committer freebsd_triage 2015-01-04 22:09:17 UTC
Exp-run looks good
Comment 15 commit-hook freebsd_committer freebsd_triage 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