[vlc-commits] [Git][videolan/vlc][master] contrib: ass: Apply a patch to fix aarch64 assembly issues

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Nov 13 09:32:54 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
44710998 by Martin Storsjö at 2024-11-13T08:28:45+00:00
contrib: ass: Apply a patch to fix aarch64 assembly issues

This fixes building for aarch64 Windows with assert enabled versions
of Clang. (This issue appeared recently, after updating to a newer
version of libass that includes new aarch64 assembly.)

The same patch has been sent upstream in
https://github.com/libass/libass/pull/849.

- - - - -


2 changed files:

- + contrib/src/ass/0001-aarch64-Set-the-right-intended-alignment-for-constan.patch
- contrib/src/ass/rules.mak


Changes:

=====================================
contrib/src/ass/0001-aarch64-Set-the-right-intended-alignment-for-constan.patch
=====================================
@@ -0,0 +1,70 @@
+From 159cefc9074a9b816d62c6b4251521ab515ecaca Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Tue, 12 Nov 2024 10:08:13 +0200
+Subject: [PATCH] aarch64: Set the right intended alignment for constants
+
+The align parameter to these macros is passed to the gas directive
+.align. This directive is architecture dependent; on some
+architectures, the given alignment is an alignment in bytes,
+while on others, its the power of two to align to. On aarch64,
+.align is for power of two alignment, see [1] for details; i.e.
+it behaves the same as .p2align.
+
+This means that when the macros are invoked with align=16, we
+actually requested 64 KB alignment, not 16 byte alignment. Fix
+this, setting the alignment to the intended 16 byte alignment.
+
+This fixes building for aarch64-windows targets with assert enabled
+versions of Clang; such versions of Clang error out with
+"unsupported section alignment" on this case, while regular release
+versions of Clang silently let this issue pass.
+
+[1] https://sourceware.org/binutils/docs/as/Align.html
+---
+ libass/aarch64/blend_bitmaps.S | 2 +-
+ libass/aarch64/blur.S          | 2 +-
+ libass/aarch64/rasterizer.S    | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libass/aarch64/blend_bitmaps.S b/libass/aarch64/blend_bitmaps.S
+index 2e8f053..a58c09b 100644
+--- a/libass/aarch64/blend_bitmaps.S
++++ b/libass/aarch64/blend_bitmaps.S
+@@ -18,7 +18,7 @@
+ 
+ #include "asm.S"
+ 
+-const edge_mask, align=16
++const edge_mask, align=4
+     .dcb.b 16, 0xFF
+     .dcb.b 16, 0x00
+ endconst
+diff --git a/libass/aarch64/blur.S b/libass/aarch64/blur.S
+index de8b508..292ee84 100644
+--- a/libass/aarch64/blur.S
++++ b/libass/aarch64/blur.S
+@@ -18,7 +18,7 @@
+ 
+ #include "asm.S"
+ 
+-const words_zero, align=16
++const words_zero, align=4
+     .dc.w 0, 0, 0, 0, 0, 0, 0, 0
+ endconst
+ 
+diff --git a/libass/aarch64/rasterizer.S b/libass/aarch64/rasterizer.S
+index 5fde704..514fba2 100644
+--- a/libass/aarch64/rasterizer.S
++++ b/libass/aarch64/rasterizer.S
+@@ -28,7 +28,7 @@
+ #endif
+ 
+ 
+-const words_index, align=16
++const words_index, align=4
+     .dc.w 0, 1, 2, 3, 4, 5, 6, 7
+ endconst
+ 
+-- 
+2.34.1
+


=====================================
contrib/src/ass/rules.mak
=====================================
@@ -36,6 +36,7 @@ $(TARBALLS)/libass-$(ASS_VERSION).tar.gz:
 
 libass: libass-$(ASS_VERSION).tar.gz .sum-ass
 	$(UNPACK)
+	$(APPLY) $(SRC)/ass/0001-aarch64-Set-the-right-intended-alignment-for-constan.patch
 	$(call update_autoconfig,.)
 	$(call pkg_static,"libass.pc.in")
 	$(MOVE)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/44710998f52638131ddc133e912ddf48d2463ae9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/44710998f52638131ddc133e912ddf48d2463ae9
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list