···11-diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c
22---- a/rts/win32/OSMem.c
33-+++ b/rts/win32/OSMem.c
44-@@ -41,7 +41,7 @@ static block_rec* free_blocks = NULL;
55- typedef LPVOID(WINAPI *VirtualAllocExNumaProc)(HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD);
66-77- /* Cache NUMA API call. */
88--VirtualAllocExNumaProc VirtualAllocExNuma;
99-+VirtualAllocExNumaProc _VirtualAllocExNuma;
1010-1111- void
1212- osMemInit(void)
1313-@@ -52,8 +52,8 @@ osMemInit(void)
1414- /* Resolve and cache VirtualAllocExNuma. */
1515- if (osNumaAvailable() && RtsFlags.GcFlags.numa)
1616- {
1717-- VirtualAllocExNuma = (VirtualAllocExNumaProc)GetProcAddress(GetModuleHandleW(L"kernel32"), "VirtualAllocExNuma");
1818-- if (!VirtualAllocExNuma)
1919-+ _VirtualAllocExNuma = (VirtualAllocExNumaProc)(void*)GetProcAddress(GetModuleHandleW(L"kernel32"), "VirtualAllocExNuma");
2020-+ if (!_VirtualAllocExNuma)
2121- {
2222- sysErrorBelch(
2323- "osBindMBlocksToNode: VirtualAllocExNuma does not exist. How did you get this far?");
2424-@@ -569,7 +569,7 @@ void osBindMBlocksToNode(
2525- On windows also -xb is broken, it does nothing so that can't
2626- be used to tweak it (see #12577). So for now, just let the OS decide.
2727- */
2828-- temp = VirtualAllocExNuma(
2929-+ temp = _VirtualAllocExNuma(
3030- GetCurrentProcess(),
3131- NULL, // addr? See base memory
3232- size,
···11-From 8c747d3157df2830eed9205e7caf1203b345de17 Mon Sep 17 00:00:00 2001
22-From: Khem Raj <raj.khem@gmail.com>
33-Date: Sat, 4 Feb 2023 13:54:41 -0800
44-Subject: [PATCH] cmake: Enable 64bit off_t on 32bit glibc systems
55-66-Pass -D_FILE_OFFSET_BITS=64 to compiler flags on 32bit glibc based
77-systems. This will make sure that 64bit versions of LFS functions are
88-used e.g. seek will behave same as lseek64. Also revert [1] partially
99-because this added a cmake test to detect lseek64 but then forgot to
1010-pass the needed macro to actual compile, this test was incomplete too
1111-since libc implementations like musl has 64bit off_t by default on 32bit
1212-systems and does not bundle[2] -D_LARGEFILE64_SOURCE under -D_GNU_SOURCE
1313-like glibc, which means the compile now fails on musl because the cmake
1414-check passes but we do not have _LARGEFILE64_SOURCE defined. Using the
1515-*64 function was transitional anyways so use -D_FILE_OFFSET_BITS=64
1616-instead
1717-1818-[1] https://github.com/llvm/llvm-project/commit/8db7e5e4eed4c4e697dc3164f2c9351d8c3e942b
1919-[2] https://git.musl-libc.org/cgit/musl/commit/?id=25e6fee27f4a293728dd15b659170e7b9c7db9bc
2020-2121-Reviewed By: MaskRay
2222-2323-Differential Revision: https://reviews.llvm.org/D139752
2424-2525-(cherry picked from commit 5cd554303ead0f8891eee3cd6d25cb07f5a7bf67)
2626----
2727- cmake/config-ix.cmake | 13 ++++++++++---
2828- include/llvm/Config/config.h.cmake | 3 ---
2929- lib/Support/raw_ostream.cpp | 2 --
3030- 3 files changed, 10 insertions(+), 8 deletions(-)
3131-3232-diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
3333-index 18977d9950ff..b558aa83fa62 100644
3434---- a/cmake/config-ix.cmake
3535-+++ b/cmake/config-ix.cmake
3636-@@ -197,9 +197,6 @@ check_symbol_exists(posix_fallocate fcntl.h HAVE_POSIX_FALLOCATE)
3737- if( HAVE_SIGNAL_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*" AND NOT APPLE )
3838- check_symbol_exists(sigaltstack signal.h HAVE_SIGALTSTACK)
3939- endif()
4040--set(CMAKE_REQUIRED_DEFINITIONS "-D_LARGEFILE64_SOURCE")
4141--check_symbol_exists(lseek64 "sys/types.h;unistd.h" HAVE_LSEEK64)
4242--set(CMAKE_REQUIRED_DEFINITIONS "")
4343- check_symbol_exists(mallctl malloc_np.h HAVE_MALLCTL)
4444- check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO)
4545- check_symbol_exists(malloc_zone_statistics malloc/malloc.h
4646-@@ -237,6 +234,16 @@ if( PURE_WINDOWS )
4747- check_function_exists(__main HAVE___MAIN)
4848- check_function_exists(__cmpdi2 HAVE___CMPDI2)
4949- endif()
5050-+
5151-+check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
5252-+if( LLVM_USING_GLIBC )
5353-+# enable 64bit off_t on 32bit systems using glibc
5454-+ if (CMAKE_SIZEOF_VOID_P EQUAL 4)
5555-+ add_compile_definitions(_FILE_OFFSET_BITS=64)
5656-+ list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
5757-+ endif()
5858-+endif()
5959-+
6060- if( HAVE_DLFCN_H )
6161- if( HAVE_LIBDL )
6262- list(APPEND CMAKE_REQUIRED_LIBRARIES dl)
6363-diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake
6464-index e934617d7ec7..3c39c373b3c1 100644
6565---- a/include/llvm/Config/config.h.cmake
6666-+++ b/include/llvm/Config/config.h.cmake
6767-@@ -112,9 +112,6 @@
6868- /* Define to 1 if you have the <link.h> header file. */
6969- #cmakedefine HAVE_LINK_H ${HAVE_LINK_H}
7070-7171--/* Define to 1 if you have the `lseek64' function. */
7272--#cmakedefine HAVE_LSEEK64 ${HAVE_LSEEK64}
7373--
7474- /* Define to 1 if you have the <mach/mach.h> header file. */
7575- #cmakedefine HAVE_MACH_MACH_H ${HAVE_MACH_MACH_H}
7676-7777-diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
7878-index 038ad00bd608..921ab8409008 100644
7979---- a/lib/Support/raw_ostream.cpp
8080-+++ b/lib/Support/raw_ostream.cpp
8181-@@ -677,8 +677,6 @@ uint64_t raw_fd_ostream::seek(uint64_t off) {
8282- flush();
8383- #ifdef _WIN32
8484- pos = ::_lseeki64(FD, off, SEEK_SET);
8585--#elif defined(HAVE_LSEEK64)
8686-- pos = ::lseek64(FD, off, SEEK_SET);
8787- #else
8888- pos = ::lseek(FD, off, SEEK_SET);
8989- #endif
9090---
9191-2.37.1
9292-
-16
pkgs/os-specific/linux/lxc/support-db2x.patch
···11-diff --git a/configure.ac b/configure.ac
22-index 84f8699..dce9033 100644
33---- a/configure.ac
44-+++ b/configure.ac
55-@@ -192,9 +192,9 @@ if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
66- AC_SUBST(db2xman)
77- fi
88- AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$db2xman" != "x"])
99--AM_CONDITIONAL([USE_DOCBOOK2X], [test "x$db2xman" != "xdocbook2man"])
1010-+AM_CONDITIONAL([USE_DOCBOOK2X], [test "x$db2xman" != "no-no-no"])
1111-1212--if test "x$db2xman" = "xdocbook2man"; then
1313-+if test "x$db2xman" = "no-no-no"; then
1414- docdtd="\"-//Davenport//DTD DocBook V3.0//EN\""
1515- else
1616- docdtd="\"-//OASIS//DTD DocBook XML\" \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\""