From owner-freebsd-arm@freebsd.org Sat Oct 14 16:54:10 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0093CE4AFE1 for ; Sat, 14 Oct 2017 16:54:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB2827549B for ; Sat, 14 Oct 2017 16:54:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x229.google.com with SMTP id j140so13812093itj.1 for ; Sat, 14 Oct 2017 09:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=A65PZDry7BTY5dP9kLZi+CNEdNjMCskYAV3pMRyuCE8=; b=OSnc+sef6Uef7M0OA18+yjFxzDr7UKbev9z1+GvJq1OoX6VUcjRaQTQYDOfJKLzLaV rdjFtbjlmqEX+i4FdsCKMkpHUjQwu7dU5OQasmvn/0ILPvlTI95UMubasBZMP9UdRywd MhiLFcYSa7WPrC7dY+CDPUy3fhSGVKMvrcbeM/DGTHML6d+y/mJis00pWrrG34oqDDDJ fyZ70n9X/bynv16fjEqHubdwWONaCeVh1p4n18rnh94t45atZC0f6ryVd+gdZ7BAvXh+ Q4hTQfmA42zGEKtzUVRgte6cwp8K3mot1F4JVoeNMAyWkS2ov+2sF2e5laPsPnOZyXBc 65dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=A65PZDry7BTY5dP9kLZi+CNEdNjMCskYAV3pMRyuCE8=; b=cnZmLkdthumFQOKYCNByaflU0wClt48+vKbAa7HIWl+YJGGCWWCeIl7KXRwIfFnYuh V2zZOGcQi9StcEBY3ZJcw9tME5CZ4pUNZtqHFe/tccq0a3QPNMGA4Lp/lu0NeJoYO3SO 7PNPJxnpdMMhXWfC9DcrqR1HY0LIo4pPCtP7c/Yyhpf5ZYwJLTBdgjnHyOaK/XJQe1Yv V7HnSk+rYlx78snxD4l30CuwLtNpGmOj07Mr79WzdhEGKlmJabUzTEKOh0llbRNk3MZX JExz9n6DD3Nxx8zuWuDWQRTKwhmwETKCkE3EDUCjfN+zJ2KFKDIvsupLteDbbP51DAUD on/w== X-Gm-Message-State: AMCzsaUe/mk15p7k4e88EU1++22mh39Riz1i5r9Z6q/0mBr6tfx0BCFr VKiVhWzxn+aJuH3k2+0gMTtg3molBQCbQMUhcSacfw== X-Google-Smtp-Source: ABhQp+QMh/+RM5STvaLil+0inrEBcKr6msmcgPF9Hi1L1WcVJCwJ2J6K7Crc5QZzQcb34VA5TTDkSHhSJQzZqviniu0= X-Received: by 10.36.69.100 with SMTP id y97mr5460946ita.50.1508000048638; Sat, 14 Oct 2017 09:54:08 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Sat, 14 Oct 2017 09:54:07 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:5085:1a2f:dcb:9d2d] Received: by 10.79.94.130 with HTTP; Sat, 14 Oct 2017 09:54:07 -0700 (PDT) In-Reply-To: References: <1507573171.84167.9.camel@freebsd.org> <20171011023356.GA57571@www.zefox.net> <20171011030021.GB57571@www.zefox.net> <20171013020604.GA70845@www.zefox.net> <20171013175943.GA74121@www.zefox.net> <20171014010713.GA75288@www.zefox.net> <254A2C41-59A9-4E4E-8982-ADDBAE2B5F91@dsl-only.net> <20171014021133.GB75288@www.zefox.net> <39f6419f-48f3-aaec-dfa4-3048c8a893d8@freebsd.org> From: Warner Losh Date: Sat, 14 Oct 2017 10:54:07 -0600 X-Google-Sender-Auth: 9W0iPLOTfHVw7HLrkvOFc07lpEg Message-ID: Subject: Re: Difficulty with armv6 to v7 transition. To: =?UTF-8?Q?Eddy_Petri=C8=99or?= Cc: Michal Meloun , freebsd-arm@freebsd.org, bob prohaska Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 16:54:10 -0000 On Oct 14, 2017 10:43 AM, "Eddy Petri=C8=99or" wr= ote: Pe 14 oct. 2017 7:28 AM, "Michal Meloun" a scris: On 14.10.2017 4:11, bob prohaska wrote: > On Fri, Oct 13, 2017 at 06:27:22PM -0700, Mark Millard wrote: >> On 2017-Oct-13, at 6:07 PM, bob prohaska wrote: >> >>> Seems it would have been better to replace >>> BUILD_ARCH!=3D uname -p >>> with >>> BUILD_ARCH!=3D echo armv7 >>> for present purposes. >> >> Are you starting under armv6 ? armv7 ? > I'm afraid it's a mix, due to some untimely foot-shooting. > > Uname - p reports armv7, but clang -v reports > FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0) > Target: armv6-unknown-freebsd12.0-gnueabihf > Thread model: posix > InstalledDir: /usr/bin > > I'll keep trying to unscramble the mess I've made until an armv7 RPI2 > snapshot is released, then start over if necessary. > > Thanks for reading! > > bob prohaska > Bob, can you please try this? setenv MACHINE_ARCH armv7; make buildworld TARGET=3Darm TARGET_ARCH=3Darmv7 I have been trying recently to add support for cross building FreeBSD from Linux and concluded that MACHINE is the system on which the build is done. At the start of the build, yes. But we set it while doing the actual cross build to the target. I don't think I found BUILD* meaning yet. That's because they are internal and should never be messed with. They are a detail we don't commit to keeping. If they matter, we have done something wrong. Unfortunately I concluded the FreeBSD build system would really benefit from a clean-up in terms of variables and documenting their use. May I suggest creating a wiki page documenting the usage a clean up can be done? We do document most of them in build man page. That's what should be updated. It spells this stuff out. Warner Michal > >> BUILD_ARCH should end up matching what >> you start under, not the end target as >> I understand things. >> >> If I tried a cross build on a host >> other than armv7 that BUILD_ARCH result >> would be wrong. (I use amd64 for cross >> building aarch64 and arm6 . I'm not up to >> an armv7 capable context yet and may not >> be for some time.) >> >> That change is a local workaround that is >> specific to the environment you are using >> for a build. >> >> This is like my 12.0-CURRENT change being >> specific to my not building on 11.x or 10.x . >> It is just a local workaround that applies >> just to a more limited context. >> >> I've not figured out what is going on (how/why) >> for the !=3D uname behavior that I observed. But >> echoing the expected result instead did work. >> >> None of this is appropriate to check-in. >> >>> I'll stop the buildworld in progress and try it. >> >> Please report if echo of the host type of context >> appears to make your local environment work vs. >> not. If it does work then it suggests that >> !=3D uname -p did not get the expected text for >> some reason. >> >> Older material: >> >> On Fri, Oct 13, 2017 at 11:36:46AM -0700, Mark Millard wrote: >>> On 2017-Oct-13, at 10:59 AM, bob prohaska wrote= : >>> >>>> It turns out that simply commenting out lines 447-452 in >>>> /usr/src/Makefile.inc1 allows buildworld to run, even with >>>> no /etc/make.conf in place. >>> >>> For reference: >>> >>> 447 .if make(buildworld) >>> 448 BUILD_ARCH!=3D uname -p >>> 449 .if ${MACHINE_ARCH} !=3D ${BUILD_ARCH} >>> 450 .error To cross-build, set TARGET_ARCH. >>> 451 .endif >>> 452 .endif >>> >>> (I suggest that the .error message include the >>> MACHINE_ARCH text and the BUILD_ARCH text, probably >>> with ""s around each so that empty is easy to see.) >>> >>> >>> I've had problems with Makefiles using !=3D and uname >>> ending up with the MACRO assigned being an empty string >>> despite a command-line uname returning the expected >>> text. >>> >>> For example I've applied the below local work arounds >>> to my /usr/ports/Mk/bsd.port.mk copy as part of setting >>> up to do amd64 -> aarch64 or amd64 -> armv6 cross >>> builds of ports via poudriere (I've not updated to a >>> armv7-targeting vintage sources yet): >>> >>> >>> # Get the operating system type >>> .if !defined(OPSYS) >>> -OPSYS!=3D ${UNAME} -s >>> +OPSYS!=3D echo FreeBSD >>> .endif >>> _EXPORTED_VARS+=3D OPSYS >>> >>> .if !defined(_OSRELEASE) >>> -_OSRELEASE!=3D ${UNAME} -r >>> +_OSRELEASE!=3D echo 12.0-CURRENT >>> .endif >>> _EXPORTED_VARS+=3D _OSRELEASE >>> >>> >>> I was specifically ending up with _OSRELEASE >>> being empty as seen in poudriere prior to the >>> workaround and that was messing up poudriere >>> such that it stopped with an associated >>> message. >> >> >> =3D=3D=3D >> Mark Millard >> markmi at dsl-only.net >> > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" > _______________________________________________ freebsd-arm@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-arm To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" _______________________________________________ freebsd-arm@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-arm To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"