Skip to content

Commit

Permalink
Add endbr64 landing pads at the start of amd64 asm functions for imlib2.
Browse files Browse the repository at this point in the history
Fixes SIGILL in tests on 11th gen intel (IBT)

There are also src/lib/asm_XXX.S which are i386-only and not built on amd64
which I have left alone.

ok jca tb kettenis op
  • Loading branch information
sthen committed Feb 23, 2024
1 parent 13d5b34 commit 004ff08
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions graphics/imlib2/Makefile
@@ -1,6 +1,7 @@
COMMENT= image manipulation library

DISTNAME= imlib2-1.12.2
REVISION= 0
SHARED_LIBS= Imlib2 9.0 # 13.2
CATEGORIES= graphics

Expand Down
11 changes: 11 additions & 0 deletions graphics/imlib2/patches/patch-src_lib_amd64_blend_S
@@ -0,0 +1,11 @@
Index: src/lib/amd64_blend.S
--- src/lib/amd64_blend.S.orig
+++ src/lib/amd64_blend.S
@@ -102,6 +102,7 @@ FN_(imlib_amd64_reshade_copy_rgb_to_rgba)


#define ENTER \
+ endbr64 ; \
pushq %rbp ; \
movq %rsp, %rbp ; \
pushq %rbx ; \
11 changes: 11 additions & 0 deletions graphics/imlib2/patches/patch-src_lib_amd64_blend_cmod_S
@@ -0,0 +1,11 @@
Index: src/lib/amd64_blend_cmod.S
--- src/lib/amd64_blend_cmod.S.orig
+++ src/lib/amd64_blend_cmod.S
@@ -114,6 +114,7 @@ FN_(imlib_amd64_reshade_copy_rgb_to_rgba_cmod)


#define ENTER \
+ endbr64 ; \
pushq %rbp ; \
movq %rsp, %rbp ; \
pushq %rbx ; \

0 comments on commit 004ff08

Please sign in to comment.