Bug 205673 - sysutils/u-boot-cubox-hummingboard: Build error on ARM, undefined reference host_detect_local_cpu
Summary: sysutils/u-boot-cubox-hummingboard: Build error on ARM, undefined reference h...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Many People
Assignee: Ian Lepore
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-28 21:32 UTC by Tony Hain
Modified: 2016-01-02 04:13 UTC (History)
2 users (show)

See Also:
rodrigo.freebsd: maintainer-feedback? (ian)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Hain 2015-12-28 21:32:38 UTC
build failure on 
FreeBSD toc 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r292413: Fri Dec 18 08:49:35 UTC 2015     root@releng2.nyi.freebsd.org:/usr/obj/arm.armv6/usr/src/sys/IMX6  arm
 
undefined reference to `host_detect_local_cpu(int, char const**)'

cd /usr/ports/sysutils/u-boot-cubox-hummingboard
make -DBATCH -DMAKE_JOBS_UNSAFE install
===>   u-boot-cubox-hummingboard-2013.10_1 depends on executable: arm-none-eabi-gcc-4.9.2 - not found
===>  Building for arm-none-eabi-gcc492-4.9.2_1
gmake[2]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc'
gmake[3]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/libiberty'
gmake[4]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/libiberty/testsuite'
gmake[4]: Nothing to be done for 'all'.
gmake[4]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/libiberty/testsuite'
gmake[3]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/libiberty'
gmake[3]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/lto-plugin'
gmake  all-am
gmake[4]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/lto-plugin'
gmake[4]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/lto-plugin'
gmake[3]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/lto-plugin'
gmake[3]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/intl'
gmake[3]: Nothing to be done for 'all'.
gmake[3]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/intl'
gmake[3]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/build-armv6-portbld-freebsd11.0/libiberty'
gmake[4]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/build-armv6-portbld-freebsd11.0/libiberty/testsuite'
gmake[4]: Nothing to be done for 'all'.
gmake[4]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/build-armv6-portbld-freebsd11.0/libiberty/testsuite'
gmake[3]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/build-armv6-portbld-freebsd11.0/libiberty'
gmake[3]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/build-armv6-portbld-freebsd11.0/fixincludes'
gmake[3]: Nothing to be done for 'all'.
gmake[3]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/build-armv6-portbld-freebsd11.0/fixincludes'
gmake[3]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/libbacktrace'
gmake  all-am
gmake[4]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/libbacktrace'
true  DO=all multi-do # gmake
gmake[4]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/libbacktrace'
gmake[3]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/libbacktrace'
gmake[3]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/libcpp'
test -f config.h || (rm -f stamp-h1 && gmake stamp-h1)
gmake[3]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/libcpp'
gmake[3]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/libdecnumber'
gmake[3]: Nothing to be done for 'all'.
gmake[3]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/libdecnumber'
gmake[3]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/fixincludes'
gmake[3]: Nothing to be done for 'all'.
gmake[3]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/fixincludes'
gmake[3]: Entering directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/gcc'
c++   -fbracket-depth=512 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H  -o xgcc gcc.o ggc-none.o \
  c/gccspec.o  libcommon-target.a \
   libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a 
gcc.o:(.rodata+0x8c4): undefined reference to `host_detect_local_cpu(int, char const**)'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:1805: recipe for target 'xgcc' failed
gmake[3]: *** [xgcc] Error 1
gmake[3]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc/gcc'
Makefile:3967: recipe for target 'all-gcc' failed
gmake[2]: *** [all-gcc] Error 2
gmake[2]: Leaving directory '/usr/ports/devel/arm-none-eabi-gcc492/work/build-gcc'
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/arm-none-eabi-gcc492
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/u-boot-cubox-hummingboard
Comment 1 Rodrigo N. Hernandez freebsd_triage 2015-12-28 23:41:58 UTC
(In reply to Tony Hain from comment #0)

Hello Tony. The next time you report issues please put logs/whatever containing more than a few lines as attachment instead.

For what I see, compiling the port in ARM can be troublesome depending on GCC version used (not sure if it's your specific case). Anyway, I didn't tested it but find for “If so, you might need the patch below” on this reference: http://freebsd.1045724.n5.nabble.com/Crochet-Updates-for-RPi-BeagleBone-td6026492.html It’s about a patch to fix a similar issue you have now.
Comment 2 Ian Lepore freebsd_committer freebsd_triage 2015-12-30 03:25:26 UTC
I'm trying the patch referenced in comment #1 and will commit the fix after testing.
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-01-02 04:11:55 UTC
A commit references this bug:

Author: ian
Date: Sat Jan  2 04:11:51 UTC 2016
New revision: 405044
URL: https://svnweb.freebsd.org/changeset/ports/405044

Log:
  Add a patch to allow arm-none-eabi-gcc492 to build natively on arm systems.
  Without this change the port builds fine as a cross-compiler but fails to
  build natively on an arm system.

  Patch submitted by Tim Kientzle, who pointed out it was used in the original
  powerpc64-gcc port this one was derived from.

  PR:		205673
  PR:		204419
  Approved by:	mat (mentor)

Changes:
  head/devel/arm-none-eabi-gcc492/Makefile
  head/devel/arm-none-eabi-gcc492/files/
  head/devel/arm-none-eabi-gcc492/files/patch-gcc_config.host