From owner-freebsd-arm@freebsd.org Thu Jul 11 18:44:30 2019 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 227A815DB0B2 for ; Thu, 11 Jul 2019 18:44:30 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 452318C3DA for ; Thu, 11 Jul 2019 18:44:29 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1562870662; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=J0hPGovH9J9lv+j5unDiC+5N/WO6M8np4/erG2Bmyn0wB407o2u2t5kKnCC5EsWYDarHEYmI7wQHb 4K/1iNUyFwj/22ydKo96eXMUZWSfbHARMyCn59wuVDioKVHXPXQXJDIhpjJqJsvItbj6wIMYhDwFs1 +qO9yJhrF/kE+tCusPRxPLh0E6ksEjJ5hllUSjz3FhFp+gMAsVMWiorCGyXLhVI2Kc7AjMCCi7TcTp dikSiTWITRubA7P/hxYNYhRe/7hX1ucaDqjFjpKNqzocxDvsGA3O1GHclyxJXD+uew3jtHdf+oow2E xxaQ5tLiKkXwpncluT4mAHYdZ1GaWJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=qfIhroMghqHg7jPQv612lRHBYT9RuUDPdS1Re9tqQ3I=; b=vYDua6bPoCvZoNRiSlfK1e5ci+bsGE0Eqh1ZgShK/U+NQQbrjzJhVQX1s4RzERSdby05pyspI/xDc 2w25TPOz4qkdmrNHv5YB21zwvc1Fss6AFOJZKeriSNWj9Lx3i2kXaO8xBjecZ849cSsgRcmCj/dUNH S4FdHoRK05gziYzP8pi2e5m8xGnFAxzmIUmcDBpsNy855ZNzUNQAvOM9hzz2XYz4SjslFC5QRLk0hA M7RrMeDFx3lZWqffovvktHyr0AaN3wjgkwPPyhwm51YpNCyTk7dDku70aNCjq7pBS+7eP8uSNPRMeI NY57EU0L4A+aJsTruPJCYfdDaH6KGyg== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=qfIhroMghqHg7jPQv612lRHBYT9RuUDPdS1Re9tqQ3I=; b=if4sk+GJZtBnL59aCXE4bIIdmXSR3QSd8pViA3Bj+4zt57JtPlP92P12HTIp4Y39GZYJSVEtpL/sn Zz656F1Znp7wzPDhAyvMfnvqvX1K/IXgTQZ5K16iiIMmbpcX7GAJWv/tfOvKVVBnQo7HsBlZgcQ2bs ik2IfFUncqej4a+HOSFJC9YOeoVQBrVRAEWGakQzPeK3HxOKzj+ZIQCSw5VL9taoGuAUh+IkC9RVtf +kLMyJE6BnsGwegrIhwFfEhoJLeYp5H73BWlIqy/RQ6D6Gm1SBbS2Gn/j4UnJkmBGhGK0JS0YMLxey anhvM4Vz/gL5hFJTFRulrrq0N7fGEEA== X-MHO-RoutePath: aGlwcGll X-MHO-User: e44aa54c-a40b-11e9-ac5d-07445dfc96fd X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id e44aa54c-a40b-11e9-ac5d-07445dfc96fd; Thu, 11 Jul 2019 18:44:21 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x6BIiJX2017955; Thu, 11 Jul 2019 12:44:19 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <0af96399f723a3e55e4c8d1f0e9926f0727f0bb3.camel@freebsd.org> Subject: Re: FreeBSD arm EABI5 documentation? From: Ian Lepore To: adr , Mark Millard Cc: Robert Crowston via freebsd-arm Date: Thu, 11 Jul 2019 12:44:18 -0600 In-Reply-To: References: <1788e13e706b9fdaf610e4ddd671a5ed715f9dfe.camel@freebsd.org> <1CB61FE0-5665-424F-8B94-ABFC06906112@yahoo.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 452318C3DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jul 2019 18:44:30 -0000 On Thu, 2019-07-11 at 17:50 +0000, adr wrote: > > > > Curious about 32-bit arm stack alignment requirements in netbsd > > > > (based on a FreeBSD thread making claims that user space allows > > > > 4-byte stack alignment), I went looking around some in NetBSD > > Whooow... I don't know what on earth I'm missing, or what I said that > make you contact NetBSD developers talking about "claims". > > Just write some ugly assembler: > ====================================== > .arch armv7-a > .syntax unified > .data > str1: > .string "1-6: %d, %d, %d, %d, %d, %d\n" > .align > .text > .global main > main: > push {r0} @ stack is not 8byte align anymore > mov r8, 10 > loop: > ldr r0, =str1 > mov r1, 1 > mov r2, 2 > mov r3, 3 > mov r4, 4 > mov r5, 5 > mov r6, 6 > push { r4-r6 } @ alignment will change in the loop > bl printf > subs r8, r8, 1 > bne loop > end: > b end > ===================================================== > as -a -o test.o test.s > test.l > cc -o test test.o > > And it works. In fact it works in FreeBSD with clang. > But a more complex code, as a said before, calling > SDL2 to use graphics works without any problem on NetBSD > and Linux, but not on FreeBSD. > > In fact I like that it doesn't work in FreeBSD, because > that made me correct my code. > > That is all I was saying, and now I'm going to just shut the * up. Oh, so it's not that netbsd and linux have different stack alignment requirements, it's just that you accidentally never called a function with an unaligned stack where the misalignment caused a problem. There are only a few instructions that really require 64-bit data alignment when the strict alignment enforcement flag is off (it's off in all 3 OSes we're talking about). You could probably call most of the C library functions and luck out on the alignment. -- Ian