From c35d083dc525e223b085ec00e6863ea6eafb003c Mon Sep 17 00:00:00 2001 From: davidovski Date: Sun, 17 Apr 2022 22:07:52 +0100 Subject: updated musl --- ...882-.gnu.attributes-are-not-checked-for-s.patch | 55 +++++ ...-file-desriptor-if-there-is-no-archive-fd.patch | 234 ++++++++++++++++++ .../binutils/binutils-ld-fix-static-linking.patch | 46 ++++ extra/binutils/gold-mips.patch | 39 +++ extra/binutils/ld-bfd-mips.patch | 19 ++ .../0001-revert-cease-dependence-on-range.patch | 1 + extra/boost/boost-1.57.0-python-abi_letters.patch | 62 +++++ .../boost/boost-1.57.0-python-libpython_dep.patch | 13 + extra/boost/python-3.10.patch | 49 ++++ .../chromium-VirtualCursor-standard-layout.patch | 216 +++++++++++++++++ extra/graphite/cmake.patch | 23 ++ extra/mpd/libcdio-paa-version.patch | 266 +++++++++++++++++++++ extra/mpd/libcdio-paranoia-version.patch | 13 + extra/mpd/mpd.confd | 7 + extra/mpd/mpd.initd | 25 ++ extra/musl/0001-riscv64-define-ELF_NFPREG.patch | 24 ++ ...change-scheduler-functions-Linux-compatib.patch | 52 ++++ extra/musl/fix-utmp-wtmp-paths.patch | 29 +++ extra/musl/handle-aux-at_base.patch | 46 ++++ extra/musl/qsort_r.patch | 213 +++++++++++++++++ extra/musl/syscall-cp-epoll.patch | 16 ++ extra/pango/disable-broken-test.patch | 15 ++ extra/procps-ng/procps-3.3.17-musl-fix.patch | 78 ++++++ extra/procps-ng/use_utmpx.patch | 38 +++ extra/rofi/rofi-sensible-terminal-use-sh.patch | 23 ++ extra/rofi/scrollbar-test.patch | 31 +++ extra/snappy/cmakelists.patch | 96 ++++++++ extra/snappy/fix-inline.patch | 13 + extra/snappy/rtti.patch | 1 + extra/tiff/CVE-2018-12900.patch | 29 +++ extra/xdg-utils/xdg-screensaver-mv-T.patch | 25 ++ 31 files changed, 1797 insertions(+) create mode 100644 extra/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch create mode 100644 extra/binutils/bfd-close-file-desriptor-if-there-is-no-archive-fd.patch create mode 100644 extra/binutils/binutils-ld-fix-static-linking.patch create mode 100644 extra/binutils/gold-mips.patch create mode 100644 extra/binutils/ld-bfd-mips.patch create mode 100644 extra/boost/0001-revert-cease-dependence-on-range.patch create mode 100644 extra/boost/boost-1.57.0-python-abi_letters.patch create mode 100644 extra/boost/boost-1.57.0-python-libpython_dep.patch create mode 100644 extra/boost/python-3.10.patch create mode 100644 extra/chromium/chromium-VirtualCursor-standard-layout.patch create mode 100644 extra/graphite/cmake.patch create mode 100644 extra/mpd/libcdio-paa-version.patch create mode 100644 extra/mpd/libcdio-paranoia-version.patch create mode 100644 extra/mpd/mpd.confd create mode 100644 extra/mpd/mpd.initd create mode 100644 extra/musl/0001-riscv64-define-ELF_NFPREG.patch create mode 100644 extra/musl/change-scheduler-functions-Linux-compatib.patch create mode 100644 extra/musl/fix-utmp-wtmp-paths.patch create mode 100644 extra/musl/handle-aux-at_base.patch create mode 100644 extra/musl/qsort_r.patch create mode 100644 extra/musl/syscall-cp-epoll.patch create mode 100644 extra/pango/disable-broken-test.patch create mode 100644 extra/procps-ng/procps-3.3.17-musl-fix.patch create mode 100644 extra/procps-ng/use_utmpx.patch create mode 100644 extra/rofi/rofi-sensible-terminal-use-sh.patch create mode 100644 extra/rofi/scrollbar-test.patch create mode 100644 extra/snappy/cmakelists.patch create mode 100644 extra/snappy/fix-inline.patch create mode 100644 extra/snappy/rtti.patch create mode 100644 extra/tiff/CVE-2018-12900.patch create mode 100644 extra/xdg-utils/xdg-screensaver-mv-T.patch (limited to 'extra') diff --git a/extra/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch b/extra/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch new file mode 100644 index 0000000..6e1fa77 --- /dev/null +++ b/extra/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch @@ -0,0 +1,55 @@ +From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Tue, 21 Sep 2021 14:53:13 +0000 +Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared + libraries" + +This revert is needed to avoid wrongly tagging objects with the incompatible +IBM long double ABI, which is not supported by musl and will result in +linking errors if used. + +This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba. +--- + bfd/elf32-tic6x.c | 3 --- + ld/ldlang.c | 10 ++++------ + 2 files changed, 4 insertions(+), 9 deletions(-) + +diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c +index 5754f3cb860..3ad1d612749 100644 +--- a/bfd/elf32-tic6x.c ++++ b/bfd/elf32-tic6x.c +@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) + + case Tag_ABI_PIC: + case Tag_ABI_PID: +- /* Don't transfer these tags from dynamic objects. */ +- if ((ibfd->flags & DYNAMIC) != 0) +- continue; + if (out_attr[i].i > in_attr[i].i) + out_attr[i].i = in_attr[i].i; + break; +diff --git a/ld/ldlang.c b/ld/ldlang.c +index 37b64c89ee1..f13beaef9d9 100644 +--- a/ld/ldlang.c ++++ b/ld/ldlang.c +@@ -7071,13 +7071,11 @@ lang_check (void) + bfd_printable_name (input_bfd), input_bfd, + bfd_printable_name (link_info.output_bfd)); + } +- +- /* If the input bfd has no contents, it shouldn't set the +- private data of the output bfd. */ +- else if (!file->flags.just_syms +- && ((input_bfd->flags & DYNAMIC) != 0 +- || bfd_count_sections (input_bfd) != 0)) ++ else if (bfd_count_sections (input_bfd)) + { ++ /* If the input bfd has no contents, it shouldn't set the ++ private data of the output bfd. */ ++ + bfd_error_handler_type pfn = NULL; + + /* If we aren't supposed to warn about mismatched input +-- +2.33.0 + diff --git a/extra/binutils/bfd-close-file-desriptor-if-there-is-no-archive-fd.patch b/extra/binutils/bfd-close-file-desriptor-if-there-is-no-archive-fd.patch new file mode 100644 index 0000000..357d0f9 --- /dev/null +++ b/extra/binutils/bfd-close-file-desriptor-if-there-is-no-archive-fd.patch @@ -0,0 +1,234 @@ +Upstream: yes +URL: https://sourceware.org/bugzilla/show_bug.cgi?id=28138 +From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Mon, 26 Jul 2021 05:59:55 -0700 +Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd + +Close the file descriptor if there is no archive plugin file descriptor +to avoid running out of file descriptors on thin archives with many +archive members. + +bfd/ + + PR ld/28138 + * plugin.c (bfd_plugin_close_file_descriptor): Close the file + descriptor there is no archive plugin file descriptor. + +ld/ + + PR ld/28138 + * testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for + native build. + + PR ld/28138 + * testsuite/ld-plugin/lto.exp: Run ld/28138 tests. + * testsuite/ld-plugin/pr28138.c: New file. + * testsuite/ld-plugin/pr28138-1.c: Likewise. + * testsuite/ld-plugin/pr28138-2.c: Likewise. + * testsuite/ld-plugin/pr28138-3.c: Likewise. + * testsuite/ld-plugin/pr28138-4.c: Likewise. + * testsuite/ld-plugin/pr28138-5.c: Likewise. + * testsuite/ld-plugin/pr28138-6.c: Likewise. + * testsuite/ld-plugin/pr28138-7.c: Likewise. + +(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742) +(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2) +--- + bfd/plugin.c | 8 +++++++ + ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++ + ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++ + 10 files changed, 104 insertions(+) + create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c + create mode 100644 ld/testsuite/ld-plugin/pr28138.c + +diff --git a/bfd/plugin.c b/bfd/plugin.c +index 6cfa2b66470..3bab8febe88 100644 +--- a/bfd/plugin.c ++++ b/bfd/plugin.c +@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd) + && !bfd_is_thin_archive (abfd->my_archive)) + abfd = abfd->my_archive; + ++ /* Close the file descriptor if there is no archive plugin file ++ descriptor. */ ++ if (abfd->archive_plugin_fd == -1) ++ { ++ close (fd); ++ return; ++ } ++ + abfd->archive_plugin_fd_open_count--; + /* Dup the archive plugin file descriptor for later use, which + will be closed by _bfd_archive_close_and_cleanup. */ +diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp +index def69e43ab3..999d911ce6a 100644 +--- a/ld/testsuite/ld-plugin/lto.exp ++++ b/ld/testsuite/ld-plugin/lto.exp +@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } { + } + } + ++run_cc_link_tests [list \ ++ [list \ ++ "Build pr28138.a" \ ++ "-T" "" \ ++ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \ ++ pr28138-6.c pr28138-7.c} {} "pr28138.a" \ ++ ] \ ++ [list \ ++ "Build pr28138.o" \ ++ "" "" \ ++ {pr28138.c} {} \ ++ ] \ ++] ++ ++set exec_output [run_host_cmd "sh" \ ++ "-c \"ulimit -n 20; \ ++ $CC -Btmpdir/ld -o tmpdir/pr28138 \ ++ tmpdir/pr28138.o tmpdir/pr28138.a\""] ++set exec_output [prune_warnings $exec_output] ++if [string match "" $exec_output] then { ++ if { [isnative] } { ++ set exec_output [run_host_cmd "tmpdir/pr28138" ""] ++ if [string match "PASS" $exec_output] then { ++ pass "PR ld/28138" ++ } else { ++ fail "PR ld/28138" ++ } ++ } else { ++ pass "PR ld/28138" ++ } ++} else { ++ fail "PR ld/28138" ++} ++ + set testname "Build liblto-11.a" + remote_file host delete "tmpdir/liblto-11.a" + set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"] +diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c +new file mode 100644 +index 00000000000..51d119e1642 +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-1.c +@@ -0,0 +1,6 @@ ++extern int a0(void); ++int ++a1(void) ++{ ++ return 1 + a0(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c +new file mode 100644 +index 00000000000..1120cd797e9 +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-2.c +@@ -0,0 +1,6 @@ ++extern int a1(void); ++int ++a2(void) ++{ ++ return 1 + a1(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c +new file mode 100644 +index 00000000000..ec464947ee6 +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-3.c +@@ -0,0 +1,6 @@ ++extern int a2(void); ++int ++a3(void) ++{ ++ return 1 + a2(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c +new file mode 100644 +index 00000000000..475701b2c5c +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-4.c +@@ -0,0 +1,6 @@ ++extern int a3(void); ++int ++a4(void) ++{ ++ return 1 + a3(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c +new file mode 100644 +index 00000000000..e24f86c363e +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-5.c +@@ -0,0 +1,6 @@ ++extern int a4(void); ++int ++a5(void) ++{ ++ return 1 + a4(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c +new file mode 100644 +index 00000000000..b5b938bdb21 +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-6.c +@@ -0,0 +1,6 @@ ++extern int a5(void); ++int ++a6(void) ++{ ++ return 1 + a5(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c +new file mode 100644 +index 00000000000..4ef75bf0f0c +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-7.c +@@ -0,0 +1,6 @@ ++extern int a6(void); ++int ++a7(void) ++{ ++ return 1 + a6(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c +new file mode 100644 +index 00000000000..68252c9f382 +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138.c +@@ -0,0 +1,20 @@ ++#include ++ ++extern int a7(void); ++ ++int ++a0(void) ++{ ++ return 0; ++} ++ ++int ++main() ++{ ++ if (a7() == 7) ++ { ++ printf ("PASS\n"); ++ return 0; ++ } ++ return 1; ++} +-- +2.27.0 + diff --git a/extra/binutils/binutils-ld-fix-static-linking.patch b/extra/binutils/binutils-ld-fix-static-linking.patch new file mode 100644 index 0000000..bc5d762 --- /dev/null +++ b/extra/binutils/binutils-ld-fix-static-linking.patch @@ -0,0 +1,46 @@ +This fixes static linking for our hardened toolchain +diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc +index e8126cb..9532bfb 100644 +--- a/ld/scripttempl/elf.sc ++++ b/ld/scripttempl/elf.sc +@@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" + if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then + SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))" + SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))" +- CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors" +- DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors" ++ CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors" ++ DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors" + else + SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))" + SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))" +@@ -270,15 +270,14 @@ CTOR=".ctors ${CONSTRUCTING-0} : + doesn't matter which directory crtbegin.o + is in. */ + +- KEEP (*crtbegin.o(.ctors)) +- KEEP (*crtbegin?.o(.ctors)) ++ KEEP (*crtbegin*.o(.ctors)) + + /* We don't want to include the .ctor section from + the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + +- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors)) ++ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + ${CONSTRUCTING+${CTOR_END}} +@@ -286,9 +285,8 @@ CTOR=".ctors ${CONSTRUCTING-0} : + DTOR=".dtors ${CONSTRUCTING-0} : + { + ${CONSTRUCTING+${DTOR_START}} +- KEEP (*crtbegin.o(.dtors)) +- KEEP (*crtbegin?.o(.dtors)) +- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors)) ++ KEEP (*crtbegin*.o(.dtors)) ++ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + ${CONSTRUCTING+${DTOR_END}} diff --git a/extra/binutils/gold-mips.patch b/extra/binutils/gold-mips.patch new file mode 100644 index 0000000..291a2aa --- /dev/null +++ b/extra/binutils/gold-mips.patch @@ -0,0 +1,39 @@ +# DP: Fix gold on mips64 targets. + +gold/ + +2016-08-09 Aurelien Jarno + + * configure.tgt: Add mips64el*-*-*|mips64le*-*-* and mips64*-*-*. + + +--- a/gold/configure.tgt ++++ b/gold/configure.tgt +@@ -153,6 +153,13 @@ aarch64*-*) + targ_big_endian=false + targ_extra_big_endian=true + ;; ++mips*64*el*-*-*|mips*64*le*-*-*) ++ targ_obj=mips ++ targ_machine=EM_MIPS_RS3_LE ++ targ_size=64 ++ targ_big_endian=false ++ targ_extra_big_endian=true ++ ;; + mips*el*-*-*|mips*le*-*-*) + targ_obj=mips + targ_machine=EM_MIPS_RS3_LE +@@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*) + targ_big_endian=false + targ_extra_big_endian=true + ;; ++mips*64*-*-*) ++ targ_obj=mips ++ targ_machine=EM_MIPS ++ targ_size=64 ++ targ_big_endian=true ++ targ_extra_big_endian=false ++ ;; + mips*-*-*) + targ_obj=mips + targ_machine=EM_MIPS diff --git a/extra/binutils/ld-bfd-mips.patch b/extra/binutils/ld-bfd-mips.patch new file mode 100644 index 0000000..2991c88 --- /dev/null +++ b/extra/binutils/ld-bfd-mips.patch @@ -0,0 +1,19 @@ +--- ./ld/configure.tgt.orig ++++ ./ld/configure.tgt +@@ -541,12 +541,12 @@ + ;; + mips*-*-windiss) targ_emul=elf32mipswindiss + ;; +-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 +- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" ++mips64*el-*-linux-*) targ_emul=elf64ltsmip ++ targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip" + targ_extra_libpath=$targ_extra_emuls + ;; +-mips64*-*-linux-*) targ_emul=elf32btsmipn32 +- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" ++mips64*-*-linux-*) targ_emul=elf64btsmip ++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" + targ_extra_libpath=$targ_extra_emuls + ;; + mips*el-*-linux-*) targ_emul=elf32ltsmip diff --git a/extra/boost/0001-revert-cease-dependence-on-range.patch b/extra/boost/0001-revert-cease-dependence-on-range.patch new file mode 100644 index 0000000..77b8178 --- /dev/null +++ b/extra/boost/0001-revert-cease-dependence-on-range.patch @@ -0,0 +1 @@ +Too Many Requests \ No newline at end of file diff --git a/extra/boost/boost-1.57.0-python-abi_letters.patch b/extra/boost/boost-1.57.0-python-abi_letters.patch new file mode 100644 index 0000000..7df3ee7 --- /dev/null +++ b/extra/boost/boost-1.57.0-python-abi_letters.patch @@ -0,0 +1,62 @@ +--- boost_1_57_0/tools/build/src/tools/python.jam 2013-05-21 06:14:18.000000000 +0200 ++++ boost_1_55_0/tools/build/src/tools/python.jam 2014-05-29 19:09:12.115413877 +0200 +@@ -94,7 +94,7 @@ feature.feature pythonpath : : free opti + # using python : 2.3 : /usr/local/bin/python ; + # + rule init ( version ? : cmd-or-prefix ? : includes * : libraries ? +- : condition * : extension-suffix ? ) ++ : condition * : extension-suffix ? : abi-letters ? ) + { + project.push-current $(.project) ; + +@@ -107,7 +107,7 @@ rule init ( version ? : cmd-or-prefix ? + } + } + +- configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) : $(condition) : $(extension-suffix) ; ++ configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) : $(condition) : $(extension-suffix) : $(abi-letters) ; + + project.pop-current ; + } +@@ -653,7 +653,7 @@ local rule system-library-dependencies ( + + # Declare a target to represent Python's library. + # +-local rule declare-libpython-target ( version ? : requirements * ) ++local rule declare-libpython-target ( version ? : requirements * : abi-letters ? ) + { + # Compute the representation of Python version in the name of Python's + # library file. +@@ -677,13 +677,13 @@ local rule declare-libpython-target ( ve + } + + # Declare it. +- lib python.lib : : python$(lib-version) $(requirements) ; ++ lib python.lib : : python$(lib-version)$(abi-letters) $(requirements) ; + } + + + # Implementation of init. + local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : +- condition * : extension-suffix ? ) ++ condition * : extension-suffix ? : abi-letters ? ) + { + local prefix ; + local exec-prefix ; +@@ -699,6 +699,7 @@ local rule configure ( version ? : cmd-o + extension-suffix ?= _d ; + } + extension-suffix ?= "" ; ++ abi-letters ?= "" ; + + # Normalize and dissect any version number. + local major-minor ; +@@ -922,7 +923,7 @@ local rule configure ( version ? : cmd-o + } + else + { +- declare-libpython-target $(version) : $(target-requirements) ; ++ declare-libpython-target $(version) : $(target-requirements) : $(abi-letters) ; + + # This is an evil hack. On, Windows, when Python is embedded, nothing + # seems to set up sys.path to include Python's standard library diff --git a/extra/boost/boost-1.57.0-python-libpython_dep.patch b/extra/boost/boost-1.57.0-python-libpython_dep.patch new file mode 100644 index 0000000..57bfc26 --- /dev/null +++ b/extra/boost/boost-1.57.0-python-libpython_dep.patch @@ -0,0 +1,13 @@ +Index: boost_1_57_0/tools/build/src/tools/python.jam +=================================================================== +--- boost_1_57_0/tools/build/src/tools/python.jam (revision 50406) ++++ boost_1_57_0/tools/build/src/tools/python.jam (working copy) +@@ -994,7 +994,7 @@ + else + { + alias python_for_extensions +- : ++ : python + : $(target-requirements) + : + : $(usage-requirements) diff --git a/extra/boost/python-3.10.patch b/extra/boost/python-3.10.patch new file mode 100644 index 0000000..2e1d5e3 --- /dev/null +++ b/extra/boost/python-3.10.patch @@ -0,0 +1,49 @@ +From e193f080c7d209516ac9b712fa0c50bb08026fa2 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Tue, 19 Oct 2021 12:24:31 +0000 +Subject: [PATCH] BoostConfig.cmake: allow searching for python310 + +* accept double digits in Python3_VERSION_MINOR + +* if someone is using e.g.: + find_package(Python3 REQUIRED) + find_package(Boost REQUIRED python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}) + + with python-3.10 then it currently fails with: + + -- Found PythonLibs: /usr/lib/libpython3.10.so (found version "3.10.0") + -- Found Python3: -native/usr/bin/python3-native/python3 (found version "3.10.0") found components: Interpreter + CMake Error at /usr/lib/cmake/Boost-1.77.0/BoostConfig.cmake:141 (find_package): + Could not find a package configuration file provided by "boost_python310" + (requested version 1.77.0) with any of the following names: + + boost_python310Config.cmake + boost_python310-config.cmake + + Add the installation prefix of "boost_python310" to CMAKE_PREFIX_PATH or + set "boost_python310_DIR" to a directory containing one of the above files. + If "boost_python310" provides a separate development package or SDK, be + sure it has been installed. + Call Stack (most recent call first): + /usr/lib/cmake/Boost-1.77.0/BoostConfig.cmake:258 (boost_find_component) + /usr/share/cmake-3.21/Modules/FindBoost.cmake:594 (find_package) + CMakeLists.txt:18 (find_package) + +Signed-off-by: Martin Jansa +--- + BoostConfig.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/BoostConfig.cmake b/BoostConfig.cmake +index fd17821..5dffa58 100644 +--- a/tools/boost_install/BoostConfig.cmake ++++ b/tools/boost_install/BoostConfig.cmake +@@ -113,7 +113,7 @@ macro(boost_find_component comp required quiet) + set(_BOOST_REQUIRED REQUIRED) + endif() + +- if("${comp}" MATCHES "^(python|numpy|mpi_python)([1-9])([0-9])$") ++ if("${comp}" MATCHES "^(python|numpy|mpi_python)([1-9])([0-9][0-9]?)$") + + # handle pythonXY and numpyXY versioned components for compatibility + diff --git a/extra/chromium/chromium-VirtualCursor-standard-layout.patch b/extra/chromium/chromium-VirtualCursor-standard-layout.patch new file mode 100644 index 0000000..721e194 --- /dev/null +++ b/extra/chromium/chromium-VirtualCursor-standard-layout.patch @@ -0,0 +1,216 @@ +diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc +index 9ecaafe..839318a 100644 +--- a/sql/recover_module/btree.cc ++++ b/sql/recover_module/btree.cc +@@ -135,16 +135,25 @@ + "Move the destructor to the .cc file if it's non-trival"); + #endif // !DCHECK_IS_ON() + +-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept +- : page_id_(db_reader->page_id()), +- db_reader_(db_reader), +- cell_count_(ComputeCellCount(db_reader)), +- next_read_index_(0), +- last_record_size_(0) { ++void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) { ++ DCHECK(db_reader); + DCHECK(IsOnValidPage(db_reader)); ++ page_id_ = db_reader->page_id(); ++ db_reader_ = db_reader; ++ cell_count_ = ComputeCellCount(db_reader); ++ next_read_index_ = 0; ++ last_record_size_ = 0; + DCHECK(DatabasePageReader::IsValidPageId(page_id_)); + } + ++void LeafPageDecoder::Reset() { ++ db_reader_ = nullptr; ++ page_id_ = 0; ++ cell_count_ = 0; ++ next_read_index_ = 0; ++ last_record_size_ = 0; ++} ++ + bool LeafPageDecoder::TryAdvance() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(CanAdvance()); +diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h +index d76d076..33114b0 100644 +--- a/sql/recover_module/btree.h ++++ b/sql/recover_module/btree.h +@@ -102,7 +102,7 @@ + // + // |db_reader| must have been used to read an inner page of a table B-tree. + // |db_reader| must outlive this instance. +- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept; ++ explicit LeafPageDecoder() noexcept = default; + ~LeafPageDecoder() noexcept = default; + + LeafPageDecoder(const LeafPageDecoder&) = delete; +@@ -150,6 +150,15 @@ + // read as long as CanAdvance() returns true. + bool TryAdvance(); + ++ // Initialize with DatabasePageReader ++ void Initialize(DatabasePageReader* db_reader); ++ ++ // Reset internal DatabasePageReader ++ void Reset(); ++ ++ // True if DatabasePageReader is valid ++ bool IsValid() { return (db_reader_ != nullptr); } ++ + // True if the given reader may point to an inner page in a table B-tree. + // + // The last ReadPage() call on |db_reader| must have succeeded. +@@ -163,14 +172,14 @@ + static int ComputeCellCount(DatabasePageReader* db_reader); + + // The number of the B-tree page this reader is reading. +- const int64_t page_id_; ++ int64_t page_id_; + // Used to read the tree page. + // + // Raw pointer usage is acceptable because this instance's owner is expected + // to ensure that the DatabasePageReader outlives this. +- DatabasePageReader* const db_reader_; ++ DatabasePageReader* db_reader_; + // Caches the ComputeCellCount() value for this reader's page. +- const int cell_count_ = ComputeCellCount(db_reader_); ++ int cell_count_; + + // The reader's cursor state. + // +diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc +index 0029ff9..42548bc 100644 +--- a/sql/recover_module/cursor.cc ++++ b/sql/recover_module/cursor.cc +@@ -26,7 +26,7 @@ + int VirtualCursor::First() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + inner_decoders_.clear(); +- leaf_decoder_ = nullptr; ++ leaf_decoder_.Reset(); + + AppendPageDecoder(table_->root_page_id()); + return Next(); +@@ -36,18 +36,18 @@ + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + record_reader_.Reset(); + +- while (!inner_decoders_.empty() || leaf_decoder_.get()) { +- if (leaf_decoder_.get()) { +- if (!leaf_decoder_->CanAdvance()) { ++ while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) { ++ if (leaf_decoder_.IsValid()) { ++ if (!leaf_decoder_.CanAdvance()) { + // The leaf has been exhausted. Remove it from the DFS stack. +- leaf_decoder_ = nullptr; ++ leaf_decoder_.Reset(); + continue; + } +- if (!leaf_decoder_->TryAdvance()) ++ if (!leaf_decoder_.TryAdvance()) + continue; + +- if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(), +- leaf_decoder_->last_record_offset())) { ++ if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(), ++ leaf_decoder_.last_record_offset())) { + continue; + } + if (!record_reader_.Initialize()) +@@ -99,13 +99,13 @@ + int64_t VirtualCursor::RowId() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(record_reader_.IsInitialized()); +- DCHECK(leaf_decoder_.get()); +- return leaf_decoder_->last_record_rowid(); ++ DCHECK(leaf_decoder_.IsValid()); ++ return leaf_decoder_.last_record_rowid(); + } + + void VirtualCursor::AppendPageDecoder(int page_id) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +- DCHECK(leaf_decoder_.get() == nullptr) ++ DCHECK(!leaf_decoder_.IsValid()) + << __func__ + << " must only be called when the current path has no leaf decoder"; + +@@ -113,7 +113,7 @@ + return; + + if (LeafPageDecoder::IsOnValidPage(&db_reader_)) { +- leaf_decoder_ = std::make_unique(&db_reader_); ++ leaf_decoder_.Initialize(&db_reader_); + return; + } + +diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h +index afcd690..b15c31d 100644 +--- a/sql/recover_module/cursor.h ++++ b/sql/recover_module/cursor.h +@@ -129,7 +129,7 @@ + std::vector> inner_decoders_; + + // Decodes the leaf page containing records. +- std::unique_ptr leaf_decoder_; ++ LeafPageDecoder leaf_decoder_; + + SEQUENCE_CHECKER(sequence_checker_); + }; +diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc +index 58e75de..5fe9620 100644 +--- a/sql/recover_module/pager.cc ++++ b/sql/recover_module/pager.cc +@@ -23,8 +23,7 @@ + "ints are not appropriate for representing page IDs"); + + DatabasePageReader::DatabasePageReader(VirtualTable* table) +- : page_data_(std::make_unique(table->page_size())), +- table_(table) { ++ : page_data_(), table_(table) { + DCHECK(table != nullptr); + DCHECK(IsValidPageSize(table->page_size())); + } +@@ -57,8 +56,8 @@ + std::numeric_limits::max(), + "The |read_offset| computation above may overflow"); + +- int sqlite_status = +- RawRead(sqlite_file, read_size, read_offset, page_data_.get()); ++ int sqlite_status = RawRead(sqlite_file, read_size, read_offset, ++ const_cast(page_data_.data())); + + // |page_id_| needs to be set to kInvalidPageId if the read failed. + // Otherwise, future ReadPage() calls with the previous |page_id_| value +diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h +index 0e388ddc..99314e3 100644 +--- a/sql/recover_module/pager.h ++++ b/sql/recover_module/pager.h +@@ -5,6 +5,7 @@ + #ifndef SQL_RECOVER_MODULE_PAGER_H_ + #define SQL_RECOVER_MODULE_PAGER_H_ + ++#include + #include + #include + +@@ -70,7 +71,7 @@ + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK_NE(page_id_, kInvalidPageId) + << "Successful ReadPage() required before accessing pager state"; +- return page_data_.get(); ++ return page_data_.data(); + } + + // The number of bytes in the page read by the last ReadPage() call. +@@ -137,7 +138,7 @@ + int page_id_ = kInvalidPageId; + // Stores the bytes of the last page successfully read by ReadPage(). + // The content is undefined if the last call to ReadPage() did not succeed. +- const std::unique_ptr page_data_; ++ const std::array page_data_; + // Raw pointer usage is acceptable because this instance's owner is expected + // to ensure that the VirtualTable outlives this. + VirtualTable* const table_; diff --git a/extra/graphite/cmake.patch b/extra/graphite/cmake.patch new file mode 100644 index 0000000..2b21d6b --- /dev/null +++ b/extra/graphite/cmake.patch @@ -0,0 +1,23 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index b6ac26b..0371b0c 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -120,11 +120,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + if (${CMAKE_CXX_COMPILER} MATCHES ".*mingw.*") + target_link_libraries(graphite2 kernel32 msvcr90 mingw32 gcc user32) + else (${CMAKE_CXX_COMPILER} MATCHES ".*mingw.*") +- if (GRAPHITE2_SANITIZERS) +- target_link_libraries(graphite2 c gcc_s) +- else () +- target_link_libraries(graphite2 c gcc) +- endif () ++ target_link_libraries(graphite2 c gcc_s -lssp_nonshared) + endif() + include(Graphite) + if (BUILD_SHARED_LIBS) +@@ -156,4 +152,4 @@ endif() + + + install(TARGETS graphite2 EXPORT graphite2 LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} PUBLIC_HEADER DESTINATION include/graphite2 RUNTIME DESTINATION bin) +-install(EXPORT graphite2 DESTINATION share/graphite2 NAMESPACE gr2_) ++install(EXPORT graphite2 DESTINATION lib${LIB_SUFFIX}/cmake/graphite2 NAMESPACE gr2_) diff --git a/extra/mpd/libcdio-paa-version.patch b/extra/mpd/libcdio-paa-version.patch new file mode 100644 index 0000000..82612b1 --- /dev/null +++ b/extra/mpd/libcdio-paa-version.patch @@ -0,0 +1,266 @@ + + + +aports - Alpine packages build scripts + + + + + + + + + +
+ + + + +
+aboutsummaryrefslogtreecommitdiffstats
+ + + +
+
+
Not found
+
+ +
+ + diff --git a/extra/mpd/libcdio-paranoia-version.patch b/extra/mpd/libcdio-paranoia-version.patch new file mode 100644 index 0000000..44810b3 --- /dev/null +++ b/extra/mpd/libcdio-paranoia-version.patch @@ -0,0 +1,13 @@ +diff --git a/src/input/plugins/meson.build b/src/input/plugins/meson.build +index 7322365..65ff564 100644 +--- a/src/input/plugins/meson.build ++++ b/src/input/plugins/meson.build +@@ -10,7 +10,7 @@ if alsa_dep.found() + input_plugins_sources += 'AlsaInputPlugin.cxx' + endif + +-libcdio_paranoia_dep = dependency('libcdio_paranoia', version: '>= 10.2+0.93+1', required: get_option('cdio_paranoia')) ++libcdio_paranoia_dep = dependency('libcdio_paranoia', required: get_option('cdio_paranoia')) + input_features.set('ENABLE_CDIO_PARANOIA', libcdio_paranoia_dep.found()) + if libcdio_paranoia_dep.found() + input_plugins_sources += 'CdioParanoiaInputPlugin.cxx' diff --git a/extra/mpd/mpd.confd b/extra/mpd/mpd.confd new file mode 100644 index 0000000..720306e --- /dev/null +++ b/extra/mpd/mpd.confd @@ -0,0 +1,7 @@ +# conf.d file for music player daemon + +# +# Specify daemon $OPTS here. +# + +OPTS="" diff --git a/extra/mpd/mpd.initd b/extra/mpd/mpd.initd new file mode 100644 index 0000000..817583c --- /dev/null +++ b/extra/mpd/mpd.initd @@ -0,0 +1,25 @@ +#!/sbin/openrc-run + +# init.d file for music player daemon + +supervisor=supervise-daemon + +name="Music Player Daemon" +description="A daemon for playing music" + +command=/usr/bin/mpd +command_args="$MPD_OPTS" +command_args_foreground="--no-daemon" + +command_user="${M_USER:-mpd}:${M_GROUP:-audio}" + +depend() { + need localmount + use net netmount nfsmount esound pulseaudio + after firewall +} + +start_pre() { + checkpath --directory --quiet \ + --owner "${M_USER:-mpd}" --mode 0775 /var/run/mpd +} diff --git a/extra/musl/0001-riscv64-define-ELF_NFPREG.patch b/extra/musl/0001-riscv64-define-ELF_NFPREG.patch new file mode 100644 index 0000000..b2f0a0f --- /dev/null +++ b/extra/musl/0001-riscv64-define-ELF_NFPREG.patch @@ -0,0 +1,24 @@ +From e5d2823631bbfebacf48e1a34ed28f28d7cb2570 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 11 Jan 2021 09:40:33 -0800 +Subject: [PATCH] riscv64: define ELF_NFPREG + +ELF_NFPREG is used by some userspace applications like gdb +--- + arch/riscv64/bits/user.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/riscv64/bits/user.h b/arch/riscv64/bits/user.h +index 2da743ea..0d37de0b 100644 +--- a/arch/riscv64/bits/user.h ++++ b/arch/riscv64/bits/user.h +@@ -1,5 +1,6 @@ + #include + + #define ELF_NGREG 32 ++#define ELF_NFPREG 33 + typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; + typedef union __riscv_mc_fp_state elf_fpregset_t; +-- +2.30.1 + diff --git a/extra/musl/change-scheduler-functions-Linux-compatib.patch b/extra/musl/change-scheduler-functions-Linux-compatib.patch new file mode 100644 index 0000000..fb63dfd --- /dev/null +++ b/extra/musl/change-scheduler-functions-Linux-compatib.patch @@ -0,0 +1,52 @@ +diff -uNr musl-1.2.2.orig/src/sched/sched_getparam.c musl-1.2.2/src/sched/sched_getparam.c +--- musl-1.2.2.orig/src/sched/sched_getparam.c 2021-01-15 02:26:00.000000000 +0000 ++++ musl-1.2.2/src/sched/sched_getparam.c 2021-12-23 00:31:16.590518270 +0000 +@@ -1,8 +1,7 @@ + #include +-#include + #include "syscall.h" + + int sched_getparam(pid_t pid, struct sched_param *param) + { +- return __syscall_ret(-ENOSYS); ++ return syscall(SYS_sched_getparam, pid, param); + } +diff -uNr musl-1.2.2.orig/src/sched/sched_getscheduler.c musl-1.2.2/src/sched/sched_getscheduler.c +--- musl-1.2.2.orig/src/sched/sched_getscheduler.c 2021-01-15 02:26:00.000000000 +0000 ++++ musl-1.2.2/src/sched/sched_getscheduler.c 2021-12-23 00:33:32.949520644 +0000 +@@ -1,8 +1,7 @@ + #include +-#include + #include "syscall.h" + + int sched_getscheduler(pid_t pid) + { +- return __syscall_ret(-ENOSYS); ++ return syscall(SYS_sched_getscheduler, pid); + } +diff -uNr musl-1.2.2.orig/src/sched/sched_setparam.c musl-1.2.2/src/sched/sched_setparam.c +--- musl-1.2.2.orig/src/sched/sched_setparam.c 2021-01-15 02:26:00.000000000 +0000 ++++ musl-1.2.2/src/sched/sched_setparam.c 2021-12-23 00:35:12.277522374 +0000 +@@ -1,8 +1,7 @@ + #include +-#include + #include "syscall.h" + + int sched_setparam(pid_t pid, const struct sched_param *param) + { +- return __syscall_ret(-ENOSYS); ++ return syscall(SYS_sched_setparam, pid, param); + } +diff -uNr musl-1.2.2.orig/src/sched/sched_setscheduler.c musl-1.2.2/src/sched/sched_setscheduler.c +--- musl-1.2.2.orig/src/sched/sched_setscheduler.c 2021-01-15 02:26:00.000000000 +0000 ++++ musl-1.2.2/src/sched/sched_setscheduler.c 2021-12-23 00:36:37.548523859 +0000 +@@ -1,8 +1,7 @@ + #include +-#include + #include "syscall.h" + + int sched_setscheduler(pid_t pid, int sched, const struct sched_param *param) + { +- return __syscall_ret(-ENOSYS); ++ return syscall(SYS_sched_setscheduler, pid, sched, param); + } diff --git a/extra/musl/fix-utmp-wtmp-paths.patch b/extra/musl/fix-utmp-wtmp-paths.patch new file mode 100644 index 0000000..900abc7 --- /dev/null +++ b/extra/musl/fix-utmp-wtmp-paths.patch @@ -0,0 +1,29 @@ +diff -uNr musl-1.2.2.orig/include/paths.h musl-1.2.2/include/paths.h +--- musl-1.2.2.orig/include/paths.h 2021-01-14 20:26:00.000000000 -0600 ++++ musl-1.2.2/include/paths.h 2021-08-26 16:39:31.355618388 -0500 +@@ -18,9 +18,9 @@ + #define _PATH_SHADOW "/etc/shadow" + #define _PATH_SHELLS "/etc/shells" + #define _PATH_TTY "/dev/tty" +-#define _PATH_UTMP "/dev/null/utmp" ++#define _PATH_UTMP "/run/utmps/utmp" + #define _PATH_VI "/usr/bin/vi" +-#define _PATH_WTMP "/dev/null/wtmp" ++#define _PATH_WTMP "/var/log/wtmp" + + #define _PATH_DEV "/dev/" + #define _PATH_TMP "/tmp/" +diff -uNr musl-1.2.2.orig/include/utmp.h musl-1.2.2/include/utmp.h +--- musl-1.2.2.orig/include/utmp.h 2021-01-14 20:26:00.000000000 -0600 ++++ musl-1.2.2/include/utmp.h 2021-08-26 16:37:11.567365982 -0500 +@@ -37,8 +37,8 @@ + + int login_tty(int); + +-#define _PATH_UTMP "/dev/null/utmp" +-#define _PATH_WTMP "/dev/null/wtmp" ++#define _PATH_UTMP "/run/utmps/utmp" ++#define _PATH_WTMP "/var/log/wtmp" + + #define UTMP_FILE _PATH_UTMP + #define WTMP_FILE _PATH_WTMP diff --git a/extra/musl/handle-aux-at_base.patch b/extra/musl/handle-aux-at_base.patch new file mode 100644 index 0000000..7c9f2dc --- /dev/null +++ b/extra/musl/handle-aux-at_base.patch @@ -0,0 +1,46 @@ +This is required to make the gcompat ELF interpreter stub work with some +packed binaries. + +diff --git a/src/env/__init_tls.c b/src/env/__init_tls.c +index b125eb1..616c6a6 100644 +--- a/src/env/__init_tls.c ++++ b/src/env/__init_tls.c +@@ -66,8 +66,10 @@ void *__copy_tls(unsigned char *mem) + } + + #if ULONG_MAX == 0xffffffff ++typedef Elf32_Ehdr Ehdr; + typedef Elf32_Phdr Phdr; + #else ++typedef Elf64_Ehdr Ehdr; + typedef Elf64_Phdr Phdr; + #endif + +@@ -77,15 +79,23 @@ extern const size_t _DYNAMIC[]; + static void static_init_tls(size_t *aux) + { + unsigned char *p; +- size_t n; ++ size_t n, e; + Phdr *phdr, *tls_phdr=0; + size_t base = 0; + void *mem; + +- for (p=(void *)aux[AT_PHDR],n=aux[AT_PHNUM]; n; n--,p+=aux[AT_PHENT]) { ++ if (aux[AT_BASE]) { ++ Ehdr *ehdr = (void *)aux[AT_BASE]; ++ p = (unsigned char *)aux[AT_BASE] + ehdr->e_phoff; ++ n = ehdr->e_phnum; ++ e = ehdr->e_phentsize; ++ } else { ++ p = (void *)aux[AT_PHDR]; ++ n = aux[AT_PHNUM]; ++ e = aux[AT_PHENT]; ++ } ++ for (; n; n--, p+=e) { + phdr = (void *)p; +- if (phdr->p_type == PT_PHDR) +- base = aux[AT_PHDR] - phdr->p_vaddr; + if (phdr->p_type == PT_DYNAMIC && _DYNAMIC) + base = (size_t)_DYNAMIC - phdr->p_vaddr; + if (phdr->p_type == PT_TLS) diff --git a/extra/musl/qsort_r.patch b/extra/musl/qsort_r.patch new file mode 100644 index 0000000..4ea6366 --- /dev/null +++ b/extra/musl/qsort_r.patch @@ -0,0 +1,213 @@ +Date: Tue, 9 Mar 2021 18:02:13 -0300 +From: Érico Nogueira +To: musl@...ts.openwall.com +Cc: Érico Nogueira +Subject: [PATCH v3] add qsort_r and make qsort a wrapper around it + +we make qsort a wrapper by providing a wrapper_cmp function that uses +the extra argument as a function pointer. should be optimized to a tail +call on most architectures, as long as it's built with +-fomit-frame-pointer, so the performance impact should be minimal. + +to keep the git history clean, for now qsort_r is implemented in qsort.c +and qsort is implemented in qsort_nr.c. qsort.c also received a few +trivial cleanups, including replacing (*cmp)() calls with cmp(). +qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper +itself. +--- + +Following suggestions from IRC, as few changes as possible to the files, +a final clean up commit after this one would involve some git mv's (I +won't make a patch for it). Added weak_alias to force qsort to use +libc's qsort_r. + +If this can't be accepted due to the overhead on some archs (ppc, mips, +arm in some situations?), maybe we could revisit v2 of the patch? + + include/stdlib.h | 1 + + src/include/stdlib.h | 1 + + src/stdlib/qsort.c | 37 ++++++++++++++++++++----------------- + src/stdlib/qsort_nr.c | 14 ++++++++++++++ + 4 files changed, 36 insertions(+), 17 deletions(-) + create mode 100644 src/stdlib/qsort_nr.c + +diff --git a/include/stdlib.h b/include/stdlib.h +index b54a051f..0c0ced5f 100644 +--- a/include/stdlib.h ++++ b/include/stdlib.h +@@ -158,6 +158,7 @@ struct __locale_struct; + float strtof_l(const char *__restrict, char **__restrict, struct __locale_struct *); + double strtod_l(const char *__restrict, char **__restrict, struct __locale_struct *); + long double strtold_l(const char *__restrict, char **__restrict, struct __locale_struct *); ++void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *); + #endif + + #if defined(_LARGEFILE64_SOURCE) || defined(_BSD_SOURCE) +diff --git a/src/include/stdlib.h b/src/include/stdlib.h +index e9da2015..812b04de 100644 +--- a/src/include/stdlib.h ++++ b/src/include/stdlib.h +@@ -8,6 +8,7 @@ hidden void __env_rm_add(char *, char *); + hidden int __mkostemps(char *, int, int); + hidden int __ptsname_r(int, char *, size_t); + hidden char *__randname(char *); ++hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *); + + hidden void *__libc_malloc(size_t); + hidden void *__libc_malloc_impl(size_t); +diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c +index da58fd31..20e40dda 100644 +--- a/src/stdlib/qsort.c ++++ b/src/stdlib/qsort.c +@@ -24,6 +24,7 @@ + /* Smoothsort, an adaptive variant of Heapsort. Memory usage: O(1). + Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */ + ++#define _BSD_SOURCE + #include + #include + #include +@@ -31,7 +32,7 @@ + #include "atomic.h" + #define ntz(x) a_ctz_l((x)) + +-typedef int (*cmpfun)(const void *, const void *); ++typedef int (*cmpfun)(const void *, const void *, void *); + + static inline int pntz(size_t p[2]) { + int r = ntz(p[0] - 1); +@@ -88,7 +89,7 @@ static inline void shr(size_t p[2], int n) + p[1] >>= n; + } + +-static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[]) ++static void sift(unsigned char *head, size_t width, cmpfun cmp, void *arg, int pshift, size_t lp[]) + { + unsigned char *rt, *lf; + unsigned char *ar[14 * sizeof(size_t) + 1]; +@@ -99,10 +100,10 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size + rt = head - width; + lf = head - width - lp[pshift - 2]; + +- if((*cmp)(ar[0], lf) >= 0 && (*cmp)(ar[0], rt) >= 0) { ++ if(cmp(ar[0], lf, arg) >= 0 && cmp(ar[0], rt, arg) >= 0) { + break; + } +- if((*cmp)(lf, rt) >= 0) { ++ if(cmp(lf, rt, arg) >= 0) { + ar[i++] = lf; + head = lf; + pshift -= 1; +@@ -115,7 +116,7 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size + cycle(width, ar, i); + } + +-static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[]) ++static void trinkle(unsigned char *head, size_t width, cmpfun cmp, void *arg, size_t pp[2], int pshift, int trusty, size_t lp[]) + { + unsigned char *stepson, + *rt, *lf; +@@ -130,13 +131,13 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], + ar[0] = head; + while(p[0] != 1 || p[1] != 0) { + stepson = head - lp[pshift]; +- if((*cmp)(stepson, ar[0]) <= 0) { ++ if(cmp(stepson, ar[0], arg) <= 0) { + break; + } + if(!trusty && pshift > 1) { + rt = head - width; + lf = head - width - lp[pshift - 2]; +- if((*cmp)(rt, stepson) >= 0 || (*cmp)(lf, stepson) >= 0) { ++ if(cmp(rt, stepson, arg) >= 0 || cmp(lf, stepson, arg) >= 0) { + break; + } + } +@@ -150,11 +151,11 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], + } + if(!trusty) { + cycle(width, ar, i); +- sift(head, width, cmp, pshift, lp); ++ sift(head, width, cmp, arg, pshift, lp); + } + } + +-void qsort(void *base, size_t nel, size_t width, cmpfun cmp) ++void __qsort_r(void *base, size_t nel, size_t width, cmpfun cmp, void *arg) + { + size_t lp[12*sizeof(size_t)]; + size_t i, size = width * nel; +@@ -173,16 +174,16 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp) + + while(head < high) { + if((p[0] & 3) == 3) { +- sift(head, width, cmp, pshift, lp); ++ sift(head, width, cmp, arg, pshift, lp); + shr(p, 2); + pshift += 2; + } else { + if(lp[pshift - 1] >= high - head) { +- trinkle(head, width, cmp, p, pshift, 0, lp); ++ trinkle(head, width, cmp, arg, p, pshift, 0, lp); + } else { +- sift(head, width, cmp, pshift, lp); ++ sift(head, width, cmp, arg, pshift, lp); + } +- ++ + if(pshift == 1) { + shl(p, 1); + pshift = 0; +@@ -191,12 +192,12 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp) + pshift = 1; + } + } +- ++ + p[0] |= 1; + head += width; + } + +- trinkle(head, width, cmp, p, pshift, 0, lp); ++ trinkle(head, width, cmp, arg, p, pshift, 0, lp); + + while(pshift != 1 || p[0] != 1 || p[1] != 0) { + if(pshift <= 1) { +@@ -208,11 +209,13 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp) + pshift -= 2; + p[0] ^= 7; + shr(p, 1); +- trinkle(head - lp[pshift] - width, width, cmp, p, pshift + 1, 1, lp); ++ trinkle(head - lp[pshift] - width, width, cmp, arg, p, pshift + 1, 1, lp); + shl(p, 1); + p[0] |= 1; +- trinkle(head - width, width, cmp, p, pshift, 1, lp); ++ trinkle(head - width, width, cmp, arg, p, pshift, 1, lp); + } + head -= width; + } + } ++ ++weak_alias(__qsort_r, qsort_r); +diff --git a/src/stdlib/qsort_nr.c b/src/stdlib/qsort_nr.c +new file mode 100644 +index 00000000..fe408fb1 +--- /dev/null ++++ b/src/stdlib/qsort_nr.c +@@ -0,0 +1,14 @@ ++#define _BSD_SOURCE ++#include ++ ++typedef int (*cmpfun)(const void *, const void *); ++ ++static int wrapper_cmp(const void *v1, const void *v2, void *cmp) ++{ ++ return ((cmpfun)cmp)(v1, v2); ++} ++ ++void qsort(void *base, size_t nel, size_t width, cmpfun cmp) ++{ ++ __qsort_r(base, nel, width, wrapper_cmp, cmp); ++} +-- +2.30.2 diff --git a/extra/musl/syscall-cp-epoll.patch b/extra/musl/syscall-cp-epoll.patch new file mode 100644 index 0000000..338620a --- /dev/null +++ b/extra/musl/syscall-cp-epoll.patch @@ -0,0 +1,16 @@ +diff --git a/src/linux/epoll.c b/src/linux/epoll.c +index deff5b10..93baa814 100644 +--- a/src/linux/epoll.c ++++ b/src/linux/epoll.c +@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev) + + int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs) + { +- int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8); ++ int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8); + #ifdef SYS_epoll_wait +- if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to); ++ if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to); + #endif + return __syscall_ret(r); + } diff --git a/extra/pango/disable-broken-test.patch b/extra/pango/disable-broken-test.patch new file mode 100644 index 0000000..db3d6c3 --- /dev/null +++ b/extra/pango/disable-broken-test.patch @@ -0,0 +1,15 @@ +--- a/tests/meson.build ++++ b/tests/meson.build +@@ -58,12 +58,6 @@ + [ 'testmisc', [ 'testmisc.c' ], [ libpangocairo_dep, libpangoft2_dep, glib_dep, harfbuzz_dep ] ], + [ 'testserialize', [ 'testserialize.c' ], [ libpangocairo_dep, libpangoft2_dep ] ], + ] +- +- if host_system != 'darwin' +- tests += [ +- [ 'test-layout', [ 'test-layout.c', 'test-common.c' ], [ libpangocairo_dep, libpangoft2_dep ] ], +- ] +- endif + endif + + if host_system != 'darwin' diff --git a/extra/procps-ng/procps-3.3.17-musl-fix.patch b/extra/procps-ng/procps-3.3.17-musl-fix.patch new file mode 100644 index 0000000..4402354 --- /dev/null +++ b/extra/procps-ng/procps-3.3.17-musl-fix.patch @@ -0,0 +1,78 @@ +Temporary stopgap patch (a different solution was used upstream +in the next release, should be in the next after 3.3.17 -- we'll need to +add --disable-w instead). + +https://bugs.gentoo.org/794997 + +From 7bfe2b7c12b33aabca71491360c433d2d3f7bbf4 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Wed, 24 Feb 2021 21:14:31 +0000 +Subject: [PATCH 1/2] w.c: correct musl builds + +No need to redefine UT_ stuff to something that does not exist. + +UT_ is already provided in musl but via utmp.h header, so include +it always. + +Signed-off-by: Alexander Kanavin +--- + w.c | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/w.c b/w.c +index 9d07ac9e..d10639b8 100644 +--- a/w.c ++++ b/w.c +@@ -57,9 +57,8 @@ + #include + #ifdef HAVE_UTMPX_H + # include +-#else +-# include + #endif ++#include + #include + + static int ignoreuser = 0; /* for '-u' */ +@@ -72,12 +71,6 @@ typedef struct utmpx utmp_t; + typedef struct utmp utmp_t; + #endif + +-#if !defined(UT_HOSTSIZE) || defined(__UT_HOSTSIZE) +-# define UT_HOSTSIZE __UT_HOSTSIZE +-# define UT_LINESIZE __UT_LINESIZE +-# define UT_NAMESIZE __UT_NAMESIZE +-#endif +- + #ifdef W_SHOWFROM + # define FROM_STRING "on" + #else +-- +GitLab + + +From 145165aba6c659f3f0f3567a323a3e6170408ea6 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Wed, 24 Feb 2021 21:16:14 +0000 +Subject: [PATCH 2/2] proc/escape.c: add missing include + +Signed-off-by: Alexander Kanavin +--- + proc/escape.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/proc/escape.c b/proc/escape.c +index 2e8fb7dd..e1f4612d 100644 +--- a/proc/escape.c ++++ b/proc/escape.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include "procps.h" + #include "escape.h" + #include "readproc.h" +-- +GitLab + diff --git a/extra/procps-ng/use_utmpx.patch b/extra/procps-ng/use_utmpx.patch new file mode 100644 index 0000000..ea9e9e2 --- /dev/null +++ b/extra/procps-ng/use_utmpx.patch @@ -0,0 +1,38 @@ +diff -uNr procps-3.3.17.orig/proc/whattime.c procps-3.3.17/proc/whattime.c +--- procps-3.3.17.orig/proc/whattime.c 2021-02-09 04:11:25.000000000 -0600 ++++ procps-3.3.17/proc/whattime.c 2021-03-19 13:40:17.910049032 -0500 +@@ -33,7 +33,7 @@ + #include + #include + #include +-#include ++#include + #include + #include "whattime.h" + #include "sysinfo.h" +@@ -42,7 +42,7 @@ + static double av[3]; + + char *sprint_uptime(int human_readable) { +- struct utmp *utmpstruct; ++ struct utmpx *utmpstruct; + int upminutes, uphours, updays, upweeks, upyears, updecades; + int pos; + int comma; +@@ -98,13 +98,13 @@ + /* count the number of users */ + + numuser = 0; +- setutent(); +- while ((utmpstruct = getutent())) { ++ setutxent(); ++ while ((utmpstruct = getutxent())) { + if ((utmpstruct->ut_type == USER_PROCESS) && + (utmpstruct->ut_name[0] != '\0')) + numuser++; + } +- endutent(); ++ endutxent(); + + pos += sprintf(buf + pos, "%2d user%s, ", numuser, numuser == 1 ? "" : "s"); + diff --git a/extra/rofi/rofi-sensible-terminal-use-sh.patch b/extra/rofi/rofi-sensible-terminal-use-sh.patch new file mode 100644 index 0000000..926aa7a --- /dev/null +++ b/extra/rofi/rofi-sensible-terminal-use-sh.patch @@ -0,0 +1,23 @@ +From 34d5779d41a902be21cef3fc3e70d8f6881ca05c Mon Sep 17 00:00:00 2001 +From: Jakub Jirutka +Date: Mon, 27 Sep 2021 01:00:43 +0200 +Subject: [PATCH] [rofi-sensible-terminal] Use /bin/sh instead of /usr/bin/env bash +Patch-Source: https://github.com/davatorium/rofi/pull/1478 + +This script is fully POSIX-sh compatible, i.e. it's portable and can be +run in any shell, not just bash. It's incorrect to assume that bash is +available on every *nix system (it's not), but /bin/sh is. +--- + script/rofi-sensible-terminal | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/script/rofi-sensible-terminal b/script/rofi-sensible-terminal +index 112e1d14e..e2b6cc4b9 100755 +--- a/script/rofi-sensible-terminal ++++ b/script/rofi-sensible-terminal +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/bin/sh + # + # This code is released in public domain by Han Boetes + # Updated by Dave Davenport diff --git a/extra/rofi/scrollbar-test.patch b/extra/rofi/scrollbar-test.patch new file mode 100644 index 0000000..40f9dec --- /dev/null +++ b/extra/rofi/scrollbar-test.patch @@ -0,0 +1,31 @@ +Subject: the test fails on x86 + +diff --git a/meson.build b/meson.build +index 6e1105a..f707cd9 100644 +--- a/meson.build ++++ b/meson.build +@@ -345,24 +345,6 @@ test('box test', executable('box.test', [ + dependencies: deps, + )) + +-test('scrollbar test', executable('scrollbar.test', [ +- 'test/scrollbar-test.c', +- theme_parser, +- theme_lexer, +- default_theme, +- ], +- objects: rofi.extract_objects([ +- 'source/widgets/widget.c', +- 'source/widgets/scrollbar.c', +- 'source/theme.c', +- 'source/css-colors.c', +- 'source/rofi-types.c', +- 'source/css-colors.c', +- 'config/config.c', +- ]), +- dependencies: deps, +-)) +- + test('textbox test', executable('textbox.test', [ + 'test/textbox-test.c', + theme_parser, diff --git a/extra/snappy/cmakelists.patch b/extra/snappy/cmakelists.patch new file mode 100644 index 0000000..9c16853 --- /dev/null +++ b/extra/snappy/cmakelists.patch @@ -0,0 +1,96 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -86,6 +86,8 @@ + # it prominent in the GUI. + option(BUILD_SHARED_LIBS "Build shared libraries(DLLs)." OFF) + ++option(BUILD_STATIC_LIBS "Build static libraries." ON) ++ + option(SNAPPY_BUILD_TESTS "Build Snappy's own tests." ON) + + option(SNAPPY_BUILD_BENCHMARKS "Build Snappy's benchmarks" ON) +@@ -98,6 +100,10 @@ + + option(SNAPPY_INSTALL "Install Snappy's header and library" ON) + ++if(NOT BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) ++ set(BUILD_STATIC_LIBS OFF) ++endif () ++ + include(TestBigEndian) + test_big_endian(SNAPPY_IS_BIG_ENDIAN) + +@@ -213,19 +219,28 @@ + "snappy-stubs-public.h.in" + "${PROJECT_BINARY_DIR}/snappy-stubs-public.h") + ++# When BUILD_SHARED_LIBS is: ++# ON it will generate a SHARED library ++# OFF it will generate a STATIC library + add_library(snappy "") +-target_sources(snappy +- PRIVATE ++ ++# Used to generate both lib types ++if (BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) ++ add_library(snappy_static STATIC "") ++ set_target_properties(snappy_static PROPERTIES OUTPUT_NAME snappy) ++ install(TARGETS snappy_static DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++endif () ++ ++set(SNAPPY_SOURCE_PRIVATE + "snappy-internal.h" + "snappy-stubs-internal.h" + "snappy-c.cc" + "snappy-sinksource.cc" + "snappy-stubs-internal.cc" + "snappy.cc" +- "${PROJECT_BINARY_DIR}/config.h" ++ "${PROJECT_BINARY_DIR}/config.h") + +- # Only CMake 3.3+ supports PUBLIC sources in targets exported by "install". +- $<$:PUBLIC> ++set(SNAPPY_SOURCE_PUBLIC + $ + $ + $ +@@ -233,18 +248,32 @@ + $ + $ + $ +- $ +-) +-target_include_directories(snappy +- PUBLIC ++ $) ++ ++set(SNAPPY_INCLUDE_DIRS + $ + $ +- $ +-) ++ $) ++ ++# Only CMake 3.3+ supports PUBLIC sources in targets exported by "install". ++target_sources(snappy PRIVATE ${SNAPPY_SOURCE_PRIVATE} ++ $<$:PUBLIC> ${SNAPPY_SOURCE_PUBLIC}) ++ ++target_include_directories(snappy PUBLIC ${SNAPPY_INCLUDE_DIRS}) ++ ++target_compile_definitions(snappy PRIVATE -DHAVE_CONFIG_H) ++ ++# Only CMake 3.3+ supports PUBLIC sources in targets exported by "install". ++target_sources(snappy_static PRIVATE ${SNAPPY_SOURCE_PRIVATE} ++ $<$:PUBLIC> ${SNAPPY_SOURCE_PUBLIC}) ++ ++target_include_directories(snappy_static PUBLIC ${SNAPPY_INCLUDE_DIRS}) ++ ++target_compile_definitions(snappy_static PRIVATE -DHAVE_CONFIG_H) ++ + set_target_properties(snappy + PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) + +-target_compile_definitions(snappy PRIVATE -DHAVE_CONFIG_H) + if(BUILD_SHARED_LIBS) + set_target_properties(snappy PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + endif(BUILD_SHARED_LIBS) diff --git a/extra/snappy/fix-inline.patch b/extra/snappy/fix-inline.patch new file mode 100644 index 0000000..96484e0 --- /dev/null +++ b/extra/snappy/fix-inline.patch @@ -0,0 +1,13 @@ +Patch-Source: https://github.com/google/snappy/pull/128 + +--- a/snappy.cc ++++ b/snappy.cc +@@ -1014,7 +1014,7 @@ + } + + SNAPPY_ATTRIBUTE_ALWAYS_INLINE +-size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { ++inline size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { + const uint8_t*& ip = *ip_p; + // This section is crucial for the throughput of the decompression loop. + // The latency of an iteration is fundamentally constrained by the diff --git a/extra/snappy/rtti.patch b/extra/snappy/rtti.patch new file mode 100644 index 0000000..77b8178 --- /dev/null +++ b/extra/snappy/rtti.patch @@ -0,0 +1 @@ +Too Many Requests \ No newline at end of file diff --git a/extra/tiff/CVE-2018-12900.patch b/extra/tiff/CVE-2018-12900.patch new file mode 100644 index 0000000..f95cd06 --- /dev/null +++ b/extra/tiff/CVE-2018-12900.patch @@ -0,0 +1,29 @@ +From 86861b86f26be5301ccfa96f9bf765051f4e644a Mon Sep 17 00:00:00 2001 +From: pgajdos +Date: Tue, 13 Nov 2018 09:03:31 +0100 +Subject: [PATCH] prevent integer overflow + +--- + tools/tiffcp.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/tools/tiffcp.c b/tools/tiffcp.c +index 2f406e2d..ece7ba13 100644 +--- a/tools/tiffcp.c ++++ b/tools/tiffcp.c +@@ -1435,6 +1435,12 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer) + status = 0; + goto done; + } ++ if (0xFFFFFFFF / tilew < spp) ++ { ++ TIFFError(TIFFFileName(in), "Error, either TileWidth (%u) or BitsPerSample (%u) is too large", tilew, bps); ++ status = 0; ++ goto done; ++ } + bytes_per_sample = bps/8; + + for (row = 0; row < imagelength; row += tl) { +-- +2.18.1 + diff --git a/extra/xdg-utils/xdg-screensaver-mv-T.patch b/extra/xdg-utils/xdg-screensaver-mv-T.patch new file mode 100644 index 0000000..9e209f7 --- /dev/null +++ b/extra/xdg-utils/xdg-screensaver-mv-T.patch @@ -0,0 +1,25 @@ +--- ./scripts/xdg-screensaver.in.orig ++++ ./scripts/xdg-screensaver.in +@@ -26,18 +26,10 @@ + + #@xdg-utils-common@ + +-# Check if we can use "mv -T" +-if mv -T ... ... 2>&1 | grep '\.\.\.' > /dev/null ; then +- # We can securely move files in /tmp with mv -T +- DEBUG 1 "mv -T available" +- MV="mv -T" +- screensaver_file="/tmp/xdg-screensaver-$USER-"`echo $DISPLAY | sed 's/:/-/g'` +-else +- # No secure moves available, use home dir +- DEBUG 1 "mv -T not available" +- MV="mv" +- screensaver_file="$HOME/.xdg-screensaver-"`echo $(hostname)-$DISPLAY | sed 's/:/-/g'` +-fi ++# No secure moves available, use home dir ++DEBUG 1 "mv -T not available" ++MV="mv" ++screensaver_file="$HOME/.xdg-screensaver-"`echo $(hostname)-$DISPLAY | sed 's/:/-/g'` + lockfile_command=`which lockfile 2> /dev/null` + + lockfile() -- cgit v1.2.1