On Tue, 5 Aug 2014, Janne Grunau wrote:
From: Janne Grunau <[email protected]>
Hi,
On 2014-08-05 13:38:47 +0300, Martin Storsjö wrote:
On Tue, 5 Aug 2014, Janne Grunau wrote:
>From: Janne Grunau <[email protected]>
>
>This was the last missing feature in llvm's integrated assembler on darwin.
>There is no need to use gas-preprocessor.pl if the assembler supports the
>asm fully.
>---
>configure | 6 ++++++
>1 file changed, 6 insertions(+)
>
>diff --git a/configure b/configure
>index b2eb0c8..24865e5 100755
>--- a/configure
>+++ b/configure
>@@ -3764,6 +3764,12 @@ od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable
bigendian
>if enabled asm; then
> enabled arm && nogas=die
> enabled_all ppc altivec && nogas=warn
>+ enabled aarch64 && check_as <<EOF && unset gas
>+.macro m n, y:vararg=0
>+\n: .int \y
>+.endm
>+m x
>+EOF
> as=${gas:=$as}
> check_as <<EOF && enable gnu_as || \
> $nogas "GNU assembler not found, install gas-preprocessor"
>--
>2.0.4
This is a bit convoluted, but it's probably the simplest way of
doing this short of reshuffling a lot of the other things, so it's
ok with me.
Or could we encapsulate these tests into a function and first run
them with $as, and if that fails, rerun them with $gas?
Yes, the function is cleaner and makes it work for all archs
automatically. It might actually work already for ppc, not tested since
my llvm has ppc not enabled. As soon as llvm/xcode supports '.altmacro'
gas-preprocessor.pl won't be used for ARM either.
Janne
---8<---
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.
---
configure | 32 +++++++++++++++++++++-----------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/configure b/configure
index b2eb0c8..22c78e7 100755
--- a/configure
+++ b/configure
@@ -3760,22 +3760,32 @@ unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8
| 'E';
EOF
od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
-
-if enabled asm; then
- enabled arm && nogas=die
- enabled_all ppc altivec && nogas=warn
- as=${gas:=$as}
- check_as <<EOF && enable gnu_as || \
- $nogas "GNU assembler not found, install gas-preprocessor"
-.macro m n
-\n: .int 0
+check_gas() {
+ log "check_gas using '$as' as AS"
+ # :vararg is used on aarch64, arm and ppc altivec
+ check_as <<EOF || return 1
+.macro m n, y:vararg=0
+\n: .int \y
.endm
m x
EOF
-
- check_as <<EOF || $nogas "GNU assembler not found, install
gas-preprocessor"
+ # .altmacro is only used in arm asm
+ ! enabled arm || check_as <<EOF || return 1
.altmacro
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
.func test
--
2.0.4
LGTM
// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel