From owner-freebsd-arm@FreeBSD.ORG Sat Jun 23 14:35:26 2012 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B19C31065673 for ; Sat, 23 Jun 2012 14:35:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-yw0-f44.google.com (mail-yw0-f44.google.com [209.85.213.44]) by mx1.freebsd.org (Postfix) with ESMTP id 66E688FC17 for ; Sat, 23 Jun 2012 14:35:26 +0000 (UTC) Received: by yhq56 with SMTP id 56so2384054yhq.17 for ; Sat, 23 Jun 2012 07:35:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=DBdty84qFq+2+ILQ/UgoJ6erR6oItZT18lJnxm5AUUk=; b=OzDnPwFjI0o7ZNaAya4p73+JABnTWAG6JswoyOLd0110JKFh77ATOpYdDY79HoeyIr eINOmSkQsfLOsOZnb6U3QavhAXeB3CeRUHDQ2rRrgiThJT2aGhZG1y+0qZahNMRkhCN3 3G33XcRoQBPUHpJHA3xTLOfxdfs/BrTvwYgBk9iiOnPI6GLBBpLJ9p2Z87O/yZbxNUaP gL5JnPsfCDW6A89qeCDpUqWQZBqvF5jFBgChjIGsH3PK+qg50IZArBgyBgi526/EyfgN ToQkFaeXxaKnpZ+F8Szu4XwmxY8FmT66qEDEqNj/APEysVSIMhltls7rawwimfkrN33Z kqIg== Received: by 10.43.46.194 with SMTP id up2mr2289596icb.22.1340462119768; Sat, 23 Jun 2012 07:35:19 -0700 (PDT) Received: from 63.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id ai6sm5046342igc.0.2012.06.23.07.35.18 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 23 Jun 2012 07:35:19 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=windows-1252 From: Warner Losh In-Reply-To: <3F1A5B5F-0787-41CE-8C77-8B1F9A601172@freebsd.org> Date: Sat, 23 Jun 2012 08:35:18 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <31C8D224-72D4-4BE8-8EC3-29B078C7DAC3@bsdimp.com> References: <3F1A5B5F-0787-41CE-8C77-8B1F9A601172@freebsd.org> To: Tim Kientzle X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQnF04hF/2SsNciD9CGUtQwWWwVxZCKmxW64f0zd+AW54JLefFPT7yX0YvWDkOl8jXX6giyH Cc: arm@freebsd.org Subject: Re: armv6 tree vs. buildkernel X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 14:35:26 -0000 On Jun 22, 2012, at 10:11 PM, Tim Kientzle wrote: > On the BeagleBone, running a very recent armv6 tree: >=20 > # make TARGET_CPUTYPE=3Darmv6 buildworld > # make TARGET_CPUTYPE=3Darmv6 KERNCONF=3DBEAGLEBONE buildkernel > =85. > -------------------------------------------------------------- >>>> stage 3.2: building everything > -------------------------------------------------------------- > cd /usr/obj/usr/src/sys/BEAGLEBONE; MAKEOBJDIRPREFIX=3D/usr/obj = MACHINE_ARCH=3Darm MACHINE=3Darm CPUTYPE=3Darmv6 = GROFF_BIN_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/bin = GROFF_FONT_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/share/groff_font = GROFF_TMAC_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/share/tmac = _SHLIBDIRPREFIX=3D/usr/obj/usr/src/tmp VERSION=3D"FreeBSD 10.0-CURRENT = arm 1000011" INSTALL=3D"sh /usr/src/tools/install.sh" = PATH=3D/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/us= r/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:/us= r/sbin:/usr/bin make KERNEL=3Dkernel all -DNO_MODULES_OBJ > cc -mlittle-endian -c -x assembler-with-cpp -DLOCORE -O -pipe = -march=3Darmv6 -DARM_ARCH_6=3D1 -std=3Dc99 -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=3D8000 --param = inline-unit-growth=3D100 --param large-function-growth=3D1000 = -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 > : error: this is the location of the previous definition >=20 >=20 > One solution to this seems to be to edit sys/arm/include/asm.h to = properly redefine these symbols, e.g., >=20 > #if defined(_ARM_ARCH_7) || defined (__ARM_ARCH_6__) || \ > defined (__ARM_ARCH_6J__) > + #undef _ARM_ARCH_6 > #define _ARM_ARCH_6 > #endif >=20 >=20 > After this change, it gets as far as: >=20 > cc -mlittle-endian -c -O -pipe -march=3Darmv6 -DARM_ARCH_6=3D1 = -std=3Dc99 -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=3D8000 --param inline-unit-growth=3D100 --param = large-function-growth=3D1000 -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 >=20 > 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. >=20 > Tim >=20 > 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 It can't possibly work very well. We need to get TARGET_ARCH=3Darmv6 = working instead of continuing these kludges. Warner=