From owner-freebsd-stable@FreeBSD.ORG Fri Feb 6 13:52:27 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AE1D1A2 for ; Fri, 6 Feb 2015 13:52:27 +0000 (UTC) Received: from degoeje.nl (degoeje.nl [85.214.202.38]) by mx1.freebsd.org (Postfix) with ESMTP id 0F6F3637 for ; Fri, 6 Feb 2015 13:52:26 +0000 (UTC) Received: from [192.168.1.66] (unknown [188.201.233.49]) by degoeje.nl (Postfix) with ESMTPSA id A4046A2273; Fri, 6 Feb 2015 13:43:27 +0000 (GMT) Message-ID: <54D4C4FC.5000803@degoeje.nl> Date: Fri, 06 Feb 2015 14:43:24 +0100 From: Pieter de Goeje User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Eivind Evensen , freebsd-stable@freebsd.org Subject: Re: Buserror when built on FreeBSD 10, not on FreeBSD 8 References: <20150205133653.GA16112@klump.hjerdalen.lokalnett> In-Reply-To: <20150205133653.GA16112@klump.hjerdalen.lokalnett> Content-Type: text/plain; charset=windows-1252; format=flowed X-Virus-Scanned: clamav-milter 0.98.1 at degoeje.nl X-Virus-Status: Clean Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 13:52:27 -0000 Eivind Evensen schreef op 2015-02-05 om 14:36: > Hello. > > After upgrading from FreeBSD 8 to 10, I have a problem I don't > understand, hopefully somebody here knows what is happening. > > I have a project that uses both assembly and c. I started getting > bus errors after building on FreeBSD 10. I had, and may still have > some objects around from FreeBSD 8 and if I link those, on 10, they work. > I don't have any installations running 8 any longer though. > This is on amd64 platform. The problem is that the stack is not aligned to 16 bytes. Changing to the code to this: asmcode: sub rsp, 8 call cagain add rsp, 8 ret Fixes the problem. It's probably better to just push/pop rbp as that is only one byte per instruction, which will also align the stack for obvious reasons. I believe that gcc on FreeBSD 8 wasn't as strict as clang is on 10 now. - Pieter