diff --git a/035ea386d1b6a99a8a1e2ab57cc1fc903569136c.patch b/035ea386d1b6a99a8a1e2ab57cc1fc903569136c.patch deleted file mode 100644 index a7f104fa477594ab7103ed637b2c64b60f692dde..0000000000000000000000000000000000000000 --- a/035ea386d1b6a99a8a1e2ab57cc1fc903569136c.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 035ea386d1b6a99a8a1e2ab57cc1fc903569136c Mon Sep 17 00:00:00 2001 -From: DRC -Date: Thu, 6 Jul 2023 12:04:22 -0400 -Subject: [PATCH] Build: Fix regression test concurrency issues - -- The example-*bit-*-decompress test must run after the - example-*bit-*-compress test, since the latter generates - testout*-example.jpg. - -- Add -static to the filenames of all output files generated by the - "static" regression tests, to avoid conflicts with the "shared" - regression tests. - -- Add the PID to the filenames of all files generated by the tjunittest - packed-pixel image I/O tests. - -- Check the return value of MD5File() in tjunittest to avoid a segfault - if the file doesn't exist. (Prior to the fix described above, that - could occur if two instances of tjunittest ran concurrently from the - same directory with the same -bmp and -precision arguments.) - -Fixes #705 ---- - CMakeLists.txt | 10 ++++++---- - tjunittest.c | 8 ++++++-- - 2 files changed, 12 insertions(+), 6 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index efd101a07..f0b9e9377 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1004,7 +1004,7 @@ foreach(libtype ${TEST_LIBTYPES}) - - if(sample_bits EQUAL 12) - set(tjbench tjbench12) -- set(testout testout12) -+ set(testout testout12${suffix}) - - set(MD5_PPM_GRAY_TILE 2f799249148b1a9d0e61fa4408f6c397) - set(MD5_PPM_420_8x8_TILE b25684e1af37be504ee3fd137757353f) -@@ -1024,7 +1024,7 @@ foreach(libtype ${TEST_LIBTYPES}) - set(MD5_PPM_444_TILE 2f571a032e4dbc8ef40f75219d336b0b) - else() - set(tjbench tjbench) -- set(testout testout) -+ set(testout testout${suffix}) - - set(MD5_PPM_GRAY_TILE 2c3b567086e6ca0c5e6d34ad8d6f6fe8) - set(MD5_PPM_420_8x8_TILE efca1bdf0226df01777137778cf986ec) -@@ -1160,7 +1160,7 @@ foreach(libtype ${TEST_LIBTYPES}) - set(cjpeg cjpeg12) - set(djpeg djpeg12) - set(jpegtran jpegtran12) -- set(testout testout12) -+ set(testout testout12${suffix}) - - set(TESTORIG testorig12.jpg) - set(MD5_JPEG_RGB_ISLOW 9d7369207c520d37f2c1cbfcb82b2964) -@@ -1222,7 +1222,7 @@ foreach(libtype ${TEST_LIBTYPES}) - set(cjpeg cjpeg) - set(djpeg djpeg) - set(jpegtran jpegtran) -- set(testout testout) -+ set(testout testout${suffix}) - - set(TESTORIG testorig.jpg) - set(MD5_JPEG_RGB_ISLOW 1d44a406f61da743b5fd31c0a9abdca3) -@@ -1632,6 +1632,8 @@ foreach(libtype ${TEST_LIBTYPES}) - add_test(example-${sample_bits}bit-${libtype}-decompress - ${CMAKE_CROSSCOMPILING_EMULATOR} example${suffix} decompress - ${EXAMPLE_12BIT_ARG} ${testout}-example.jpg ${testout}-example.ppm) -+ set_tests_properties(example-${sample_bits}bit-${libtype}-decompress -+ PROPERTIES DEPENDS example-${sample_bits}bit-${libtype}-compress) - add_test(example-${sample_bits}bit-${libtype}-decompress-cmp - ${CMAKE_CROSSCOMPILING_EMULATOR} ${MD5CMP} ${MD5_PPM_EXAMPLE_DECOMPRESS} - ${testout}-example.ppm) -diff --git a/tjunittest.c b/tjunittest.c -index bbe44bb17..b033c4f17 100644 ---- a/tjunittest.c -+++ b/tjunittest.c -@@ -977,8 +977,8 @@ static int doBmpTest(const char *ext, int width, int align, int height, int pf, - THROW("Could not allocate memory"); - initBitmap(buf, width, pitch, height, pf, bottomUp); - -- SNPRINTF(filename, 80, "test_bmp%d_%s_%d_%s.%s", precision, pixFormatStr[pf], -- align, bottomUp ? "bu" : "td", ext); -+ SNPRINTF(filename, 80, "test_bmp%d_%s_%d_%s_%d.%s", precision, pixFormatStr[pf], -+ align, bottomUp ? "bu" : "td", getpid(), ext); - if (precision == 8) { - TRY_TJ(handle, tj3SaveImage8(handle, filename, (unsigned char *)buf, width, - pitch, height, pf)); -@@ -990,6 +990,10 @@ static int doBmpTest(const char *ext, int width, int align, int height, int pf, - width, pitch, height, pf)); - } - md5sum = MD5File(filename, md5buf); -+ if (!md5sum) { -+ printf("\n Could not determine MD5 sum of %s\n", filename); -+ retval = -1; goto bailout; -+ } - if (strcasecmp(md5sum, md5ref)) - THROW_MD5(filename, md5sum, md5ref); - diff --git a/libjpeg-turbo-3.0.0.tar.gz b/libjpeg-turbo-3.0.0.tar.gz deleted file mode 100644 index 0b61a85869fed57428804f286d0947dc83c5dfe2..0000000000000000000000000000000000000000 Binary files a/libjpeg-turbo-3.0.0.tar.gz and /dev/null differ diff --git a/libjpeg-turbo-3.0.2.tar.gz b/libjpeg-turbo-3.0.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f4f4c94da490a5861fbff47761386d2d084a4e8a Binary files /dev/null and b/libjpeg-turbo-3.0.2.tar.gz differ diff --git a/libjpeg-turbo-CET.patch b/libjpeg-turbo-CET.patch new file mode 100644 index 0000000000000000000000000000000000000000..75e0ceac9cd883481583ce3dcdb7d15661fbfbe5 --- /dev/null +++ b/libjpeg-turbo-CET.patch @@ -0,0 +1,1248 @@ +From db1afe88c361ceea22c6ac8abdb9b0ff41a39aa2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nikola=20Forr=C3=B3?= +Date: Mon, 15 Apr 2019 16:56:45 +0200 +Subject: [PATCH] x86 SIMD: Add endbr32/endbr64 instructions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Allow for indirect branch tracking with Intel CET (Control-Flow +Enforcement Technology) [1], by making all exported routines a possible +target for an indirect jump. + +Signed-off-by: Nikola Forró + +[1] https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf +--- + simd/i386/jccolext-avx2.asm | 1 + + simd/i386/jccolext-mmx.asm | 1 + + simd/i386/jccolext-sse2.asm | 1 + + simd/i386/jcgryext-avx2.asm | 1 + + simd/i386/jcgryext-mmx.asm | 1 + + simd/i386/jcgryext-sse2.asm | 1 + + simd/i386/jchuff-sse2.asm | 1 + + simd/i386/jcphuff-sse2.asm | 2 ++ + simd/i386/jcsample-avx2.asm | 2 ++ + simd/i386/jcsample-mmx.asm | 2 ++ + simd/i386/jcsample-sse2.asm | 2 ++ + simd/i386/jdcolext-avx2.asm | 1 + + simd/i386/jdcolext-mmx.asm | 1 + + simd/i386/jdcolext-sse2.asm | 1 + + simd/i386/jdmrgext-avx2.asm | 2 ++ + simd/i386/jdmrgext-mmx.asm | 2 ++ + simd/i386/jdmrgext-sse2.asm | 2 ++ + simd/i386/jdsample-avx2.asm | 4 ++++ + simd/i386/jdsample-mmx.asm | 4 ++++ + simd/i386/jdsample-sse2.asm | 4 ++++ + simd/i386/jfdctflt-3dn.asm | 1 + + simd/i386/jfdctflt-sse.asm | 1 + + simd/i386/jfdctfst-mmx.asm | 1 + + simd/i386/jfdctfst-sse2.asm | 1 + + simd/i386/jfdctint-avx2.asm | 1 + + simd/i386/jfdctint-mmx.asm | 1 + + simd/i386/jfdctint-sse2.asm | 1 + + simd/i386/jidctflt-3dn.asm | 1 + + simd/i386/jidctflt-sse.asm | 1 + + simd/i386/jidctflt-sse2.asm | 1 + + simd/i386/jidctfst-mmx.asm | 1 + + simd/i386/jidctfst-sse2.asm | 1 + + simd/i386/jidctint-avx2.asm | 1 + + simd/i386/jidctint-mmx.asm | 1 + + simd/i386/jidctint-sse2.asm | 1 + + simd/i386/jidctred-mmx.asm | 2 ++ + simd/i386/jidctred-sse2.asm | 2 ++ + simd/i386/jquant-3dn.asm | 2 ++ + simd/i386/jquant-mmx.asm | 2 ++ + simd/i386/jquant-sse.asm | 2 ++ + simd/i386/jquantf-sse2.asm | 2 ++ + simd/i386/jquanti-avx2.asm | 2 ++ + simd/i386/jquanti-sse2.asm | 2 ++ + simd/nasm/jsimdext.inc | 8 ++++++++ + simd/x86_64/jccolext-avx2.asm | 1 + + simd/x86_64/jccolext-sse2.asm | 1 + + simd/x86_64/jcgryext-avx2.asm | 1 + + simd/x86_64/jcgryext-sse2.asm | 1 + + simd/x86_64/jchuff-sse2.asm | 1 + + simd/x86_64/jcphuff-sse2.asm | 2 ++ + simd/x86_64/jcsample-avx2.asm | 2 ++ + simd/x86_64/jcsample-sse2.asm | 2 ++ + simd/x86_64/jdcolext-avx2.asm | 1 + + simd/x86_64/jdcolext-sse2.asm | 1 + + simd/x86_64/jdmrgext-avx2.asm | 2 ++ + simd/x86_64/jdmrgext-sse2.asm | 2 ++ + simd/x86_64/jdsample-avx2.asm | 4 ++++ + simd/x86_64/jdsample-sse2.asm | 4 ++++ + simd/x86_64/jfdctflt-sse.asm | 1 + + simd/x86_64/jfdctfst-sse2.asm | 1 + + simd/x86_64/jfdctint-avx2.asm | 1 + + simd/x86_64/jfdctint-sse2.asm | 1 + + simd/x86_64/jidctflt-sse2.asm | 1 + + simd/x86_64/jidctfst-sse2.asm | 1 + + simd/x86_64/jidctint-avx2.asm | 1 + + simd/x86_64/jidctint-sse2.asm | 1 + + simd/x86_64/jidctred-sse2.asm | 2 ++ + simd/x86_64/jquantf-sse2.asm | 2 ++ + simd/x86_64/jquanti-avx2.asm | 2 ++ + simd/x86_64/jquanti-sse2.asm | 2 ++ + 70 files changed, 116 insertions(+) + +diff --git a/simd/i386/jccolext-avx2.asm b/simd/i386/jccolext-avx2.asm +index c46d684..7dc6e08 100644 +--- a/simd/i386/jccolext-avx2.asm ++++ b/simd/i386/jccolext-avx2.asm +@@ -42,6 +42,7 @@ + GLOBAL_FUNCTION(jsimd_rgb_ycc_convert_avx2) + + EXTN(jsimd_rgb_ycc_convert_avx2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jccolext-mmx.asm b/simd/i386/jccolext-mmx.asm +index 6357a42..8048abb 100644 +--- a/simd/i386/jccolext-mmx.asm ++++ b/simd/i386/jccolext-mmx.asm +@@ -42,6 +42,7 @@ + GLOBAL_FUNCTION(jsimd_rgb_ycc_convert_mmx) + + EXTN(jsimd_rgb_ycc_convert_mmx): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jccolext-sse2.asm b/simd/i386/jccolext-sse2.asm +index c6c8085..5307ddc 100644 +--- a/simd/i386/jccolext-sse2.asm ++++ b/simd/i386/jccolext-sse2.asm +@@ -41,6 +41,7 @@ + GLOBAL_FUNCTION(jsimd_rgb_ycc_convert_sse2) + + EXTN(jsimd_rgb_ycc_convert_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jcgryext-avx2.asm b/simd/i386/jcgryext-avx2.asm +index 3fa7973..27a0e11 100644 +--- a/simd/i386/jcgryext-avx2.asm ++++ b/simd/i386/jcgryext-avx2.asm +@@ -42,6 +42,7 @@ + GLOBAL_FUNCTION(jsimd_rgb_gray_convert_avx2) + + EXTN(jsimd_rgb_gray_convert_avx2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jcgryext-mmx.asm b/simd/i386/jcgryext-mmx.asm +index 8af42e5..dda0e05 100644 +--- a/simd/i386/jcgryext-mmx.asm ++++ b/simd/i386/jcgryext-mmx.asm +@@ -42,6 +42,7 @@ + GLOBAL_FUNCTION(jsimd_rgb_gray_convert_mmx) + + EXTN(jsimd_rgb_gray_convert_mmx): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jcgryext-sse2.asm b/simd/i386/jcgryext-sse2.asm +index c9d6ff1..f8835bb 100644 +--- a/simd/i386/jcgryext-sse2.asm ++++ b/simd/i386/jcgryext-sse2.asm +@@ -41,6 +41,7 @@ + GLOBAL_FUNCTION(jsimd_rgb_gray_convert_sse2) + + EXTN(jsimd_rgb_gray_convert_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jchuff-sse2.asm b/simd/i386/jchuff-sse2.asm +index 76cc85f..0217480 100644 +--- a/simd/i386/jchuff-sse2.asm ++++ b/simd/i386/jchuff-sse2.asm +@@ -350,6 +350,7 @@ times 1 << 14 db 15 + GLOBAL_FUNCTION(jsimd_huff_encode_one_block_sse2) + + EXTN(jsimd_huff_encode_one_block_sse2): ++ _endbr32 + + %assign stack_offset 0 + %define arg_state 4 + stack_offset +diff --git a/simd/i386/jcphuff-sse2.asm b/simd/i386/jcphuff-sse2.asm +index c26b48a..7fb01e5 100644 +--- a/simd/i386/jcphuff-sse2.asm ++++ b/simd/i386/jcphuff-sse2.asm +@@ -281,6 +281,7 @@ + GLOBAL_FUNCTION(jsimd_encode_mcu_AC_first_prepare_sse2) + + EXTN(jsimd_encode_mcu_AC_first_prepare_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +@@ -460,6 +461,7 @@ EXTN(jsimd_encode_mcu_AC_first_prepare_sse2): + GLOBAL_FUNCTION(jsimd_encode_mcu_AC_refine_prepare_sse2) + + EXTN(jsimd_encode_mcu_AC_refine_prepare_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jcsample-avx2.asm b/simd/i386/jcsample-avx2.asm +index 0a20802..46eba8c 100644 +--- a/simd/i386/jcsample-avx2.asm ++++ b/simd/i386/jcsample-avx2.asm +@@ -43,6 +43,7 @@ + GLOBAL_FUNCTION(jsimd_h2v1_downsample_avx2) + + EXTN(jsimd_h2v1_downsample_avx2): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +@@ -216,6 +217,7 @@ EXTN(jsimd_h2v1_downsample_avx2): + GLOBAL_FUNCTION(jsimd_h2v2_downsample_avx2) + + EXTN(jsimd_h2v2_downsample_avx2): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +diff --git a/simd/i386/jcsample-mmx.asm b/simd/i386/jcsample-mmx.asm +index 2c223ee..b2b8ded 100644 +--- a/simd/i386/jcsample-mmx.asm ++++ b/simd/i386/jcsample-mmx.asm +@@ -42,6 +42,7 @@ + GLOBAL_FUNCTION(jsimd_h2v1_downsample_mmx) + + EXTN(jsimd_h2v1_downsample_mmx): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +@@ -185,6 +186,7 @@ EXTN(jsimd_h2v1_downsample_mmx): + GLOBAL_FUNCTION(jsimd_h2v2_downsample_mmx) + + EXTN(jsimd_h2v2_downsample_mmx): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +diff --git a/simd/i386/jcsample-sse2.asm b/simd/i386/jcsample-sse2.asm +index 4fea60d..4c22b40 100644 +--- a/simd/i386/jcsample-sse2.asm ++++ b/simd/i386/jcsample-sse2.asm +@@ -42,6 +42,7 @@ + GLOBAL_FUNCTION(jsimd_h2v1_downsample_sse2) + + EXTN(jsimd_h2v1_downsample_sse2): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +@@ -198,6 +199,7 @@ EXTN(jsimd_h2v1_downsample_sse2): + GLOBAL_FUNCTION(jsimd_h2v2_downsample_sse2) + + EXTN(jsimd_h2v2_downsample_sse2): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +diff --git a/simd/i386/jdcolext-avx2.asm b/simd/i386/jdcolext-avx2.asm +index 015be04..b076765 100644 +--- a/simd/i386/jdcolext-avx2.asm ++++ b/simd/i386/jdcolext-avx2.asm +@@ -43,6 +43,7 @@ + GLOBAL_FUNCTION(jsimd_ycc_rgb_convert_avx2) + + EXTN(jsimd_ycc_rgb_convert_avx2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jdcolext-mmx.asm b/simd/i386/jdcolext-mmx.asm +index 5813cfc..150f5b6 100644 +--- a/simd/i386/jdcolext-mmx.asm ++++ b/simd/i386/jdcolext-mmx.asm +@@ -42,6 +42,7 @@ + GLOBAL_FUNCTION(jsimd_ycc_rgb_convert_mmx) + + EXTN(jsimd_ycc_rgb_convert_mmx): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jdcolext-sse2.asm b/simd/i386/jdcolext-sse2.asm +index d5572b3..cd3ac70 100644 +--- a/simd/i386/jdcolext-sse2.asm ++++ b/simd/i386/jdcolext-sse2.asm +@@ -42,6 +42,7 @@ + GLOBAL_FUNCTION(jsimd_ycc_rgb_convert_sse2) + + EXTN(jsimd_ycc_rgb_convert_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jdmrgext-avx2.asm b/simd/i386/jdmrgext-avx2.asm +index e35f728..0db0aa4 100644 +--- a/simd/i386/jdmrgext-avx2.asm ++++ b/simd/i386/jdmrgext-avx2.asm +@@ -43,6 +43,7 @@ + GLOBAL_FUNCTION(jsimd_h2v1_merged_upsample_avx2) + + EXTN(jsimd_h2v1_merged_upsample_avx2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +@@ -523,6 +524,7 @@ EXTN(jsimd_h2v1_merged_upsample_avx2): + GLOBAL_FUNCTION(jsimd_h2v2_merged_upsample_avx2) + + EXTN(jsimd_h2v2_merged_upsample_avx2): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +diff --git a/simd/i386/jdmrgext-mmx.asm b/simd/i386/jdmrgext-mmx.asm +index eb3e36b..6427a1a 100644 +--- a/simd/i386/jdmrgext-mmx.asm ++++ b/simd/i386/jdmrgext-mmx.asm +@@ -40,6 +40,7 @@ + GLOBAL_FUNCTION(jsimd_h2v1_merged_upsample_mmx) + + EXTN(jsimd_h2v1_merged_upsample_mmx): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +@@ -408,6 +409,7 @@ EXTN(jsimd_h2v1_merged_upsample_mmx): + GLOBAL_FUNCTION(jsimd_h2v2_merged_upsample_mmx) + + EXTN(jsimd_h2v2_merged_upsample_mmx): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +diff --git a/simd/i386/jdmrgext-sse2.asm b/simd/i386/jdmrgext-sse2.asm +index c113dc4..6897fa1 100644 +--- a/simd/i386/jdmrgext-sse2.asm ++++ b/simd/i386/jdmrgext-sse2.asm +@@ -42,6 +42,7 @@ + GLOBAL_FUNCTION(jsimd_h2v1_merged_upsample_sse2) + + EXTN(jsimd_h2v1_merged_upsample_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +@@ -465,6 +466,7 @@ EXTN(jsimd_h2v1_merged_upsample_sse2): + GLOBAL_FUNCTION(jsimd_h2v2_merged_upsample_sse2) + + EXTN(jsimd_h2v2_merged_upsample_sse2): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +diff --git a/simd/i386/jdsample-avx2.asm b/simd/i386/jdsample-avx2.asm +index a800c35..7d52708 100644 +--- a/simd/i386/jdsample-avx2.asm ++++ b/simd/i386/jdsample-avx2.asm +@@ -60,6 +60,7 @@ PW_EIGHT times 16 dw 8 + GLOBAL_FUNCTION(jsimd_h2v1_fancy_upsample_avx2) + + EXTN(jsimd_h2v1_fancy_upsample_avx2): ++ _endbr32 + push ebp + mov ebp, esp + pushpic ebx +@@ -227,6 +228,7 @@ EXTN(jsimd_h2v1_fancy_upsample_avx2): + GLOBAL_FUNCTION(jsimd_h2v2_fancy_upsample_avx2) + + EXTN(jsimd_h2v2_fancy_upsample_avx2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +@@ -570,6 +572,7 @@ EXTN(jsimd_h2v2_fancy_upsample_avx2): + GLOBAL_FUNCTION(jsimd_h2v1_upsample_avx2) + + EXTN(jsimd_h2v1_upsample_avx2): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +@@ -669,6 +672,7 @@ EXTN(jsimd_h2v1_upsample_avx2): + GLOBAL_FUNCTION(jsimd_h2v2_upsample_avx2) + + EXTN(jsimd_h2v2_upsample_avx2): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +diff --git a/simd/i386/jdsample-mmx.asm b/simd/i386/jdsample-mmx.asm +index 12c49f0..7f2ab40 100644 +--- a/simd/i386/jdsample-mmx.asm ++++ b/simd/i386/jdsample-mmx.asm +@@ -59,6 +59,7 @@ PW_EIGHT times 4 dw 8 + GLOBAL_FUNCTION(jsimd_h2v1_fancy_upsample_mmx) + + EXTN(jsimd_h2v1_fancy_upsample_mmx): ++ _endbr32 + push ebp + mov ebp, esp + pushpic ebx +@@ -217,6 +218,7 @@ EXTN(jsimd_h2v1_fancy_upsample_mmx): + GLOBAL_FUNCTION(jsimd_h2v2_fancy_upsample_mmx) + + EXTN(jsimd_h2v2_fancy_upsample_mmx): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +@@ -541,6 +543,7 @@ EXTN(jsimd_h2v2_fancy_upsample_mmx): + GLOBAL_FUNCTION(jsimd_h2v1_upsample_mmx) + + EXTN(jsimd_h2v1_upsample_mmx): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +@@ -640,6 +643,7 @@ EXTN(jsimd_h2v1_upsample_mmx): + GLOBAL_FUNCTION(jsimd_h2v2_upsample_mmx) + + EXTN(jsimd_h2v2_upsample_mmx): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +diff --git a/simd/i386/jdsample-sse2.asm b/simd/i386/jdsample-sse2.asm +index 4e28d2f..3311b25 100644 +--- a/simd/i386/jdsample-sse2.asm ++++ b/simd/i386/jdsample-sse2.asm +@@ -59,6 +59,7 @@ PW_EIGHT times 8 dw 8 + GLOBAL_FUNCTION(jsimd_h2v1_fancy_upsample_sse2) + + EXTN(jsimd_h2v1_fancy_upsample_sse2): ++ _endbr32 + push ebp + mov ebp, esp + pushpic ebx +@@ -216,6 +217,7 @@ EXTN(jsimd_h2v1_fancy_upsample_sse2): + GLOBAL_FUNCTION(jsimd_h2v2_fancy_upsample_sse2) + + EXTN(jsimd_h2v2_fancy_upsample_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +@@ -538,6 +540,7 @@ EXTN(jsimd_h2v2_fancy_upsample_sse2): + GLOBAL_FUNCTION(jsimd_h2v1_upsample_sse2) + + EXTN(jsimd_h2v1_upsample_sse2): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +@@ -635,6 +638,7 @@ EXTN(jsimd_h2v1_upsample_sse2): + GLOBAL_FUNCTION(jsimd_h2v2_upsample_sse2) + + EXTN(jsimd_h2v2_upsample_sse2): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +diff --git a/simd/i386/jfdctflt-3dn.asm b/simd/i386/jfdctflt-3dn.asm +index 322ab16..109e36e 100644 +--- a/simd/i386/jfdctflt-3dn.asm ++++ b/simd/i386/jfdctflt-3dn.asm +@@ -56,6 +56,7 @@ PD_1_306 times 2 dd 1.306562964876376527856643 + GLOBAL_FUNCTION(jsimd_fdct_float_3dnow) + + EXTN(jsimd_fdct_float_3dnow): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jfdctflt-sse.asm b/simd/i386/jfdctflt-sse.asm +index 86952c6..b1e0576 100644 +--- a/simd/i386/jfdctflt-sse.asm ++++ b/simd/i386/jfdctflt-sse.asm +@@ -67,6 +67,7 @@ PD_1_306 times 4 dd 1.306562964876376527856643 + GLOBAL_FUNCTION(jsimd_fdct_float_sse) + + EXTN(jsimd_fdct_float_sse): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jfdctfst-mmx.asm b/simd/i386/jfdctfst-mmx.asm +index 80645a5..be84fdb 100644 +--- a/simd/i386/jfdctfst-mmx.asm ++++ b/simd/i386/jfdctfst-mmx.asm +@@ -81,6 +81,7 @@ PW_F1306 times 4 dw F_1_306 << CONST_SHIFT + GLOBAL_FUNCTION(jsimd_fdct_ifast_mmx) + + EXTN(jsimd_fdct_ifast_mmx): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jfdctfst-sse2.asm b/simd/i386/jfdctfst-sse2.asm +index 446fa7a..945f9cf 100644 +--- a/simd/i386/jfdctfst-sse2.asm ++++ b/simd/i386/jfdctfst-sse2.asm +@@ -82,6 +82,7 @@ PW_F1306 times 8 dw F_1_306 << CONST_SHIFT + GLOBAL_FUNCTION(jsimd_fdct_ifast_sse2) + + EXTN(jsimd_fdct_ifast_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jfdctint-avx2.asm b/simd/i386/jfdctint-avx2.asm +index 23cf733..56acb63 100644 +--- a/simd/i386/jfdctint-avx2.asm ++++ b/simd/i386/jfdctint-avx2.asm +@@ -260,6 +260,7 @@ PW_1_NEG1 times 8 dw 1 + GLOBAL_FUNCTION(jsimd_fdct_islow_avx2) + + EXTN(jsimd_fdct_islow_avx2): ++ _endbr32 + push ebp + mov ebp, esp + pushpic ebx +diff --git a/simd/i386/jfdctint-mmx.asm b/simd/i386/jfdctint-mmx.asm +index 34a43b9..4d1e773 100644 +--- a/simd/i386/jfdctint-mmx.asm ++++ b/simd/i386/jfdctint-mmx.asm +@@ -102,6 +102,7 @@ PW_DESCALE_P2X times 4 dw 1 << (PASS1_BITS - 1) + GLOBAL_FUNCTION(jsimd_fdct_islow_mmx) + + EXTN(jsimd_fdct_islow_mmx): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jfdctint-sse2.asm b/simd/i386/jfdctint-sse2.asm +index 6f8e18c..3954c8f 100644 +--- a/simd/i386/jfdctint-sse2.asm ++++ b/simd/i386/jfdctint-sse2.asm +@@ -103,6 +103,7 @@ PW_DESCALE_P2X times 8 dw 1 << (PASS1_BITS - 1) + GLOBAL_FUNCTION(jsimd_fdct_islow_sse2) + + EXTN(jsimd_fdct_islow_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jidctflt-3dn.asm b/simd/i386/jidctflt-3dn.asm +index 8795191..eb49902 100644 +--- a/simd/i386/jidctflt-3dn.asm ++++ b/simd/i386/jidctflt-3dn.asm +@@ -65,6 +65,7 @@ PB_CENTERJSAMP times 8 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_float_3dnow) + + EXTN(jsimd_idct_float_3dnow): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jidctflt-sse.asm b/simd/i386/jidctflt-sse.asm +index b27ecfd..ffe54f8 100644 +--- a/simd/i386/jidctflt-sse.asm ++++ b/simd/i386/jidctflt-sse.asm +@@ -75,6 +75,7 @@ PB_CENTERJSAMP times 8 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_float_sse) + + EXTN(jsimd_idct_float_sse): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jidctflt-sse2.asm b/simd/i386/jidctflt-sse2.asm +index c646eae..fd1fe35 100644 +--- a/simd/i386/jidctflt-sse2.asm ++++ b/simd/i386/jidctflt-sse2.asm +@@ -75,6 +75,7 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_float_sse2) + + EXTN(jsimd_idct_float_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jidctfst-mmx.asm b/simd/i386/jidctfst-mmx.asm +index 24622d4..00940b8 100644 +--- a/simd/i386/jidctfst-mmx.asm ++++ b/simd/i386/jidctfst-mmx.asm +@@ -96,6 +96,7 @@ PB_CENTERJSAMP times 8 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_ifast_mmx) + + EXTN(jsimd_idct_ifast_mmx): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jidctfst-sse2.asm b/simd/i386/jidctfst-sse2.asm +index 19704ff..1f4af33 100644 +--- a/simd/i386/jidctfst-sse2.asm ++++ b/simd/i386/jidctfst-sse2.asm +@@ -94,6 +94,7 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_ifast_sse2) + + EXTN(jsimd_idct_ifast_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jidctint-avx2.asm b/simd/i386/jidctint-avx2.asm +index 199c7df..2eb606a 100644 +--- a/simd/i386/jidctint-avx2.asm ++++ b/simd/i386/jidctint-avx2.asm +@@ -296,6 +296,7 @@ PW_1_NEG1 times 8 dw 1 + GLOBAL_FUNCTION(jsimd_idct_islow_avx2) + + EXTN(jsimd_idct_islow_avx2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jidctint-mmx.asm b/simd/i386/jidctint-mmx.asm +index f15c8d3..2d91b7e 100644 +--- a/simd/i386/jidctint-mmx.asm ++++ b/simd/i386/jidctint-mmx.asm +@@ -109,6 +109,7 @@ PB_CENTERJSAMP times 8 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_islow_mmx) + + EXTN(jsimd_idct_islow_mmx): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jidctint-sse2.asm b/simd/i386/jidctint-sse2.asm +index 43e3201..804be19 100644 +--- a/simd/i386/jidctint-sse2.asm ++++ b/simd/i386/jidctint-sse2.asm +@@ -107,6 +107,7 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_islow_sse2) + + EXTN(jsimd_idct_islow_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +diff --git a/simd/i386/jidctred-mmx.asm b/simd/i386/jidctred-mmx.asm +index e2307e1..cb43106 100644 +--- a/simd/i386/jidctred-mmx.asm ++++ b/simd/i386/jidctred-mmx.asm +@@ -117,6 +117,7 @@ PB_CENTERJSAMP times 8 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_4x4_mmx) + + EXTN(jsimd_idct_4x4_mmx): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +@@ -504,6 +505,7 @@ EXTN(jsimd_idct_4x4_mmx): + GLOBAL_FUNCTION(jsimd_idct_2x2_mmx) + + EXTN(jsimd_idct_2x2_mmx): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +diff --git a/simd/i386/jidctred-sse2.asm b/simd/i386/jidctred-sse2.asm +index 6e56494..2a61b9e 100644 +--- a/simd/i386/jidctred-sse2.asm ++++ b/simd/i386/jidctred-sse2.asm +@@ -115,6 +115,7 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_4x4_sse2) + + EXTN(jsimd_idct_4x4_sse2): ++ _endbr32 + push ebp + mov eax, esp ; eax = original ebp + sub esp, byte 4 +@@ -425,6 +426,7 @@ EXTN(jsimd_idct_4x4_sse2): + GLOBAL_FUNCTION(jsimd_idct_2x2_sse2) + + EXTN(jsimd_idct_2x2_sse2): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +diff --git a/simd/i386/jquant-3dn.asm b/simd/i386/jquant-3dn.asm +index 5cb60ca..a0599eb 100644 +--- a/simd/i386/jquant-3dn.asm ++++ b/simd/i386/jquant-3dn.asm +@@ -36,6 +36,7 @@ + GLOBAL_FUNCTION(jsimd_convsamp_float_3dnow) + + EXTN(jsimd_convsamp_float_3dnow): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +@@ -138,6 +139,7 @@ EXTN(jsimd_convsamp_float_3dnow): + GLOBAL_FUNCTION(jsimd_quantize_float_3dnow) + + EXTN(jsimd_quantize_float_3dnow): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +diff --git a/simd/i386/jquant-mmx.asm b/simd/i386/jquant-mmx.asm +index 61305c6..080021b 100644 +--- a/simd/i386/jquant-mmx.asm ++++ b/simd/i386/jquant-mmx.asm +@@ -36,6 +36,7 @@ + GLOBAL_FUNCTION(jsimd_convsamp_mmx) + + EXTN(jsimd_convsamp_mmx): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +@@ -145,6 +146,7 @@ EXTN(jsimd_convsamp_mmx): + GLOBAL_FUNCTION(jsimd_quantize_mmx) + + EXTN(jsimd_quantize_mmx): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +diff --git a/simd/i386/jquant-sse.asm b/simd/i386/jquant-sse.asm +index 218adc9..cacd2a9 100644 +--- a/simd/i386/jquant-sse.asm ++++ b/simd/i386/jquant-sse.asm +@@ -36,6 +36,7 @@ + GLOBAL_FUNCTION(jsimd_convsamp_float_sse) + + EXTN(jsimd_convsamp_float_sse): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +@@ -138,6 +139,7 @@ EXTN(jsimd_convsamp_float_sse): + GLOBAL_FUNCTION(jsimd_quantize_float_sse) + + EXTN(jsimd_quantize_float_sse): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +diff --git a/simd/i386/jquantf-sse2.asm b/simd/i386/jquantf-sse2.asm +index a881ab5..6f4789c 100644 +--- a/simd/i386/jquantf-sse2.asm ++++ b/simd/i386/jquantf-sse2.asm +@@ -36,6 +36,7 @@ + GLOBAL_FUNCTION(jsimd_convsamp_float_sse2) + + EXTN(jsimd_convsamp_float_sse2): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +@@ -115,6 +116,7 @@ EXTN(jsimd_convsamp_float_sse2): + GLOBAL_FUNCTION(jsimd_quantize_float_sse2) + + EXTN(jsimd_quantize_float_sse2): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +diff --git a/simd/i386/jquanti-avx2.asm b/simd/i386/jquanti-avx2.asm +index 5ed6bec..efcddd2 100644 +--- a/simd/i386/jquanti-avx2.asm ++++ b/simd/i386/jquanti-avx2.asm +@@ -37,6 +37,7 @@ + GLOBAL_FUNCTION(jsimd_convsamp_avx2) + + EXTN(jsimd_convsamp_avx2): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +@@ -130,6 +131,7 @@ EXTN(jsimd_convsamp_avx2): + GLOBAL_FUNCTION(jsimd_quantize_avx2) + + EXTN(jsimd_quantize_avx2): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +diff --git a/simd/i386/jquanti-sse2.asm b/simd/i386/jquanti-sse2.asm +index 0a50940..98d39e0 100644 +--- a/simd/i386/jquanti-sse2.asm ++++ b/simd/i386/jquanti-sse2.asm +@@ -36,6 +36,7 @@ + GLOBAL_FUNCTION(jsimd_convsamp_sse2) + + EXTN(jsimd_convsamp_sse2): ++ _endbr32 + push ebp + mov ebp, esp + push ebx +@@ -121,6 +122,7 @@ EXTN(jsimd_convsamp_sse2): + GLOBAL_FUNCTION(jsimd_quantize_sse2) + + EXTN(jsimd_quantize_sse2): ++ _endbr32 + push ebp + mov ebp, esp + ; push ebx ; unused +diff --git a/simd/nasm/jsimdext.inc b/simd/nasm/jsimdext.inc +index bebcb20..4b0cd69 100644 +--- a/simd/nasm/jsimdext.inc ++++ b/simd/nasm/jsimdext.inc +@@ -513,6 +513,14 @@ const_base: + + %endif + ++%imacro _endbr32 0 ++ dd 0xfb1e0ff3 ++%endmacro ++ ++%imacro _endbr64 0 ++ dd 0xfa1e0ff3 ++%endmacro ++ + ; -------------------------------------------------------------------------- + ; Defines picked up from the C headers + ; +diff --git a/simd/x86_64/jccolext-avx2.asm b/simd/x86_64/jccolext-avx2.asm +index dd7ea39..e6c8283 100644 +--- a/simd/x86_64/jccolext-avx2.asm ++++ b/simd/x86_64/jccolext-avx2.asm +@@ -41,6 +41,7 @@ + GLOBAL_FUNCTION(jsimd_rgb_ycc_convert_avx2) + + EXTN(jsimd_rgb_ycc_convert_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +diff --git a/simd/x86_64/jccolext-sse2.asm b/simd/x86_64/jccolext-sse2.asm +index bc1e817..4bb1af6 100644 +--- a/simd/x86_64/jccolext-sse2.asm ++++ b/simd/x86_64/jccolext-sse2.asm +@@ -40,6 +40,7 @@ + GLOBAL_FUNCTION(jsimd_rgb_ycc_convert_sse2) + + EXTN(jsimd_rgb_ycc_convert_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +diff --git a/simd/x86_64/jcgryext-avx2.asm b/simd/x86_64/jcgryext-avx2.asm +index c8c8d12..12ecb7e 100644 +--- a/simd/x86_64/jcgryext-avx2.asm ++++ b/simd/x86_64/jcgryext-avx2.asm +@@ -41,6 +41,7 @@ + GLOBAL_FUNCTION(jsimd_rgb_gray_convert_avx2) + + EXTN(jsimd_rgb_gray_convert_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +diff --git a/simd/x86_64/jcgryext-sse2.asm b/simd/x86_64/jcgryext-sse2.asm +index 7e5a0f2..e3a2413 100644 +--- a/simd/x86_64/jcgryext-sse2.asm ++++ b/simd/x86_64/jcgryext-sse2.asm +@@ -40,6 +40,7 @@ + GLOBAL_FUNCTION(jsimd_rgb_gray_convert_sse2) + + EXTN(jsimd_rgb_gray_convert_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +diff --git a/simd/x86_64/jchuff-sse2.asm b/simd/x86_64/jchuff-sse2.asm +index 0c2cdd6..44ea81d 100644 +--- a/simd/x86_64/jchuff-sse2.asm ++++ b/simd/x86_64/jchuff-sse2.asm +@@ -261,6 +261,7 @@ times 1 << 15 db 16 + GLOBAL_FUNCTION(jsimd_huff_encode_one_block_sse2) + + EXTN(jsimd_huff_encode_one_block_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + +diff --git a/simd/x86_64/jcphuff-sse2.asm b/simd/x86_64/jcphuff-sse2.asm +index 11db4b2..2157e97 100644 +--- a/simd/x86_64/jcphuff-sse2.asm ++++ b/simd/x86_64/jcphuff-sse2.asm +@@ -282,6 +282,7 @@ + GLOBAL_FUNCTION(jsimd_encode_mcu_AC_first_prepare_sse2) + + EXTN(jsimd_encode_mcu_AC_first_prepare_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits +@@ -445,6 +446,7 @@ EXTN(jsimd_encode_mcu_AC_first_prepare_sse2): + GLOBAL_FUNCTION(jsimd_encode_mcu_AC_refine_prepare_sse2) + + EXTN(jsimd_encode_mcu_AC_refine_prepare_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits +diff --git a/simd/x86_64/jcsample-avx2.asm b/simd/x86_64/jcsample-avx2.asm +index 589c52b..7d8d4e0 100644 +--- a/simd/x86_64/jcsample-avx2.asm ++++ b/simd/x86_64/jcsample-avx2.asm +@@ -44,6 +44,7 @@ + GLOBAL_FUNCTION(jsimd_h2v1_downsample_avx2) + + EXTN(jsimd_h2v1_downsample_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 6 +@@ -205,6 +206,7 @@ EXTN(jsimd_h2v1_downsample_avx2): + GLOBAL_FUNCTION(jsimd_h2v2_downsample_avx2) + + EXTN(jsimd_h2v2_downsample_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 6 +diff --git a/simd/x86_64/jcsample-sse2.asm b/simd/x86_64/jcsample-sse2.asm +index 7a4f1bc..8932b94 100644 +--- a/simd/x86_64/jcsample-sse2.asm ++++ b/simd/x86_64/jcsample-sse2.asm +@@ -43,6 +43,7 @@ + GLOBAL_FUNCTION(jsimd_h2v1_downsample_sse2) + + EXTN(jsimd_h2v1_downsample_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 6 +@@ -187,6 +188,7 @@ EXTN(jsimd_h2v1_downsample_sse2): + GLOBAL_FUNCTION(jsimd_h2v2_downsample_sse2) + + EXTN(jsimd_h2v2_downsample_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 6 +diff --git a/simd/x86_64/jdcolext-avx2.asm b/simd/x86_64/jdcolext-avx2.asm +index 070436c..6c0a212 100644 +--- a/simd/x86_64/jdcolext-avx2.asm ++++ b/simd/x86_64/jdcolext-avx2.asm +@@ -42,6 +42,7 @@ + GLOBAL_FUNCTION(jsimd_ycc_rgb_convert_avx2) + + EXTN(jsimd_ycc_rgb_convert_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +diff --git a/simd/x86_64/jdcolext-sse2.asm b/simd/x86_64/jdcolext-sse2.asm +index bba3a30..28d05e4 100644 +--- a/simd/x86_64/jdcolext-sse2.asm ++++ b/simd/x86_64/jdcolext-sse2.asm +@@ -41,6 +41,7 @@ + GLOBAL_FUNCTION(jsimd_ycc_rgb_convert_sse2) + + EXTN(jsimd_ycc_rgb_convert_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +diff --git a/simd/x86_64/jdmrgext-avx2.asm b/simd/x86_64/jdmrgext-avx2.asm +index 1191645..f58384c 100644 +--- a/simd/x86_64/jdmrgext-avx2.asm ++++ b/simd/x86_64/jdmrgext-avx2.asm +@@ -42,6 +42,7 @@ + GLOBAL_FUNCTION(jsimd_h2v1_merged_upsample_avx2) + + EXTN(jsimd_h2v1_merged_upsample_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +@@ -506,6 +507,7 @@ EXTN(jsimd_h2v1_merged_upsample_avx2): + GLOBAL_FUNCTION(jsimd_h2v2_merged_upsample_avx2) + + EXTN(jsimd_h2v2_merged_upsample_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 4 +diff --git a/simd/x86_64/jdmrgext-sse2.asm b/simd/x86_64/jdmrgext-sse2.asm +index 8988dd0..8641aa3 100644 +--- a/simd/x86_64/jdmrgext-sse2.asm ++++ b/simd/x86_64/jdmrgext-sse2.asm +@@ -41,6 +41,7 @@ + GLOBAL_FUNCTION(jsimd_h2v1_merged_upsample_sse2) + + EXTN(jsimd_h2v1_merged_upsample_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +@@ -448,6 +449,7 @@ EXTN(jsimd_h2v1_merged_upsample_sse2): + GLOBAL_FUNCTION(jsimd_h2v2_merged_upsample_sse2) + + EXTN(jsimd_h2v2_merged_upsample_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 4 +diff --git a/simd/x86_64/jdsample-avx2.asm b/simd/x86_64/jdsample-avx2.asm +index c6ddbb5..c5594ed 100644 +--- a/simd/x86_64/jdsample-avx2.asm ++++ b/simd/x86_64/jdsample-avx2.asm +@@ -62,6 +62,7 @@ PW_EIGHT times 16 dw 8 + GLOBAL_FUNCTION(jsimd_h2v1_fancy_upsample_avx2) + + EXTN(jsimd_h2v1_fancy_upsample_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + push_xmm 3 +@@ -215,6 +216,7 @@ EXTN(jsimd_h2v1_fancy_upsample_avx2): + GLOBAL_FUNCTION(jsimd_h2v2_fancy_upsample_avx2) + + EXTN(jsimd_h2v2_fancy_upsample_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +@@ -524,6 +526,7 @@ EXTN(jsimd_h2v2_fancy_upsample_avx2): + GLOBAL_FUNCTION(jsimd_h2v1_upsample_avx2) + + EXTN(jsimd_h2v1_upsample_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 4 +@@ -612,6 +615,7 @@ EXTN(jsimd_h2v1_upsample_avx2): + GLOBAL_FUNCTION(jsimd_h2v2_upsample_avx2) + + EXTN(jsimd_h2v2_upsample_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 4 +diff --git a/simd/x86_64/jdsample-sse2.asm b/simd/x86_64/jdsample-sse2.asm +index 24cd389..27bf771 100644 +--- a/simd/x86_64/jdsample-sse2.asm ++++ b/simd/x86_64/jdsample-sse2.asm +@@ -61,6 +61,7 @@ PW_EIGHT times 8 dw 8 + GLOBAL_FUNCTION(jsimd_h2v1_fancy_upsample_sse2) + + EXTN(jsimd_h2v1_fancy_upsample_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 4 +@@ -202,6 +203,7 @@ EXTN(jsimd_h2v1_fancy_upsample_sse2): + GLOBAL_FUNCTION(jsimd_h2v2_fancy_upsample_sse2) + + EXTN(jsimd_h2v2_fancy_upsample_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +@@ -497,6 +499,7 @@ EXTN(jsimd_h2v2_fancy_upsample_sse2): + GLOBAL_FUNCTION(jsimd_h2v1_upsample_sse2) + + EXTN(jsimd_h2v1_upsample_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 4 +@@ -583,6 +586,7 @@ EXTN(jsimd_h2v1_upsample_sse2): + GLOBAL_FUNCTION(jsimd_h2v2_upsample_sse2) + + EXTN(jsimd_h2v2_upsample_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 4 +diff --git a/simd/x86_64/jfdctflt-sse.asm b/simd/x86_64/jfdctflt-sse.asm +index 3595496..b5abeee 100644 +--- a/simd/x86_64/jfdctflt-sse.asm ++++ b/simd/x86_64/jfdctflt-sse.asm +@@ -66,6 +66,7 @@ PD_1_306 times 4 dd 1.306562964876376527856643 + GLOBAL_FUNCTION(jsimd_fdct_float_sse) + + EXTN(jsimd_fdct_float_sse): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +diff --git a/simd/x86_64/jfdctfst-sse2.asm b/simd/x86_64/jfdctfst-sse2.asm +index d33c58a..78af5e4 100644 +--- a/simd/x86_64/jfdctfst-sse2.asm ++++ b/simd/x86_64/jfdctfst-sse2.asm +@@ -81,6 +81,7 @@ PW_F1306 times 8 dw F_1_306 << CONST_SHIFT + GLOBAL_FUNCTION(jsimd_fdct_ifast_sse2) + + EXTN(jsimd_fdct_ifast_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +diff --git a/simd/x86_64/jfdctint-avx2.asm b/simd/x86_64/jfdctint-avx2.asm +index d0afe5e..b083fbb 100644 +--- a/simd/x86_64/jfdctint-avx2.asm ++++ b/simd/x86_64/jfdctint-avx2.asm +@@ -260,6 +260,7 @@ PW_1_NEG1 times 8 dw 1 + GLOBAL_FUNCTION(jsimd_fdct_islow_avx2) + + EXTN(jsimd_fdct_islow_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 1 +diff --git a/simd/x86_64/jfdctint-sse2.asm b/simd/x86_64/jfdctint-sse2.asm +index 024ce90..88ea491 100644 +--- a/simd/x86_64/jfdctint-sse2.asm ++++ b/simd/x86_64/jfdctint-sse2.asm +@@ -102,6 +102,7 @@ PW_DESCALE_P2X times 8 dw 1 << (PASS1_BITS - 1) + GLOBAL_FUNCTION(jsimd_fdct_islow_sse2) + + EXTN(jsimd_fdct_islow_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +diff --git a/simd/x86_64/jidctflt-sse2.asm b/simd/x86_64/jidctflt-sse2.asm +index 952fbe3..8610710 100644 +--- a/simd/x86_64/jidctflt-sse2.asm ++++ b/simd/x86_64/jidctflt-sse2.asm +@@ -76,6 +76,7 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_float_sse2) + + EXTN(jsimd_idct_float_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +diff --git a/simd/x86_64/jidctfst-sse2.asm b/simd/x86_64/jidctfst-sse2.asm +index a3da8d8..351ee06 100644 +--- a/simd/x86_64/jidctfst-sse2.asm ++++ b/simd/x86_64/jidctfst-sse2.asm +@@ -95,6 +95,7 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_ifast_sse2) + + EXTN(jsimd_idct_ifast_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +diff --git a/simd/x86_64/jidctint-avx2.asm b/simd/x86_64/jidctint-avx2.asm +index 528da01..00087c7 100644 +--- a/simd/x86_64/jidctint-avx2.asm ++++ b/simd/x86_64/jidctint-avx2.asm +@@ -282,6 +282,7 @@ PW_1_NEG1 times 8 dw 1 + GLOBAL_FUNCTION(jsimd_idct_islow_avx2) + + EXTN(jsimd_idct_islow_avx2): ++ _endbr64 + push rbp + mov rbp, rsp ; rbp = aligned rbp + push_xmm 4 +diff --git a/simd/x86_64/jidctint-sse2.asm b/simd/x86_64/jidctint-sse2.asm +index 92f633e..9301e81 100644 +--- a/simd/x86_64/jidctint-sse2.asm ++++ b/simd/x86_64/jidctint-sse2.asm +@@ -108,6 +108,7 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_islow_sse2) + + EXTN(jsimd_idct_islow_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +diff --git a/simd/x86_64/jidctred-sse2.asm b/simd/x86_64/jidctred-sse2.asm +index 1ec500c..e74162d 100644 +--- a/simd/x86_64/jidctred-sse2.asm ++++ b/simd/x86_64/jidctred-sse2.asm +@@ -116,6 +116,7 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE + GLOBAL_FUNCTION(jsimd_idct_4x4_sse2) + + EXTN(jsimd_idct_4x4_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + push r15 +@@ -413,6 +414,7 @@ EXTN(jsimd_idct_4x4_sse2): + GLOBAL_FUNCTION(jsimd_idct_2x2_sse2) + + EXTN(jsimd_idct_2x2_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 4 +diff --git a/simd/x86_64/jquantf-sse2.asm b/simd/x86_64/jquantf-sse2.asm +index 232bbb2..2d65986 100644 +--- a/simd/x86_64/jquantf-sse2.asm ++++ b/simd/x86_64/jquantf-sse2.asm +@@ -37,6 +37,7 @@ + GLOBAL_FUNCTION(jsimd_convsamp_float_sse2) + + EXTN(jsimd_convsamp_float_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 3 +@@ -109,6 +110,7 @@ EXTN(jsimd_convsamp_float_sse2): + GLOBAL_FUNCTION(jsimd_quantize_float_sse2) + + EXTN(jsimd_quantize_float_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 3 +diff --git a/simd/x86_64/jquanti-avx2.asm b/simd/x86_64/jquanti-avx2.asm +index 66104d7..a7ea496 100644 +--- a/simd/x86_64/jquanti-avx2.asm ++++ b/simd/x86_64/jquanti-avx2.asm +@@ -38,6 +38,7 @@ + GLOBAL_FUNCTION(jsimd_convsamp_avx2) + + EXTN(jsimd_convsamp_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 3 +@@ -115,6 +116,7 @@ EXTN(jsimd_convsamp_avx2): + GLOBAL_FUNCTION(jsimd_quantize_avx2) + + EXTN(jsimd_quantize_avx2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 3 +diff --git a/simd/x86_64/jquanti-sse2.asm b/simd/x86_64/jquanti-sse2.asm +index 11e9f4c..24cb1cf 100644 +--- a/simd/x86_64/jquanti-sse2.asm ++++ b/simd/x86_64/jquanti-sse2.asm +@@ -37,6 +37,7 @@ + GLOBAL_FUNCTION(jsimd_convsamp_sse2) + + EXTN(jsimd_convsamp_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 3 +@@ -115,6 +116,7 @@ EXTN(jsimd_convsamp_sse2): + GLOBAL_FUNCTION(jsimd_quantize_sse2) + + EXTN(jsimd_quantize_sse2): ++ _endbr64 + push rbp + mov rbp, rsp + collect_args 3 +-- diff --git a/libjpeg-turbo-cmake.patch b/libjpeg-turbo-cmake.patch index 973e081073a8948906999b8fd0126176278264e8..ef4c14d69b7ea80d1ed16391c3869c70bddced56 100644 --- a/libjpeg-turbo-cmake.patch +++ b/libjpeg-turbo-cmake.patch @@ -1,36 +1,11 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1198ece..39ebbc7 100644 +index adb0ca4..902c271 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1687,8 +1687,6 @@ - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -- install(TARGETS tjbench -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND - CMAKE_C_LINKER_SUPPORTS_PDB) - install(FILES "$" -@@ -1699,15 +1697,6 @@ - install(TARGETS turbojpeg-static EXPORT ${CMAKE_PROJECT_NAME}Targets - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- if(NOT ENABLE_SHARED) -- if(GENERATOR_IS_MULTI_CONFIG) -- set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}") -- else() -- set(DIR ${CMAKE_CURRENT_BINARY_DIR}) -- endif() -- install(PROGRAMS ${DIR}/tjbench-static${EXE} -- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE}) -- endif() - endif() - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -@@ -1734,18 +1723,6 @@ - +@@ -1768,18 +1768,6 @@ endif() + install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - + -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg - ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.c - ${CMAKE_CURRENT_SOURCE_DIR}/tjexample.c @@ -46,12 +21,13 @@ index 1198ece..39ebbc7 100644 if(UNIX OR MINGW) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cjpeg.1 ${CMAKE_CURRENT_SOURCE_DIR}/djpeg.1 ${CMAKE_CURRENT_SOURCE_DIR}/jpegtran.1 -@@ -1769,7 +1746,7 @@ - +@@ -1803,7 +1791,7 @@ install(EXPORT ${CMAKE_PROJECT_NAME}Targets + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h ${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h - ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h + ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h ${CMAKE_CURRENT_SOURCE_DIR}/jpegint.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - + include(cmakescripts/BuildPackages.cmake) +-- diff --git a/libjpeg-turbo.spec b/libjpeg-turbo.spec index f57561fec1b9f6cc568640168415fdd8bdff3cc4..b98e015e2f69a28e4f76086c10902f81461107cd 100644 --- a/libjpeg-turbo.spec +++ b/libjpeg-turbo.spec @@ -1,15 +1,17 @@ -%define anolis_release 2 +%define anolis_release 1 Name: libjpeg-turbo -Version: 3.0.0 +Version: 3.0.2 Release: %{anolis_release}%{?dist} Summary: A MMX/SSE2/SIMD accelerated library for manipulating JPEG image files -License: IJG -URL: http://sourceforge.net/projects/libjpeg-turbo +License: Zlib AND BSD-3-Clause AND MIT AND IJG +URL: https://github.com/%{name}/%{name} -Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz +Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.gz + +# https://gitlab.com/redhat/centos-stream/rpms/libjpeg-turbo/-/commit/be16e256620491a81250cf5414f6c4937644c135 Patch0: libjpeg-turbo-cmake.patch -# Fix test running order -Patch1: https://github.com/libjpeg-turbo/libjpeg-turbo/commit/035ea386d1b6a99a8a1e2ab57cc1fc903569136c.patch +# https://github.com/libjpeg-turbo/libjpeg-turbo/commit/db1afe88c361ceea22c6ac8abdb9b0ff41a39aa2#diff-420e05206ac7159bd7fed1f1c9c4f5f29db569af21aefca4f293229af996b1fb +Patch1: libjpeg-turbo-CET.patch Patch2: 0001-skip-djpeg-shared-3x2-float-prog-cmp-for-loongarch64.patch BuildRequires: gcc @@ -121,6 +123,7 @@ export LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{_bindir}/jpegtran %{_bindir}/rdjpgcom %{_bindir}/wrjpgcom +%{_bindir}/tjbench %{_mandir}/man1/cjpeg.1* %{_mandir}/man1/djpeg.1* %{_mandir}/man1/jpegtran.1* @@ -140,6 +143,15 @@ export LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{_libdir}/pkgconfig/libturbojpeg.pc %changelog +* Wed Mar 05 2025 mgb01105731 - 3.0.2-1 +- Update to 3.0.2 from 3.0.0 +- Migrated to SPDX license +- Remove patch as the new version of tarball already includes changes. +- Update patches to enable tjbench to fix some bugs. +- Add patches to add endbr32/endbr64 instructions. + [Patches cherry-pick from c10s. Original changelog: + - New upstream release 3.0.2] + * Tue Nov 7 2023 Wenlong Zhang - 3.0.0-2 - skip djpeg-shared-3x2-float-prog-cmp for loongarch64