ports/170256: audio/mpg123: SIGNAL 10 (SIGBUS) error

Dimitry Andric dim at FreeBSD.org
Tue Jan 22 21:11:37 UTC 2013


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 <johnd at defyne.org> 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.


More information about the freebsd-toolchain mailing list