Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jun 2012 21:11:04 -0700
From:      Tim Kientzle <kientzle@freebsd.org>
To:        arm@freebsd.org
Subject:   armv6 tree vs. buildkernel
Message-ID:  <3F1A5B5F-0787-41CE-8C77-8B1F9A601172@freebsd.org>

index | next in thread | raw e-mail

On the BeagleBone, running a very recent armv6 tree:

# make TARGET_CPUTYPE=armv6 buildworld
# make TARGET_CPUTYPE=armv6 KERNCONF=BEAGLEBONE buildkernel
….
--------------------------------------------------------------
>>> stage 3.2: building everything
--------------------------------------------------------------
cd /usr/obj/usr/src/sys/BEAGLEBONE; MAKEOBJDIRPREFIX=/usr/obj  MACHINE_ARCH=arm  MACHINE=arm  CPUTYPE=armv6 GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin  GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font  GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac  _SHLIBDIRPREFIX=/usr/obj/usr/src/tmp  VERSION="FreeBSD 10.0-CURRENT arm 1000011"  INSTALL="sh /usr/src/tools/install.sh"  PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin make KERNEL=kernel all -DNO_MODULES_OBJ
cc -mlittle-endian -c -x assembler-with-cpp -DLOCORE -O -pipe -march=armv6 -DARM_ARCH_6=1 -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option   -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -D_ARM_ARCH_6 -ffreestanding -Werror /usr/src/sys/arm/arm/locore.S
In file included from /usr/src/sys/arm/arm/locore.S:38:
./machine/asm.h:139:1: error: "_ARM_ARCH_6" redefined
<command-line>: error: this is the location of the previous definition


One solution to this seems to be to edit sys/arm/include/asm.h to properly redefine these symbols, e.g.,

  #if defined(_ARM_ARCH_7) || defined (__ARM_ARCH_6__) || \
      defined (__ARM_ARCH_6J__)
+ #undef _ARM_ARCH_6
  #define _ARM_ARCH_6
  #endif


After this change, it gets as far as:

cc -mlittle-endian -c -O -pipe -march=armv6 -DARM_ARCH_6=1 -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option   -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -D_ARM_ARCH_6 -ffreestanding -Werror  /usr/src/sys/kern/kern_clock.c
{standard input}: Assembler messages:
{standard input}:1363: Error: selected processor does not support `dmb'
{standard input}:1382: Error: selected processor does not support `dmb'
*** [kern_clock.o] Error code 1

This seems to be due to some mismatch between sys/arm/include/atomic.h (which is getting ARM_ARCH_7A from somewhere?) and the -march setting.  I hope to track down the details this weekend.

Tim

P.S.  How is CPUTYPE/TARGET_CPUTYPE supposed to be inferred for regular "buildworld"?
The only option I can find is to set it explicitly in /etc/src.conf.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F1A5B5F-0787-41CE-8C77-8B1F9A601172>