Bug 198923

Summary: lang/gcc fails to build on armv6hf
Product: Ports & Packages Reporter: Mikael Urankar <mikael>
Component: Individual Port(s)Assignee: Andreas Tobler <andreast>
Status: Closed FIXED    
Severity: Affects Only Me CC: freebsd-arm, gerald, peterj
Priority: ---    
Version: Latest   
Hardware: arm   
OS: Any   
URL: http://chips.ysv.freebsd.org/data/11armv7-11armv6/2015-02-22_19h54m00s/logs/errors/gcc-4.8.4.log
Attachments:
Description Flags
fix build on armv6hf none

Description Mikael Urankar freebsd_committer freebsd_triage 2015-03-26 10:40:14 UTC
Created attachment 154821 [details]
fix build on armv6hf

Hi,

build failure log:
configure: error: in `/wrkdirs/usr/ports/lang/gcc/work/build/armv6-portbld-freebsd11.0/libgomp':
configure: error: C compiler cannot create executables

details found in config.log:
/usr/local/bin/ld: error: a.out uses VFP register arguments, /usr/ports/lang/gcc/work/build/./gcc/crtbegin.o does not

The problem is because CONFIGURE_TARGET is set to armv6-portbld-freebsd11.0 instead of armv6hf-portbld-freebsd11.0

The attached patch fixes that.

build log:
http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/gcc-4.8.4.log
Comment 1 Gerald Pfeifer freebsd_committer freebsd_triage 2015-03-26 15:05:51 UTC
Andreas, mind having a look at this patch?
Comment 2 Andreas Tobler freebsd_committer freebsd_triage 2015-03-26 17:49:54 UTC
Will have a look.
Comment 3 Andreas Tobler freebsd_committer freebsd_triage 2015-03-26 20:34:39 UTC
Can you give me some information about your environment where you build this gcc?

Iow: uname -ap

On my wandboard I do not need a patch to build (portmaster|make). Build w/o bootstrap just completed.

I saw in your log you're using poudriere, something there to question?

This is really weird:

/wrkdirs/usr/ports/lang/gcc/work/build/armv6-portbld-freebsd11.0/libgomp'

-> armv6-portbld-freebsd11.0 this is definitely wrong on a native armv6hf install.
Comment 4 Mikael Urankar freebsd_committer freebsd_triage 2015-03-27 08:44:27 UTC
(In reply to Andreas Tobler from comment #3)

I'm building lang/gcc using qemu-bsd-user.

uname -ap:
FreeBSD XXX 11.0-CURRENT FreeBSD 11.0-CURRENT #1 r280132M: Tue Mar 17 09:51:53 CET 2015 user@XXX:/usr/obj/usr/src/sys/ACHERON arm armv6

make -V MACHINE_ARCH: armv6hf

Without my patch 'make -V CONFIGURE_TARGET -C /usr/ports/lang/gcc' yields armv6-portbld-freebsd11.0, with it: armv6hf-portbld-freebsd11.0
Comment 5 Peter Jeremy freebsd_committer freebsd_triage 2015-03-27 23:01:31 UTC
I am unable to reproduce this on my RPi - I recently built lang/gcc without
problem:
root@rpi2:/usr/ports/lang/gcc # make -V MACHINE_ARCH
armv6hf
root@rpi2:/usr/ports/lang/gcc # make -V CONFIGURE_TARGET -C /usr/ports/lang/gcc
armv6hf-portbld-freebsd11.0
root@rpi2:/usr/ports/lang/gcc # uname -a
FreeBSD rpi2.rulingia.com 11.0-CURRENT FreeBSD 11.0-CURRENT #5: Sat Mar 14 20:42:43 AEDT 2015     root@rpi2.rulingia.com:/a/usr/src/sys/RPI-PJ  arm

I can't indicate exactly what SVN revision I am running but it's within the past
few weeks.
Comment 6 Peter Jeremy freebsd_committer freebsd_triage 2015-03-27 23:10:20 UTC
And, I just noticed the last bit of Mikael's uname output.  He has "uname -p" returning "armv6", not "armv6hf" so he appears to either not be running an armv6hf kernel or he's overriding it via UNAME_arch.

In my case:

root@rpi2:/usr/ports/lang/gcc # uname -p
armv6hf
root@rpi2:/usr/ports/lang/gcc # sysctl hw.machine_arch
hw.machine_arch: armv6hf
Comment 7 Mikael Urankar freebsd_committer freebsd_triage 2015-03-28 10:53:11 UTC
(In reply to Peter Jeremy from comment #6)
Ok, the problem is in qemu-bsd-user not in the port, hw_machine is hardcoded to armv6:

grep TARGET_HW_MACHINE_ARCH /usr/ports/emulators/qemu-user-static/work/seanbruno-qemu-bsd-user-6b9c0c2/bsd-user/arm/syscall.h
#define TARGET_HW_MACHINE_ARCH  "armv6"

Thank you all for your support and sorry for the noise!