configure: check $as first before using $gas as GNU as

llvm's integrated assembler supports the AArch64 asm on darwin since
August 2014. So check $as first before using gas-preprocessor.pl via
$gas. Makes the checks specific for that the architecture specific asm
needs. PPC Altivec and AArch64 needs on ':vararg' for macro arguments.
Arm needs in addition the '.altmacro' directive.
This commit is contained in:
Janne Grunau 2014-08-05 12:08:09 +02:00 committed by Janne Grunau
parent d395895cdb
commit 15201e2560
1 changed files with 21 additions and 11 deletions

32
configure vendored
View File

@ -3760,22 +3760,32 @@ unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF EOF
od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
check_gas() {
if enabled asm; then log "check_gas using '$as' as AS"
enabled arm && nogas=die # :vararg is used on aarch64, arm and ppc altivec
enabled_all ppc altivec && nogas=warn check_as <<EOF || return 1
as=${gas:=$as} .macro m n, y:vararg=0
check_as <<EOF && enable gnu_as || \ \n: .int \y
$nogas "GNU assembler not found, install gas-preprocessor"
.macro m n
\n: .int 0
.endm .endm
m x m x
EOF EOF
# .altmacro is only used in arm asm
check_as <<EOF || $nogas "GNU assembler not found, install gas-preprocessor" ! enabled arm || check_as <<EOF || return 1
.altmacro .altmacro
EOF EOF
enable gnu_as
return 0
}
if enabled asm; then
enabled arm aarch64 && nogas=die
enabled_all ppc altivec && nogas=warn
if ! check_gas ; then
as=${gas:=$as}
check_gas || \
$nogas "GNU assembler not found, install gas-preprocessor"
fi
check_as <<EOF && enable as_func check_as <<EOF && enable as_func
.func test .func test