https://bugs.kde.org/show_bug.cgi?id=523843

--- Comment #3 from [email protected] ---
Bug 523626 was fixed using __attribute__((force_align_arg_pointer)) for a
function where compiler emits movdqa requiring 16-byte alignment.  To enforce
such alignment *globally* it turns out that clang -mstack-alignment=16
-mstackrealign may be used.  I'm not yet sure how to properly wire these to the
build system, but what appears to work for me in practice is:

$ git diff
diff --git a/Makefile.all.am b/Makefile.all.am
index 4f185d79c..98266d633 100644
--- a/Makefile.all.am
+++ b/Makefile.all.am
@@ -124,7 +124,9 @@ AM_CFLAGS_BASE = \
        @FLAG_FTRACK_MACRO_EXPANSION@ \
        @FLAG_FSANITIZE@ \
        -fno-strict-aliasing \
-       -fno-builtin
+       -fno-builtin \
+       -mstack-alignment=16 \
+       -mstackrealign

 # Power ISA flag for use by guest_ppc_helpers.c
 if HAS_XSCVHPDP
diff --git a/VEX/priv/guest_generic_helpers.h
b/VEX/priv/guest_generic_helpers.h
index 84b50c146..06450c863 100644
--- a/VEX/priv/guest_generic_helpers.h
+++ b/VEX/priv/guest_generic_helpers.h
@@ -118,7 +118,7 @@ static inline ULong sad_8x4 ( ULong xx, ULong yy )
 /* CALLED FROM GENERATED CODE: CLEAN HELPER */
 #if defined(VGA_x86)
 // Handle https://bugs.kde.org/show_bug.cgi?id=523626
-__attribute__((force_align_arg_pointer))
+// __attribute__((force_align_arg_pointer))
 #endif
 static ULong g_calc_mpsadbw ( ULong sHi, ULong sLo,
                               ULong dHi, ULong dLo,
$

With this, after the project is configured with `CC=clang CXX=clang++
./configure`, the flags demonstrably make it to the build log, and that seems
to effectively help.

The true solution might probably need to start in the configure script, which
seems to contain stuff like
`PREFERRED_STACK_BOUNDARY_2="-mpreferred-stack-boundary=2"` which seems
related.  Thoughts?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to