From owner-freebsd-toolchain@FreeBSD.ORG Tue Jan 22 21:11:36 2013 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E2AB0F46; Tue, 22 Jan 2013 21:11:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id AA87838C; Tue, 22 Jan 2013 21:11:36 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:554:8432:2f53:3a7e] (unknown [IPv6:2001:7b8:3a7:0:554:8432:2f53:3a7e]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 067BD5C43; Tue, 22 Jan 2013 22:11:35 +0100 (CET) Message-ID: <50FF0080.5090303@FreeBSD.org> Date: Tue, 22 Jan 2013 22:11:28 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20130117 Thunderbird/19.0 MIME-Version: 1.0 To: Jan Beich , bug-followup@freebsd.org Subject: Re: ports/170256: audio/mpg123: SIGNAL 10 (SIGBUS) error References: <201207291139.q6TBdKt2011447@red.freebsd.org> <1TxhPU-000Hnu-3N@internal.tormail.org> In-Reply-To: <1TxhPU-000Hnu-3N@internal.tormail.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2013 21:11:37 -0000 On 2013-01-22 18:13, Jan Beich wrote: > The bug probably happens with every .mp3 file. ... > And this is caused by a broken .align check in configure.ac: > > $ echo '.align 3' | clang -c -o /dev/null -x assembler - > $ echo '.align 3' | gcc47 -c -o /dev/null -x assembler - > {standard input}: Assembler messages: > {standard input}:1: Error: alignment not a power of 2 > Exit 1 > $ echo '.align 3' | as -o /dev/null > {standard input}: Assembler messages: > {standard input}:1: Error: alignment not a power of 2 > Exit 1 > > No clue whose bug is this but here's a workaround. I'm inclined to say this is a bug in mpg123's configure script, or even simpler, in their code. They shouldn't use .align, but .balign or .p2align, if they want to be sure of the correct alignment. That said, the difference is that gas (depending on arch) errors out when it finds the argument to .align is not a power of 2, while clang accepts such weird alignments. (That is, if you are crazy enough to want to align to 3 bytes, why shouldn't the assembler oblige? :-) > --- configure.ac~ > +++ configure.ac > @@ -838,21 +838,21 @@ > > dnl ############## Assembler, compiler properties > > # based on posting from John Dalgliesh on ffmpeg (LGPL) mailing list > # find if .align arg is power-of-two or not > asmalign_exp="unknown" > if test x"$asmalign_exp" = xunknown; then > AC_MSG_CHECKING([if .align takes 2-exponent]) > asmalign_exp="no" > echo '.align 3' > conftest.s > - if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then > + if $AS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then Well, either this, or just patching src/libmpg123/mangle.h to use the more predictable .balign or .p2align directives.