From owner-freebsd-stable@FreeBSD.ORG Sat Feb 7 19:14:16 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 6A5FEF1A for ; Sat, 7 Feb 2015 19:14:16 +0000 (UTC) Received: from nmsh2.e.nsc.no (nmsh2.e.nsc.no [193.213.121.73]) by mx1.freebsd.org (Postfix) with ESMTP id A0901CAB for ; Sat, 7 Feb 2015 19:14:15 +0000 (UTC) Received: from terraplane.org (ti0027a400-0301.bb.online.no [85.164.8.49]) by nmsh2.nsc.no (8.14.7/8.14.7) with ESMTP id t17IB6bk015780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 7 Feb 2015 19:11:07 +0100 (MET) Received: from terraplane.org (localhost [127.0.0.1]) by terraplane.org (8.14.5/8.14.5) with ESMTP id t17IODOA034728; Sat, 7 Feb 2015 19:24:13 +0100 (CET) (envelope-from rumrunner@terraplane.org) Received: (from rumrunner@localhost) by terraplane.org (8.14.5/8.13.8/Submit) id t17IODoA034727; Sat, 7 Feb 2015 19:24:13 +0100 (CET) (envelope-from rumrunner) Date: Sat, 7 Feb 2015 19:24:13 +0100 From: Eivind Evensen To: Pieter de Goeje Subject: Re: Buserror when built on FreeBSD 10, not on FreeBSD 8 Message-ID: <20150207182413.GA34637@klump.hjerdalen.lokalnett> References: <20150205133653.GA16112@klump.hjerdalen.lokalnett> <54D4C4FC.5000803@degoeje.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54D4C4FC.5000803@degoeje.nl> Cc: freebsd-stable@freebsd.org 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: Sat, 07 Feb 2015 19:14:16 -0000 On Fri, Feb 06, 2015 at 02:43:24PM +0100, Pieter de Goeje wrote: > 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. Thanks, this is very interesting. Apparently my thought that when I didn't need the stack for anything myself, I shouldn't have to do anything to it was wrong. I appreciate the help. -- Eivind