Commit: b0ad3f0c529ec276e5df588401eae1a269de690b Parent: 64fb7370804684cbbb23b3768cf2039fc74b462b Author: Randy Palamar Date: Sun, 11 Jan 2026 16:41:38 -0700 media-gfx/renderdoc: bump to v1.42 Diffstat:
16 files changed, 1067 insertions(+), 505 deletions(-)
diff --git a/media-gfx/renderdoc/Manifest b/media-gfx/renderdoc/Manifest @@ -1,3 +1,3 @@ -DIST renderdoc-1.37.tar.gz 52008341 BLAKE2B 1ba4024dd80e6aaa3b5af240ca52cd8de671d315ea1a115013ef00a534bdb04fe17fc5a0c4719f34e3c29bd0b60d3dee5861ad36f9e4779d4ca37d7d366e23bf SHA512 34f435575c311b46c6cafa719b4a1c509a6420397e08e97c150fc46bb207da1476d085dcaffee8413726ab4d35ae77ef7f5089a16c5e2718a8cc54fd6b52fd32 -DIST renderdoc-1.37.tar.gz.asc 833 BLAKE2B 58dd0e7363110d4717fcd8ba15d98ce4c5ca53e547d3460dca55af0f8c4ce67afc52ff57ab0b85988f903463f3b1dd3c21a3f8dec6f2faaaa39d968d586fdf91 SHA512 c14f5ad1082366567331989de6f47bf3d31dd749fdd2f6df92ad894acedee45bf35957ba95c5d14aa20b03401a7fcf94c2db12e914d5b1de8d4c25bf76457852 +DIST renderdoc-1.42.tar.gz 53671049 BLAKE2B 467d2e09ad505f8a8b5d48d25ed88153c8190ead32b029a3c2752c92267641f84299b1edd03cc082a97a63252f6b313b2ecdc62830b8899c4a53c25d22a60576 SHA512 7aba03e72e9533a84cb3bffeabe49c2729ac9e2be29bf4b98ea27c8985de6ba1386e29057d5d5ab629751284f037eccfe657dd0bb46abb3f5f8de33157df8401 +DIST renderdoc-1.42.tar.gz.asc 833 BLAKE2B f8759ab50107dde1ba97449cf80fe36ae8c365a97df7a4d798aac1a5432581d9ee6e11a0c769ad425ffe729209cd407227cca44e29b2b96952e4a2836dc60eca SHA512 2b23988254cee8970896a96d2544d3b7e452765900c388e07399002d47b9f9cacaa579c8bd7ef56c578ac2fefe87a8cbdbad9942142ee31ce085f759d79ceccd DIST swig-renderdoc-7.tar.gz 4006241 BLAKE2B 619f41239f4aef496264d61f44ae042cf80d3ff28491d452cf11ad07e898554c4a32df6119ee0e8e3de36e6bee61855358cd968ad01c9281976e24e9a6cac839 SHA512 5285a65924c069cfb9f73104ad8a95251badac4001293a1757b97ebead5953730c03289159741f82da4c5afe4f61f7c826b105eaf82df044ed2fa21810242c86 diff --git a/media-gfx/renderdoc/files/0001-linux-fix-build-against-musl.patch b/media-gfx/renderdoc/files/0001-linux-fix-build-against-musl.patch @@ -0,0 +1,88 @@ +From 957c73f8ca768be1442998b23e491fa327586df8 Mon Sep 17 00:00:00 2001 +From: Randy Palamar <randy@rnpnr.xyz> +Date: Tue, 4 Mar 2025 15:12:11 -0700 +Subject: [PATCH 1/7] linux: fix build against musl + +--- + renderdoc/3rdparty/plthook/plthook_elf.c | 6 +++++- + renderdoc/os/os_specific.h | 1 + + renderdoc/os/posix/linux/linux_callstack.cpp | 3 +-- + renderdoc/os/posix/linux/linux_hook.cpp | 4 ++++ + 4 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/renderdoc/3rdparty/plthook/plthook_elf.c b/renderdoc/3rdparty/plthook/plthook_elf.c +index d170d8ea4..32db79bc4 100644 +--- a/renderdoc/3rdparty/plthook/plthook_elf.c ++++ b/renderdoc/3rdparty/plthook/plthook_elf.c +@@ -240,7 +240,11 @@ int plthook_open_by_address(plthook_t **plthook_out, void *address) + struct link_map *lmap = NULL; + + *plthook_out = NULL; ++#ifdef __GLIBC__ + if (dladdr1(address, &info, (void**)&lmap, RTLD_DL_LINKMAP) == 0) { ++#else ++ if (dladdr(address, &info) == 0) { ++#endif + set_errmsg("dladdr error"); + return PLTHOOK_FILE_NOT_FOUND; + } +@@ -250,7 +254,7 @@ int plthook_open_by_address(plthook_t **plthook_out, void *address) + + static int plthook_open_executable(plthook_t **plthook_out) + { +-#if defined __linux__ ++#if defined __linux__ && defined __GLIBC__ + return plthook_open_real(plthook_out, _r_debug.r_map); + #elif defined __sun + const char *auxv_file = "/proc/self/auxv"; +diff --git a/renderdoc/os/os_specific.h b/renderdoc/os/os_specific.h +index c5884d5ac..671a9aa1b 100644 +--- a/renderdoc/os/os_specific.h ++++ b/renderdoc/os/os_specific.h +@@ -31,6 +31,7 @@ + + #pragma once + ++#include <time.h> + #include <stdarg.h> + #include <stddef.h> + #include <stdint.h> +diff --git a/renderdoc/os/posix/linux/linux_callstack.cpp b/renderdoc/os/posix/linux/linux_callstack.cpp +index 6d8e49584..08df12150 100644 +--- a/renderdoc/os/posix/linux/linux_callstack.cpp ++++ b/renderdoc/os/posix/linux/linux_callstack.cpp +@@ -27,7 +27,6 @@ + #define _GNU_SOURCE + #endif + +-#include <execinfo.h> + #include <link.h> + #include <stdio.h> + #include <string.h> +@@ -66,7 +65,7 @@ private: + { + void *addrs_ptr[ARRAY_COUNT(addrs)]; + +- int ret = backtrace(addrs_ptr, ARRAY_COUNT(addrs)); ++ int ret = 0; + + numLevels = 0; + if(ret > 0) +diff --git a/renderdoc/os/posix/linux/linux_hook.cpp b/renderdoc/os/posix/linux/linux_hook.cpp +index cf97cd6da..bce59abf8 100644 +--- a/renderdoc/os/posix/linux/linux_hook.cpp ++++ b/renderdoc/os/posix/linux/linux_hook.cpp +@@ -36,6 +36,10 @@ + #include "plthook/plthook.h" + #include "strings/string_utils.h" + ++#ifndef __GLIBC__ ++#define RTLD_DEEPBIND 0 ++#endif ++ + Threading::CriticalSection libLock; + + RDOC_EXTERN_CONFIG(bool, Linux_Debug_PtraceLogging); +-- +2.49.0 + diff --git a/media-gfx/renderdoc/files/0002-Rework-injection-and-synchronisaion-on-linux.patch b/media-gfx/renderdoc/files/0002-Rework-injection-and-synchronisaion-on-linux.patch @@ -0,0 +1,613 @@ +From 3b7262d27ad5437bb085cb7dee8e3bd483a1127b Mon Sep 17 00:00:00 2001 +From: Jules Maselbas <jmaselbas@zdiv.net> +Date: Mon, 22 Jan 2024 17:55:21 +0100 +Subject: [PATCH 2/7] Rework injection and synchronisaion on linux + +--- + renderdoc/os/posix/linux/linux_hook.cpp | 3 - + renderdoc/os/posix/linux/linux_network.cpp | 6 +- + renderdoc/os/posix/linux/linux_process.cpp | 512 +-------------------- + renderdoc/os/posix/posix_process.cpp | 5 +- + 4 files changed, 13 insertions(+), 513 deletions(-) + +diff --git a/renderdoc/os/posix/linux/linux_hook.cpp b/renderdoc/os/posix/linux/linux_hook.cpp +index bce59abf8..ca0e5aeb6 100644 +--- a/renderdoc/os/posix/linux/linux_hook.cpp ++++ b/renderdoc/os/posix/linux/linux_hook.cpp +@@ -103,7 +103,6 @@ void PreForkConfigureHooks(); + void GetUnhookedEnvp(char *const *envp, rdcstr &envpStr, rdcarray<char *> &modifiedEnv); + void GetHookedEnvp(char *const *envp, rdcstr &envpStr, rdcarray<char *> &modifiedEnv); + void ResetHookingEnvVars(); +-void StopAtMainInChild(); + bool StopChildAtMain(pid_t childPid, bool *exitWithNoExec); + void ResumeProcess(pid_t childPid, uint32_t delay = 0); + int direct_setenv(const char *name, const char *value, int overwrite); +@@ -317,8 +316,6 @@ __attribute__((visibility("default"))) pid_t fork() + { + if(Linux_Debug_PtraceLogging()) + RDCLOG("hooked fork() in child %d", getpid()); +- +- StopAtMainInChild(); + } + else if(ret > 0) + { +diff --git a/renderdoc/os/posix/linux/linux_network.cpp b/renderdoc/os/posix/linux/linux_network.cpp +index 6cff47696..897fbe9a3 100644 +--- a/renderdoc/os/posix/linux/linux_network.cpp ++++ b/renderdoc/os/posix/linux/linux_network.cpp +@@ -25,6 +25,8 @@ + #include "os/os_specific.h" + #include "os/posix/posix_network.h" + ++void StopAtMainInChild(); ++ + namespace Network + { + void SocketPostSend() +@@ -39,6 +41,8 @@ uint32_t Socket::GetRemoteIP() const + + Socket *CreateServerSocket(const rdcstr &bindaddr, uint16_t port, int queuesize) + { +- return CreateTCPServerSocket(bindaddr, port, queuesize); ++ Socket *s = CreateTCPServerSocket(bindaddr, port, queuesize); ++ StopAtMainInChild(); ++ return s; + } + }; +diff --git a/renderdoc/os/posix/linux/linux_process.cpp b/renderdoc/os/posix/linux/linux_process.cpp +index fffffc078..3aa774814 100644 +--- a/renderdoc/os/posix/linux/linux_process.cpp ++++ b/renderdoc/os/posix/linux/linux_process.cpp +@@ -164,519 +164,21 @@ int GetIdentPort(pid_t childPid) + return ret; + } + +-static bool ptrace_scope_ok() +-{ +- if(!Linux_PtraceChildProcesses()) +- return false; +- +- rdcstr contents; +- FileIO::ReadAll("/proc/sys/kernel/yama/ptrace_scope", contents); +- contents.trim(); +- if(!contents.empty()) +- { +- int ptrace_scope = atoi(contents.c_str()); +- if(ptrace_scope > 1) +- { +- if(RenderDoc::Inst().IsReplayApp()) +- { +- static bool warned = false; +- if(!warned) +- { +- warned = true; +- RDCWARN( +- "ptrace_scope value %d means ptrace can't be used to pause child processes while " +- "attaching.", +- ptrace_scope); +- } +- } +- return false; +- } +- } +- +- return true; +-} +- +-static uint64_t get_nanotime() +-{ +- timespec ts; +- clock_gettime(CLOCK_MONOTONIC, &ts); +- uint64_t ret = uint64_t(ts.tv_sec) * 1000000000ULL + uint32_t(ts.tv_nsec & 0xffffffff); +- return ret; +-} +- +-#if defined(__arm__) +- +-// for some reason arm doesn't have the same struct name. Sigh :( +-#define user_regs_struct user_regs +- +-#define INST_PTR_REG ARM_pc +- +-#define BREAK_INST 0xe7f001f0ULL +-#define BREAK_INST_BYTES_SIZE 4 +-// on ARM seemingly the instruction isn't actually considered executed, so we don't have to modify +-// the instruction pointer at all. +-#define BREAK_INST_INST_PTR_ADJUST 0 +- +-#elif defined(__aarch64__) +- +-#define INST_PTR_REG pc +- +-#define BREAK_INST 0xd4200000ULL +-#define BREAK_INST_BYTES_SIZE 4 +-// on ARM seemingly the instruction isn't actually considered executed, so we don't have to modify +-// the instruction pointer at all. +-#define BREAK_INST_INST_PTR_ADJUST 0 +- +-#elif defined(__riscv) +- +-#define INST_PTR_REG pc +- +-// ebreak +-#define BREAK_INST 0x00100073ULL +-#define BREAK_INST_BYTES_SIZE 4 +-#define BREAK_INST_INST_PTR_ADJUST 4 +- +-#elif defined(__loongarch64) +-#define INST_PTR_REG csr_era +-// ebreak +-#define BREAK_INST 0x150000ULL +-#define BREAK_INST_BYTES_SIZE 4 +-#define BREAK_INST_INST_PTR_ADJUST 4 +- +-#else +- +-#define BREAK_INST 0xccULL +-#define BREAK_INST_BYTES_SIZE 1 +-// step back over the instruction +-#define BREAK_INST_INST_PTR_ADJUST 1 +- +-#if ENABLED(RDOC_X64) +-#define INST_PTR_REG rip +-#else +-#define INST_PTR_REG eip +-#endif +- +-#endif +- +-static uint64_t get_child_ip(pid_t childPid) +-{ +- user_regs_struct regs = {}; +- +- iovec regs_iovec = {®s, sizeof(regs)}; +- long ptraceRet = ptrace(PTRACE_GETREGSET, childPid, (void *)NT_PRSTATUS, ®s_iovec); +- if(ptraceRet == 0) +- return uint64_t(regs.INST_PTR_REG); +- +- return 0; +-} +- +-static bool wait_traced_child(pid_t childPid, uint32_t timeoutMS, int &status) +-{ +- // spin waiting for the traced child, with a 100ms timeout +- status = 0; +- uint64_t start_nano = get_nanotime(); +- uint64_t end_nano = 0; +- int ret = 0; +- +- const uint64_t timeoutNanoseconds = uint64_t(timeoutMS) * 1000 * 1000; +- +- while((ret = waitpid(childPid, &status, WNOHANG)) == 0) +- { +- status = 0; +- +- // if we're in a capturing process then the process itself might have done waitpid(-1) and +- // swallowed the wait for our child. So as an alternative we check to see if we can query the +- // instruction pointer, which is only possible if the child is stopped. +- uint64_t ip = get_child_ip(childPid); +- if(ip != 0) +- { +- // do waitpid again in case we raced and the child stopped in between the call to waitpid and +- // get_child_ip. +- ret = waitpid(childPid, &status, WNOHANG); +- +- // if it still didn't succeed, set status to 0 so we know we're earlying out and don't check +- // the status codes. +- if(ret == 0) +- status = 0; +- return true; +- } +- +- usleep(10); +- +- // check the timeout +- end_nano = get_nanotime(); +- if(end_nano - start_nano > timeoutNanoseconds) +- break; +- } +- +- return WIFSTOPPED(status); +-} +- + bool StopChildAtMain(pid_t childPid, bool *exitWithNoExec) + { +- // don't do this unless the ptrace scope is OK. +- if(!ptrace_scope_ok()) +- return false; ++ int stat; ++ pid_t pid = waitpid(childPid, &stat, WUNTRACED); ++ return pid == childPid && WIFSTOPPED(stat); ++} + +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Stopping child PID %u at main", childPid); +- +- int childStatus = 0; +- +- // we have a low timeout for this stop since it should happen almost immediately (right after the +- // fork). If it didn't then we want to fail relatively fast. +- if(!wait_traced_child(childPid, 100, childStatus)) +- { +- RDCERR("Didn't get initial stop from child PID %u", childPid); +- return false; +- } +- +- if(childStatus > 0 && WSTOPSIG(childStatus) != SIGSTOP) +- { +- RDCERR("Initial signal from child PID %u was %x, expected %x", childPid, WSTOPSIG(childStatus), +- SIGSTOP); +- return false; +- } +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Child PID %u is stopped in StopAtMainInChild()", childPid); +- +- int64_t ptraceRet = 0; +- +- // continue until exec +- ptraceRet = ptrace(PTRACE_SETOPTIONS, childPid, NULL, PTRACE_O_TRACEEXEC | PTRACE_O_TRACEEXIT); +- RDCASSERTEQUAL(ptraceRet, 0); +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Child PID %u configured to trace exec(). Continuing child", childPid); +- +- // continue +- ptraceRet = ptrace(PTRACE_CONT, childPid, NULL, NULL); +- RDCASSERTEQUAL(ptraceRet, 0); +- +- // we're not under control of when the application calls exec() after fork() in the case of child +- // processes, so be a little more generous with the timeout +- if(!wait_traced_child(childPid, 250, childStatus)) +- { +- RDCERR("Didn't get to execve in child PID %u", childPid); +- return false; +- } +- +- int statusResult = childStatus >> 8; +- +- if(childStatus > 0 && +- (statusResult == SIGCHLD || statusResult == (SIGTRAP | (PTRACE_EVENT_EXIT << 8)))) +- { +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Child PID %u exited while waiting for exec() 0x%x", childPid, childStatus); +- if(exitWithNoExec) +- *exitWithNoExec = true; +- +- if(statusResult == SIGCHLD) +- ptrace(PTRACE_DETACH, childPid, NULL, SIGCHLD); +- else +- ptrace(PTRACE_DETACH, childPid, NULL, NULL); +- return false; +- } +- +- if(childStatus > 0 && statusResult != (SIGTRAP | (PTRACE_EVENT_EXEC << 8))) +- { +- RDCERR("Exec wait event from child PID %u was status 0x%x, expected 0x%x", childPid, +- statusResult, (SIGTRAP | (PTRACE_EVENT_EXEC << 8))); +- +- return false; +- } +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Child PID %u is stopped at execve() 0x%x", childPid, childStatus); +- +- rdcstr exepath; +- long baseVirtualPointer = 0; +- uint32_t sectionOffset = 0; +- +- rdcstr mapsName = StringFormat::Fmt("/proc/%u/maps", childPid); +- +- FILE *maps = FileIO::fopen(mapsName, FileIO::ReadText); +- +- if(!maps) +- { +- RDCERR("Couldn't open %s", mapsName.c_str()); +- return false; +- } +- +- while(!feof(maps)) +- { +- char line[512] = {0}; +- if(fgets(line, 511, maps)) +- { +- char *sp = strchr(line, ' '); +- if(sp == NULL) +- continue; +- +- sp++; +- +- if(!strncmp(sp, "r-xp", 4)) +- { +- RDCCOMPILE_ASSERT(sizeof(long) == sizeof(void *), "Expected long to be pointer sized"); +- int pathOffset = 0; +- int num = sscanf(line, "%lx-%*x r-xp %x %*x:%*x %*u %n", &baseVirtualPointer, +- §ionOffset, &pathOffset); +- +- if(num != 2 || pathOffset == 0) +- { +- RDCERR("Couldn't parse first executable mapping '%s'", rdcstr(line).trimmed().c_str()); +- return false; +- } +- +- exepath = line + pathOffset; +- exepath.trim(); +- break; +- } +- } +- } +- +- if(baseVirtualPointer == 0) +- { +- RDCERR("Couldn't find executable mapping in maps file"); +- return false; +- } +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Child PID %u has exepath %s basePointer 0x%llx and sectionOffset 0x%x", childPid, +- exepath.c_str(), (uint64_t)baseVirtualPointer, (uint32_t)sectionOffset); +- +- FileIO::fclose(maps); +- +- FILE *elf = FileIO::fopen(exepath, FileIO::ReadText); +- +- if(!elf) +- { +- RDCERR("Couldn't open %s to parse ELF header", exepath.c_str()); +- return false; +- } +- +- Elf64_Ehdr elf_header; +- size_t read = FileIO::fread(&elf_header, sizeof(elf_header), 1, elf); +- +- if(read != 1) +- { +- FileIO::fclose(elf); +- RDCERR("Couldn't read ELF header from %s", exepath.c_str()); +- return false; +- } +- +- size_t entryVirtual = (size_t)elf_header.e_entry; +- // if the section doesn't shift between file offset and virtual address this will be the same +- size_t entryFileOffset = entryVirtual; +- +- if(elf_header.e_shoff) +- { +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("exepath %s contains sections, rebasing to correct section", exepath.c_str()); +- +- FileIO::fseek64(elf, elf_header.e_shoff, SEEK_SET); +- +- RDCASSERTEQUAL(elf_header.e_shentsize, sizeof(Elf64_Shdr)); +- +- for(Elf64_Half s = 0; s < elf_header.e_shnum; s++) +- { +- Elf64_Shdr section_header; +- read = FileIO::fread(§ion_header, sizeof(section_header), 1, elf); +- +- if(read != 1) +- { +- FileIO::fclose(elf); +- RDCERR("Couldn't read section header from %s", exepath.c_str()); +- return false; +- } +- +- if(section_header.sh_addr <= entryVirtual && +- entryVirtual < section_header.sh_addr + section_header.sh_size) +- { +- if(Linux_Debug_PtraceLogging()) +- RDCLOG( +- "Found section in %s from 0x%llx - 0x%llx at offset 0x%llx containing entry 0x%llx.", +- exepath.c_str(), (uint64_t)section_header.sh_addr, +- uint64_t(section_header.sh_addr + section_header.sh_size), +- (uint64_t)section_header.sh_offset, (uint64_t)entryVirtual); +- +- entryFileOffset = +- (entryVirtual - (size_t)section_header.sh_addr) + (size_t)section_header.sh_offset; +- +- break; +- } +- } +- } +- +- FileIO::fclose(elf); +- +- void *entry = (void *)(baseVirtualPointer + entryFileOffset - sectionOffset); +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("child process %u executable %s has entry %p at 0x%llx + (0x%llx - 0x%x)", childPid, +- exepath.c_str(), entry, (uint64_t)baseVirtualPointer, (uint64_t)entryFileOffset, +- (uint32_t)sectionOffset); +- +- // this reads a 'word' and returns as long, upcast (if needed) to uint64_t +- uint64_t origEntryWord = (uint64_t)ptrace(PTRACE_PEEKTEXT, childPid, entry, 0); +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Read word %llx from %p in child process %u running executable %s", +- (uint64_t)origEntryWord, entry, childPid, exepath.c_str()); +- +- uint64_t breakpointWord = +- (origEntryWord & (0xffffffffffffffffULL << (BREAK_INST_BYTES_SIZE * 8))) | BREAK_INST; +- // downcast back to long, if that means truncating +- ptraceRet = ptrace(PTRACE_POKETEXT, childPid, entry, (long)breakpointWord); +- RDCASSERTEQUAL(ptraceRet, 0); +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Changed word to %llx and re-poked in process %u. Continuing child", +- (uint64_t)breakpointWord, childPid); +- +- // continue +- ptraceRet = ptrace(PTRACE_CONT, childPid, NULL, NULL); +- RDCASSERTEQUAL(ptraceRet, 0); +- +- // it could take a long time to hit main so we have a large timeout here +- if(!wait_traced_child(childPid, 2000, childStatus)) +- { +- RDCERR("Didn't hit breakpoint in PID %u (%x)", childPid, childStatus); +- return false; +- } +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Process %u hit entry point", childPid); +- +- // we're now at main! now just need to clean up after ourselves +- +- user_regs_struct regs = {}; +- +- iovec regs_iovec = {®s, sizeof(regs)}; +- ptraceRet = ptrace(PTRACE_GETREGSET, childPid, (void *)NT_PRSTATUS, ®s_iovec); +- RDCASSERTEQUAL(ptraceRet, 0); +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Process %u instruction pointer is at %llx, for entry point %p", childPid, +- (uint64_t)(regs.INST_PTR_REG), entry); +- +- // step back past the byte(s) we inserted the breakpoint on +- regs.INST_PTR_REG -= BREAK_INST_INST_PTR_ADJUST; +- ptraceRet = ptrace(PTRACE_SETREGSET, childPid, (void *)NT_PRSTATUS, ®s_iovec); +- RDCASSERTEQUAL(ptraceRet, 0); +- +- // restore the function +- ptraceRet = ptrace(PTRACE_POKETEXT, childPid, entry, origEntryWord); +- RDCASSERTEQUAL(ptraceRet, 0); +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Process %u instruction pointer adjusted and breakpoint removed.", childPid); +- +- // we'll resume after reading the ident port in the calling function +- return true; ++void ResumeProcess(pid_t childPid, uint32_t delay = 0) ++{ ++ kill(childPid, SIGCONT); + } + + void StopAtMainInChild() + { +- // don't do this unless the ptrace scope is OK. +- if(!ptrace_scope_ok()) +- return; +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Stopping in main at child for ptracing"); +- +- // allow parent tracing, and immediately stop so the parent process can attach +- ptrace(PTRACE_TRACEME, 0, 0, 0); +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Done PTRACE_TRACEME, raising SIGSTOP"); +- + raise(SIGSTOP); +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Resumed after SIGSTOP"); +-} +- +-void ResumeProcess(pid_t childPid, uint32_t delaySeconds) +-{ +- if(!ptrace_scope_ok()) +- return; +- +- if(childPid != 0) +- { +- // if we have a delay, see if the process is paused. If so then detach it but keep it stopped +- // and wait to see if someone attaches +- if(delaySeconds > 0) +- { +- uint64_t ip = get_child_ip(childPid); +- +- if(ip != 0) +- { +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Detaching %u with SIGSTOP to allow a debugger to attach, waiting %u seconds", +- childPid, delaySeconds); +- +- // detach but stop, to allow a debugger to attach +- ptrace(PTRACE_DETACH, childPid, NULL, SIGSTOP); +- +- rdcstr filename = StringFormat::Fmt("/proc/%u/status", childPid); +- +- uint64_t start_nano = get_nanotime(); +- uint64_t end_nano = 0; +- +- const uint64_t timeoutNanoseconds = uint64_t(delaySeconds) * 1000 * 1000 * 1000; +- +- bool connected = false; +- +- // watch for a tracer to attach +- do +- { +- usleep(10); +- +- rdcstr status; +- FileIO::ReadAll(filename, status); +- +- int32_t offs = status.find("TracerPid:"); +- +- if(offs < 0) +- break; +- +- status.erase(0, offs + sizeof("TracerPid:")); +- status.trim(); +- +- end_nano = get_nanotime(); +- +- if(status[0] != '0') +- { +- RDCLOG("Debugger PID %u attached after %f seconds", atoi(status.c_str()), +- double(end_nano - start_nano) / 1000000000.0); +- connected = true; +- break; +- } +- } while(end_nano - start_nano < timeoutNanoseconds); +- +- if(!connected) +- { +- RDCLOG("Timed out waiting for debugger, resuming"); +- kill(childPid, SIGCONT); +- } +- return; +- } +- else +- { +- RDCERR("Can't delay for debugger without ptrace, check ptrace_scope value"); +- } +- } +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Detaching immediately from %u", childPid); +- +- // try to detach and resume the process, ignoring any errors if we weren't tracing +- long ret = ptrace(PTRACE_DETACH, childPid, NULL, NULL); +- +- if(Linux_Debug_PtraceLogging()) +- RDCLOG("Detached pid %u (%ld)", childPid, ret); +- } + } + + // because OSUtility::DebuggerPresent is called often we want it to be +diff --git a/renderdoc/os/posix/posix_process.cpp b/renderdoc/os/posix/posix_process.cpp +index c8a3bdb35..ff969bf04 100644 +--- a/renderdoc/os/posix/posix_process.cpp ++++ b/renderdoc/os/posix/posix_process.cpp +@@ -447,7 +447,7 @@ static void CleanupStringArray(char **arr) + + while(*arr) + { +- delete[] * arr; ++ delete[] *arr; + arr++; + } + +@@ -608,9 +608,6 @@ static pid_t RunProcess(rdcstr appName, rdcstr workDir, const rdcstr &cmdLine, c + childPid = fork(); + if(childPid == 0) + { +- if(pauseAtMain) +- StopAtMainInChild(); +- + FileIO::ReleaseFDAfterFork(); + if(stdoutPipe) + { +-- +2.49.0 + diff --git a/media-gfx/renderdoc/files/0003-build-qrenderdoc-Respect-CXX-and-LDFLAGS.patch b/media-gfx/renderdoc/files/0003-build-qrenderdoc-Respect-CXX-and-LDFLAGS.patch @@ -0,0 +1,26 @@ +From 840c402b4c448978d71eadbc83e8baf677214079 Mon Sep 17 00:00:00 2001 +From: Matthew Smith <matt@offtopica.uk> +Date: Tue, 8 Feb 2022 18:42:02 +0000 +Subject: [PATCH 3/7] build: qrenderdoc: Respect CXX and LDFLAGS + +--- + qrenderdoc/CMakeLists.txt | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt +index ef1234dd4..e7ec27c85 100644 +--- a/qrenderdoc/CMakeLists.txt ++++ b/qrenderdoc/CMakeLists.txt +@@ -216,7 +216,9 @@ file(WRITE + "QMAKE_LINK=${CMAKE_CXX_COMPILER}\n" + "QMAKE_CXXFLAGS+=${warning_flags}\n" + "QMAKE_CXXFLAGS+=${QMAKE_CXXFLAGS}\n" ++ "QMAKE_CXXFLAGS+=${CMAKE_CXX_FLAGS}\n" + "QMAKE_LFLAGS+=${QMAKE_LDFLAGS}\n" ++ "QMAKE_LFLAGS+=${CMAKE_EXE_LINKER_FLAGS}\n" + "QMAKE_RPATHDIR+=${QMAKE_RPATHDIR}\n" + "\n" + "LIB_SUFFIX=${LIB_SUFFIX}\n" +-- +2.49.0 + diff --git a/media-gfx/renderdoc/files/0004-always-use-HOME-env-variable-for-home-directory.patch b/media-gfx/renderdoc/files/0004-always-use-HOME-env-variable-for-home-directory.patch @@ -0,0 +1,29 @@ +From 26d0688292ba1d04e85903fb1d528c94843ba18e Mon Sep 17 00:00:00 2001 +From: Randy Palamar <randy@rnpnr.xyz> +Date: Sun, 11 Jan 2026 15:56:44 -0700 +Subject: [PATCH 4/7] always use HOME env variable for home directory + +--- + renderdoc/os/posix/linux/linux_stringio.cpp | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/renderdoc/os/posix/linux/linux_stringio.cpp b/renderdoc/os/posix/linux/linux_stringio.cpp +index 423263cf5..ba9dcdb6b 100644 +--- a/renderdoc/os/posix/linux/linux_stringio.cpp ++++ b/renderdoc/os/posix/linux/linux_stringio.cpp +@@ -595,11 +595,7 @@ rdcstr GetTempRootPath() + + rdcstr GetAppFolderFilename(const rdcstr &filename) + { +- passwd *pw = getpwuid(getuid()); +- rdcstr homedir = pw ? pw->pw_dir : ""; +- +- if(homedir.empty()) +- homedir = Process::GetEnvVariable("HOME"); ++ rdcstr homedir = Process::GetEnvVariable("HOME"); + + if(homedir.empty()) + { +-- +2.49.0 + diff --git a/media-gfx/renderdoc/files/0005-build-Only-search-for-PySide2-if-required.patch b/media-gfx/renderdoc/files/0005-build-Only-search-for-PySide2-if-required.patch @@ -0,0 +1,54 @@ +From 67d9c6cc8c4fd6414b06b520e525786d4c88fa74 Mon Sep 17 00:00:00 2001 +From: Matthew Smith <matt@offtopica.uk> +Date: Sun, 20 Feb 2022 09:19:03 +0000 +Subject: [PATCH 5/7] build: Only search for PySide2 if required + +--- + qrenderdoc/CMakeLists.txt | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) + +diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt +index e7ec27c85..ec80912b7 100644 +--- a/qrenderdoc/CMakeLists.txt ++++ b/qrenderdoc/CMakeLists.txt +@@ -193,9 +193,6 @@ ExternalProject_Add(custom_swig + BUILD_COMMAND ${GENERATOR_MAKE} ${GENERATOR_MAKE_PARAMS} > /dev/null 2>&1 + INSTALL_COMMAND ${GENERATOR_MAKE} install > /dev/null 2>&1) + +-find_package(Shiboken2 QUIET) +-find_package(PySide2 QUIET) +- + set(PYTHON_LINK "${PYTHON_LIBRARY}") + + # ensure we link the whole python library so that modules have all the exports they need +@@ -308,7 +305,13 @@ option(QRENDERDOC_ENABLE_PYSIDE2 "Enable PySide2 if found" ON) + + if(NOT QRENDERDOC_ENABLE_PYSIDE2) + message(STATUS "PySide2 integration disabled") +-elseif(PySide2_FOUND AND Shiboken2_FOUND AND TARGET Shiboken2::libshiboken AND TARGET PySide2::pyside2) ++ file(APPEND ++ ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri ++ "DEFINES+=PYSIDE2_ENABLED=0\n") ++else() ++ find_package(Shiboken2 QUIET REQUIRED) ++ find_package(PySide2 QUIET REQUIRED) ++ + message(STATUS "Building with PySide2 ${PySide2_VERSION} from ${PySide2_DIR}") + + if(NOT PYTHONLIBS_VERSION_STRING MATCHES "${SHIBOKEN_PYTHON_VERSION_MAJOR}.${SHIBOKEN_PYTHON_VERSION_MINOR}") +@@ -337,12 +340,6 @@ elseif(PySide2_FOUND AND Shiboken2_FOUND AND TARGET Shiboken2::libshiboken AND T + "DEFINES+=PYSIDE2_ENABLED=1\n" + "DEFINES+=PYSIDE2_SYS_PATH=${PYSIDE_PYTHONPATH}\n" + "LIBS+=-lshiboken2${SHIBOKEN_PYTHON_SHARED_LIBRARY_SUFFIX}\n") +-else() +- message(STATUS "PySide2 not found - Qt will not be accessible in python scripting. See https://github.com/baldurk/renderdoc/wiki/PySide2") +- +- file(APPEND +- ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri +- "DEFINES+=PYSIDE2_ENABLED=0\n") + endif() + + # generate the SWIG interface files +-- +2.49.0 + diff --git a/media-gfx/renderdoc/files/0006-Remove-undefined-symbols-from-version-script.patch b/media-gfx/renderdoc/files/0006-Remove-undefined-symbols-from-version-script.patch @@ -0,0 +1,35 @@ +From dac55b78304ed2ac9cd69c897f5f26be41aea4b5 Mon Sep 17 00:00:00 2001 +From: Randy Palamar <randy@rnpnr.xyz> +Date: Sun, 11 Jan 2026 15:59:09 -0700 +Subject: [PATCH 6/7] Remove undefined symbols from version script. + +Bug: https://bugs.gentoo.org/925578 +--- + renderdoc/renderdoc.version | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/renderdoc/renderdoc.version b/renderdoc/renderdoc.version +index 5b0e0e535..b9cf54498 100644 +--- a/renderdoc/renderdoc.version ++++ b/renderdoc/renderdoc.version +@@ -6,17 +6,14 @@ + egl[A-Z]*; + vk_icd*; + dlopen; +- dlsym; + fork; + execl; + execlp; + execle; +- execlpe; + execv; + execvp; + execve; + execvpe; +- _exit; + RENDERDOC_*; + VK_LAYER_RENDERDOC_*; + local: +-- +2.49.0 + diff --git a/media-gfx/renderdoc/files/0007-analytics-Default-selection-to-off.patch b/media-gfx/renderdoc/files/0007-analytics-Default-selection-to-off.patch @@ -0,0 +1,29 @@ +From e0953da30edc7c57ff9e09dc525e8bc2e9dcbeec Mon Sep 17 00:00:00 2001 +From: Randy Palamar <randy@rnpnr.xyz> +Date: Sun, 11 Jan 2026 16:04:48 -0700 +Subject: [PATCH 7/7] analytics: Default selection to off + +--- + qrenderdoc/Code/Interface/PersistantConfig.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/qrenderdoc/Code/Interface/PersistantConfig.h b/qrenderdoc/Code/Interface/PersistantConfig.h +index 0a4d4e0a3..154c6e53f 100644 +--- a/qrenderdoc/Code/Interface/PersistantConfig.h ++++ b/qrenderdoc/Code/Interface/PersistantConfig.h +@@ -631,10 +631,10 @@ DECLARE_REFLECTION_STRUCT(BugReport); + "``True`` if the user has selected to completely opt-out from and disable all analytics " \ + "collection and reporting.\n" \ + "\n" \ +- "Defaults to ``False``." \ ++ "Defaults to ``True``." \ + "" \ + ":type: bool"); \ +- CONFIG_SETTING_VAL(public, bool, bool, Analytics_TotalOptOut, false) \ ++ CONFIG_SETTING_VAL(public, bool, bool, Analytics_TotalOptOut, true) \ + \ + DOCUMENT( \ + "``True`` if the user has remained with analytics turned on, but has chosen to manually " \ +-- +2.49.0 + diff --git a/media-gfx/renderdoc/files/renderdoc-1.18-analytics-off.patch b/media-gfx/renderdoc/files/renderdoc-1.18-analytics-off.patch @@ -1,52 +0,0 @@ -From 03d5a1f515bee326933e163eb3bd300deb4a5753 Mon Sep 17 00:00:00 2001 -From: Matthew Smith <matt@offtopica.uk> -Date: Sun, 6 Feb 2022 09:54:17 +0000 -Subject: [PATCH 3/5] analytics: Default selection to off - ---- - qrenderdoc/Code/Interface/PersistantConfig.h | 4 ++-- - qrenderdoc/Windows/Dialogs/AnalyticsPromptDialog.ui | 6 +++--- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/qrenderdoc/Code/Interface/PersistantConfig.h b/qrenderdoc/Code/Interface/PersistantConfig.h -index 5c074d27d..e37ecb3ce 100644 ---- a/qrenderdoc/Code/Interface/PersistantConfig.h -+++ b/qrenderdoc/Code/Interface/PersistantConfig.h -@@ -588,8 +588,8 @@ DECLARE_REFLECTION_STRUCT(BugReport); - "``True`` if the user has selected to completely opt-out from and disable all analytics " \ - "collection and reporting.\n" \ - "\n" \ -- "Defaults to ``False``."); \ -- CONFIG_SETTING_VAL(public, bool, bool, Analytics_TotalOptOut, false) \ -+ "Defaults to ``True``."); \ -+ CONFIG_SETTING_VAL(public, bool, bool, Analytics_TotalOptOut, true) \ - \ - DOCUMENT( \ - "``True`` if the user has remained with analytics turned on, but has chosen to manually " \ -diff --git a/qrenderdoc/Windows/Dialogs/AnalyticsPromptDialog.ui b/qrenderdoc/Windows/Dialogs/AnalyticsPromptDialog.ui -index 5ec558161..e43574165 100644 ---- a/qrenderdoc/Windows/Dialogs/AnalyticsPromptDialog.ui -+++ b/qrenderdoc/Windows/Dialogs/AnalyticsPromptDialog.ui -@@ -38,9 +38,6 @@ - <property name="text"> - <string>Gather anonymous low-detail statistics and submit automatically.</string> - </property> -- <property name="checked"> -- <bool>true</bool> -- </property> - </widget> - </item> - <item> -@@ -55,6 +52,9 @@ - <property name="text"> - <string>Do not gather or submit any statistics.</string> - </property> -+ <property name="checked"> -+ <bool>true</bool> -+ </property> - </widget> - </item> - </layout> --- -2.35.1 - diff --git a/media-gfx/renderdoc/files/renderdoc-1.18-conditional-pyside.patch b/media-gfx/renderdoc/files/renderdoc-1.18-conditional-pyside.patch @@ -1,54 +0,0 @@ -From e6c0ee16967d3aa79f645a5a0aad0d50c20987f4 Mon Sep 17 00:00:00 2001 -From: Matthew Smith <matt@offtopica.uk> -Date: Sun, 20 Feb 2022 09:19:03 +0000 -Subject: [PATCH] build: Only search for PySide2 if required - ---- - qrenderdoc/CMakeLists.txt | 17 +++++++---------- - 1 file changed, 7 insertions(+), 10 deletions(-) - -diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt -index 05ad8ba89..e4470715e 100644 ---- a/qrenderdoc/CMakeLists.txt -+++ b/qrenderdoc/CMakeLists.txt -@@ -154,9 +154,6 @@ ExternalProject_Add(custom_swig - BUILD_COMMAND ${GENERATOR_MAKE} ${GENERATOR_MAKE_PARAMS} > /dev/null 2>&1 - INSTALL_COMMAND ${GENERATOR_MAKE} install > /dev/null 2>&1) - --find_package(Shiboken2 QUIET) --find_package(PySide2 QUIET) -- - set(PYTHON_LINK "${PYTHON_LIBRARY}") - - # ensure we link the whole python library so that modules have all the exports they need -@@ -251,7 +248,13 @@ option(QRENDERDOC_ENABLE_PYSIDE2 "Enable PySide2 if found" ON) - - if(NOT QRENDERDOC_ENABLE_PYSIDE2) - message(STATUS "PySide2 integration disabled") --elseif(PySide2_FOUND AND Shiboken2_FOUND AND TARGET Shiboken2::libshiboken AND TARGET PySide2::pyside2) -+ file(APPEND -+ ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri -+ "DEFINES+=PYSIDE2_ENABLED=0\n") -+else() -+ find_package(Shiboken2 QUIET REQUIRED) -+ find_package(PySide2 QUIET REQUIRED) -+ - message(STATUS "Building with PySide2 ${PySide2_VERSION} from ${PySide2_DIR}") - - if(NOT PYTHONLIBS_VERSION_STRING MATCHES "${SHIBOKEN_PYTHON_VERSION_MAJOR}.${SHIBOKEN_PYTHON_VERSION_MINOR}") -@@ -280,12 +283,6 @@ elseif(PySide2_FOUND AND Shiboken2_FOUND AND TARGET Shiboken2::libshiboken AND T - "DEFINES+=PYSIDE2_ENABLED=1\n" - "DEFINES+=PYSIDE2_SYS_PATH=${PYSIDE_PYTHONPATH}\n" - "LIBS+=-lshiboken2${SHIBOKEN_PYTHON_SHARED_LIBRARY_SUFFIX}\n") --else() -- message(STATUS "PySide2 not found - Qt will not be accessible in python scripting. See https://github.com/baldurk/renderdoc/wiki/PySide2") -- -- file(APPEND -- ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri -- "DEFINES+=PYSIDE2_ENABLED=0\n") - endif() - - # generate the SWIG interface files --- -2.35.1 - diff --git a/media-gfx/renderdoc/files/renderdoc-1.18-system-flags.patch b/media-gfx/renderdoc/files/renderdoc-1.18-system-flags.patch @@ -1,26 +0,0 @@ -From f83fea90e09d368cd3d8e119a2b3a6d7352d6de6 Mon Sep 17 00:00:00 2001 -From: Matthew Smith <matt@offtopica.uk> -Date: Tue, 8 Feb 2022 18:42:02 +0000 -Subject: [PATCH] build: qrenderdoc: Respect CXX and LDFLAGS - ---- - qrenderdoc/CMakeLists.txt | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt -index 486832594..05ad8ba89 100644 ---- a/qrenderdoc/CMakeLists.txt -+++ b/qrenderdoc/CMakeLists.txt -@@ -177,7 +177,9 @@ file(WRITE - "QMAKE_LINK=${CMAKE_CXX_COMPILER}\n" - "QMAKE_CXXFLAGS+=${warning_flags}\n" - "QMAKE_CXXFLAGS+=${QMAKE_CXXFLAGS}\n" -+ "QMAKE_CXXFLAGS+=${CMAKE_CXX_FLAGS}\n" - "QMAKE_LFLAGS+=${QMAKE_LDFLAGS}\n" -+ "QMAKE_LFLAGS+=${CMAKE_EXE_LINKER_FLAGS}\n" - "QMAKE_RPATHDIR+=${QMAKE_RPATHDIR}\n" - "\n" - "LIB_SUFFIX=${LIB_SUFFIX}\n" --- -2.35.1 - diff --git a/media-gfx/renderdoc/files/renderdoc-1.27-env-home.patch b/media-gfx/renderdoc/files/renderdoc-1.27-env-home.patch @@ -1,15 +0,0 @@ ---- a/renderdoc/os/posix/linux/linux_stringio.cpp -+++ b/renderdoc/os/posix/linux/linux_stringio.cpp -@@ -595,11 +595,7 @@ rdcstr GetTempRootPath() - - rdcstr GetAppFolderFilename(const rdcstr &filename) - { -- passwd *pw = getpwuid(getuid()); -- rdcstr homedir = pw ? pw->pw_dir : ""; -- -- if(homedir.empty()) -- homedir = Process::GetEnvVariable("HOME"); -+ rdcstr homedir = Process::GetEnvVariable("HOME"); - - if(homedir.empty()) - { diff --git a/media-gfx/renderdoc/files/renderdoc-1.30-r1-system-compress.patch b/media-gfx/renderdoc/files/renderdoc-1.30-r1-system-compress.patch @@ -1,142 +0,0 @@ -From 8f16c974fc8ec0b286d803490baa6e00a83615cf Mon Sep 17 00:00:00 2001 -From: Matthew Smith <matt@offtopica.uk> -Date: Sun, 30 Jan 2022 18:07:51 +0000 -Subject: [PATCH 2/3] build: Use system compression libs - ---- - CMakeLists.txt | 6 +++ - renderdoc/CMakeLists.txt | 48 +------------------ - renderdoc/core/replay_proxy.cpp | 2 +- - .../driver/shaders/dxbc/dxbc_container.cpp | 2 +- - renderdoc/serialise/lz4io.h | 2 +- - 5 files changed, 10 insertions(+), 50 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cb0a2c7f6..0ee4fc629 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -473,6 +473,12 @@ - endif() - endif() - -+find_package(PkgConfig REQUIRED) -+find_package(miniz REQUIRED CONFIG) -+ -+pkg_check_modules(lz4 REQUIRED IMPORTED_TARGET liblz4) -+pkg_check_modules(zstd REQUIRED IMPORTED_TARGET libzstd) -+ - add_subdirectory(renderdoc) - - # these variables are handled within the CMakeLists.txt in qrenderdoc, -diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt -index 927e95fb9..5908be6de 100644 ---- a/renderdoc/CMakeLists.txt -+++ b/renderdoc/CMakeLists.txt -@@ -218,56 +218,10 @@ set(sources - 3rdparty/pugixml/pugixml.cpp - 3rdparty/pugixml/pugixml.hpp - 3rdparty/pugixml/pugiconfig.hpp -- 3rdparty/lz4/lz4.c -- 3rdparty/lz4/lz4.h - 3rdparty/md5/md5.c - 3rdparty/md5/md5.h -- 3rdparty/miniz/miniz.c -- 3rdparty/miniz/miniz.h - 3rdparty/superluminal/superluminal.cpp - 3rdparty/superluminal/superluminal.h -- 3rdparty/zstd/bitstream.h -- 3rdparty/zstd/compiler.h -- 3rdparty/zstd/cpu.h -- 3rdparty/zstd/debug.c -- 3rdparty/zstd/debug.h -- 3rdparty/zstd/entropy_common.c -- 3rdparty/zstd/error_private.c -- 3rdparty/zstd/error_private.h -- 3rdparty/zstd/fse.h -- 3rdparty/zstd/fse_compress.c -- 3rdparty/zstd/fse_decompress.c -- 3rdparty/zstd/hist.c -- 3rdparty/zstd/hist.h -- 3rdparty/zstd/huf.h -- 3rdparty/zstd/huf_compress.c -- 3rdparty/zstd/huf_decompress.c -- 3rdparty/zstd/mem.h -- 3rdparty/zstd/pool.c -- 3rdparty/zstd/pool.h -- 3rdparty/zstd/threading.c -- 3rdparty/zstd/threading.h -- 3rdparty/zstd/xxhash.c -- 3rdparty/zstd/xxhash.h -- 3rdparty/zstd/zstd.h -- 3rdparty/zstd/zstd_common.c -- 3rdparty/zstd/zstd_compress.c -- 3rdparty/zstd/zstd_compress_internal.h -- 3rdparty/zstd/zstd_decompress.c -- 3rdparty/zstd/zstd_double_fast.c -- 3rdparty/zstd/zstd_double_fast.h -- 3rdparty/zstd/zstd_errors.h -- 3rdparty/zstd/zstd_fast.c -- 3rdparty/zstd/zstd_fast.h -- 3rdparty/zstd/zstd_internal.h -- 3rdparty/zstd/zstd_lazy.c -- 3rdparty/zstd/zstd_lazy.h -- 3rdparty/zstd/zstd_ldm.c -- 3rdparty/zstd/zstd_ldm.h -- 3rdparty/zstd/zstd_opt.c -- 3rdparty/zstd/zstd_opt.h -- 3rdparty/zstd/zstdmt_compress.c -- 3rdparty/zstd/zstdmt_compress.h - 3rdparty/stb/stb_image.h - 3rdparty/stb/stb_image_write.h - 3rdparty/stb/stb_image_resize.h -@@ -580,7 +534,7 @@ endif() - add_library(renderdoc SHARED ${renderdoc_objects}) - target_compile_definitions(renderdoc ${RDOC_DEFINITIONS}) - target_include_directories(renderdoc ${RDOC_INCLUDES}) --target_link_libraries(renderdoc ${RDOC_LIBRARIES}) -+target_link_libraries(renderdoc ${RDOC_LIBRARIES} miniz::miniz PkgConfig::lz4 PkgConfig::zstd) - - add_dependencies(renderdoc renderdoc_libentry) - -diff --git a/renderdoc/core/replay_proxy.cpp b/renderdoc/core/replay_proxy.cpp -index dea1e86cf..c9362e797 100644 ---- a/renderdoc/core/replay_proxy.cpp -+++ b/renderdoc/core/replay_proxy.cpp -@@ -25,7 +25,7 @@ - - #include "replay_proxy.h" - #include <list> --#include "lz4/lz4.h" -+#include <lz4.h> - #include "replay/dummy_driver.h" - #include "serialise/lz4io.h" - -diff --git a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp -index ede1fdeb7..0c8fd4dfe 100644 ---- a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp -+++ b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp -@@ -29,7 +29,7 @@ - #include "common/common.h" - #include "core/settings.h" - #include "driver/shaders/dxil/dxil_bytecode.h" --#include "lz4/lz4.h" -+#include <lz4.h> - #include "md5/md5.h" - #include "serialise/serialiser.h" - #include "strings/string_utils.h" -diff --git a/renderdoc/serialise/lz4io.h b/renderdoc/serialise/lz4io.h -index 199fbbbc1..80fdf94f2 100644 ---- a/renderdoc/serialise/lz4io.h -+++ b/renderdoc/serialise/lz4io.h -@@ -24,7 +24,7 @@ - - #pragma once - --#include "lz4/lz4.h" -+#include <lz4.h> - #include "streamio.h" - - class LZ4Compressor : public Compressor --- -2.35.1 - diff --git a/media-gfx/renderdoc/files/renderdoc-1.31-lld.patch b/media-gfx/renderdoc/files/renderdoc-1.31-lld.patch @@ -1,23 +0,0 @@ -Remove undefined symbols from version script. - -Bug: https://bugs.gentoo.org/925578 ---- a/renderdoc/renderdoc.version -+++ b/renderdoc/renderdoc.version -@@ -6,17 +6,14 @@ - egl[A-Z]*; - vk_icd*; - dlopen; -- dlsym; - fork; - execl; - execlp; - execle; -- execlpe; - execv; - execvp; - execve; - execvpe; -- _exit; - RENDERDOC_*; - VK_LAYER_RENDERDOC_*; - local: diff --git a/media-gfx/renderdoc/renderdoc-1.37-r1.ebuild b/media-gfx/renderdoc/renderdoc-1.37-r1.ebuild @@ -1,191 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -# The swig fork is required for compatibility with both provided and -# 3rd-party Python scripts. Required patch was sent to upstream in -# 2014: https://github.com/swig/swig/pull/251 -MY_SWIG_VER=7 -MY_SWIG=swig-${PN}-${MY_SWIG_VER} - -AUTOTOOLS_AUTO_DEPEND="no" -DOCS_BUILDER="sphinx" -DOCS_DIR="docs" -PYTHON_COMPAT=( python3_{9..13} ) -inherit autotools cmake flag-o-matic optfeature python-single-r1 docs qmake-utils verify-sig xdg - -DESCRIPTION="A stand-alone graphics debugging tool" -HOMEPAGE="https://renderdoc.org https://github.com/baldurk/renderdoc" -SRC_URI=" - https://github.com/baldurk/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz - qt5? ( https://github.com/baldurk/swig/archive/${PN}-modified-${MY_SWIG_VER}.tar.gz -> ${MY_SWIG}.tar.gz ) - verify-sig? ( https://github.com/baldurk/renderdoc/releases/download/v${PV}/v${PV}.tar.gz.asc -> ${P}.tar.gz.asc ) -" - -# renderdoc: MIT -# + cmdline: BSD (not compatible with upstream lib) -# + farm fresh icons: CC-BY-3.0 -# + half: MIT (not compatible with system dev-libs/half) -# + include-bin ZLIB (upstream doesn't exist anymore, maintained in tree) -# + md5: public-domain -# + plthook: BSD-2 -# + pugixml: MIT -# + radeon gpu analyzer: MIT -# + source code pro: OFL-1.1 -# + stb: public-domain -# + tinyfiledialogs: ZLIB -# + glslang: BSD -# + docs? ( sphinx.paramlinks: MIT ) -# swig: GPL-3+ BSD BSD-2 -LICENSE="BSD BSD-2 CC-BY-3.0 GPL-3+ MIT OFL-1.1 public-domain ZLIB" -SLOT="0" -KEYWORDS="amd64 arm64" -IUSE="qt5" -REQUIRED_USE="doc? ( qt5 ) qt5? ( ${PYTHON_REQUIRED_USE} )" - -RDEPEND=" - app-arch/lz4:= - app-arch/zstd:= - dev-libs/miniz:= - x11-libs/libX11 - x11-libs/libxcb:= - x11-libs/xcb-util-keysyms - virtual/opengl - qt5? ( - ${PYTHON_DEPS} - dev-qt/qtcore:5 - dev-qt/qtgui:5 - dev-qt/qtnetwork:5[ssl] - dev-qt/qtsvg:5 - dev-qt/qtwidgets:5 - dev-qt/qtx11extras:5 - ) -" -DEPEND="${RDEPEND}" -# qtcore provides qmake, which is required to build the qrenderdoc gui. -BDEPEND=" - x11-base/xorg-proto - virtual/pkgconfig - qt5? ( - ${AUTOTOOLS_DEPEND} - ${PYTHON_DEPS} - dev-libs/libpcre - dev-qt/qtcore:5 - app-alternatives/yacc - ) - verify-sig? ( sec-keys/openpgp-keys-baldurkarlsson ) -" - -PATCHES=( - # The analytics seem very reasonable, and even without this patch - # they are NOT sent before the user accepts. But default the - # selection to off, just in case. - "${FILESDIR}"/${PN}-1.18-analytics-off.patch - - # Only search for PySide2 if pyside2 USE flag is set. - # Bug #833627 - "${FILESDIR}"/${PN}-1.18-conditional-pyside.patch - - # Pass CXXFLAGS and LDFLAGS through to qmake when qrenderdoc is - # built. - "${FILESDIR}"/${PN}-1.18-system-flags.patch - - # Needed to prevent sandbox violations during build. - "${FILESDIR}"/${PN}-1.27-env-home.patch - - "${FILESDIR}"/${PN}-1.30-r1-system-compress.patch - - # Bug #925578 - "${FILESDIR}"/${PN}-1.31-lld.patch -) - -DOCS=( util/LINUX_DIST_README ) - -VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/baldurkarlsson.gpg - -pkg_setup() { - use qt5 && python-single-r1_pkg_setup -} - -src_unpack() { - if use verify-sig; then - verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc} - fi - - # Do not unpack the swig sources here. CMake will do that if - # required. - unpack ${P}.tar.gz -} - -src_prepare() { - cmake_src_prepare - - # Remove the calls to install the documentation files. Instead, - # install them with einstalldocs. - sed -i '/share\/doc\/renderdoc/d' \ - "${S}"/CMakeLists.txt "${S}"/qrenderdoc/CMakeLists.txt \ - || die 'sed remove doc install failed' - - # Assumes that the build directory is "${S}"/build, which it is not. - sed -i "s|../build/lib|${BUILD_DIR}/lib|" \ - "${S}"/docs/conf.py \ - || die 'sed patch doc sys.path failed' - - # Bug #836235 - sed -i '/#include <stdarg/i #include <time.h>' \ - "${S}"/renderdoc/os/os_specific.h \ - || die 'sed include time.h failed' -} - -src_configure() { - local mycmakeargs=( - # Build system does not know that this is a tagged release, as - # we just have the tarball and not the git repository. - -DBUILD_VERSION_STABLE=ON - - -DENABLE_EGL=ON - -DENABLE_GL=ON - -DENABLE_GLES=ON - -DENABLE_PYRENDERDOC=$(usex qt5) - -DENABLE_QRENDERDOC=$(usex qt5) - -DENABLE_VULKAN=ON - - # Upstream says that this option is unsupported and should not - # be used yet. - -DENABLE_UNSUPPORTED_EXPERIMENTAL_POSSIBLY_BROKEN_WAYLAND=OFF - - -DENABLE_XCB=ON - -DENABLE_XLIB=ON - - # renderdoc_capture.json is installed here - -DVULKAN_LAYER_FOLDER="${EPREFIX}"/etc/vulkan/implicit_layer.d - ) - - use qt5 && mycmakeargs+=( - -DPython3_EXECUTABLE="${PYTHON}" - -DRENDERDOC_SWIG_PACKAGE="${DISTDIR}"/${MY_SWIG}.tar.gz - - # Needed after qtchooser removal, bug #836474. - -DQMAKE_QT5_COMMAND="$(qt5_get_bindir)"/qmake - - # Bug #926549 - -DQRENDERDOC_ENABLE_PYSIDE2=OFF - ) - - # Lots of type mismatch issues. - filter-lto - - cmake_src_configure -} - -src_compile() { - cmake_src_compile - docs_compile -} - -pkg_postinst() { - xdg_pkg_postinst - optfeature "android remote contexts" dev-util/android-tools - optfeature "vulkan contexts" media-libs/vulkan-loader -} diff --git a/media-gfx/renderdoc/renderdoc-1.42.ebuild b/media-gfx/renderdoc/renderdoc-1.42.ebuild @@ -0,0 +1,191 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# The swig fork is required for compatibility with both provided and +# 3rd-party Python scripts. Required patch was sent to upstream in +# 2014: https://github.com/swig/swig/pull/251 +MY_SWIG_VER=7 +MY_SWIG=swig-${PN}-${MY_SWIG_VER} + +AUTOTOOLS_AUTO_DEPEND="no" +DOCS_BUILDER="sphinx" +DOCS_DIR="docs" +PYTHON_COMPAT=( python3_{9..13} ) +inherit autotools cmake flag-o-matic optfeature python-single-r1 docs qmake-utils verify-sig xdg + +DESCRIPTION="A stand-alone graphics debugging tool" +HOMEPAGE="https://renderdoc.org https://github.com/baldurk/renderdoc" +SRC_URI=" + https://github.com/baldurk/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz + qt5? ( https://github.com/baldurk/swig/archive/${PN}-modified-${MY_SWIG_VER}.tar.gz -> ${MY_SWIG}.tar.gz ) + verify-sig? ( https://github.com/baldurk/renderdoc/releases/download/v${PV}/v${PV}.tar.gz.asc -> ${P}.tar.gz.asc ) +" + +# renderdoc: MIT +# + cmdline: BSD (not compatible with upstream lib) +# + farm fresh icons: CC-BY-3.0 +# + half: MIT (not compatible with system dev-libs/half) +# + include-bin ZLIB (upstream doesn't exist anymore, maintained in tree) +# + md5: public-domain +# + plthook: BSD-2 +# + pugixml: MIT +# + radeon gpu analyzer: MIT +# + source code pro: OFL-1.1 +# + stb: public-domain +# + tinyfiledialogs: ZLIB +# + glslang: BSD +# + docs? ( sphinx.paramlinks: MIT ) +# swig: GPL-3+ BSD BSD-2 +LICENSE="BSD BSD-2 CC-BY-3.0 GPL-3+ MIT OFL-1.1 public-domain ZLIB" +SLOT="0" +KEYWORDS="amd64 arm64" +IUSE="qt5" +REQUIRED_USE="doc? ( qt5 ) qt5? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + app-arch/lz4:= + app-arch/zstd:= + dev-libs/miniz:= + x11-libs/libX11 + x11-libs/libxcb:= + x11-libs/xcb-util-keysyms + virtual/opengl + qt5? ( + ${PYTHON_DEPS} + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtnetwork:5[ssl] + dev-qt/qtsvg:5 + dev-qt/qtwidgets:5 + dev-qt/qtx11extras:5 + ) +" +DEPEND="${RDEPEND}" +# qtcore provides qmake, which is required to build the qrenderdoc gui. +BDEPEND=" + x11-base/xorg-proto + virtual/pkgconfig + qt5? ( + ${AUTOTOOLS_DEPEND} + ${PYTHON_DEPS} + dev-libs/libpcre + dev-qt/qtcore:5 + app-alternatives/yacc + ) + verify-sig? ( sec-keys/openpgp-keys-baldurkarlsson ) +" + +PATCHES=( + "${FILESDIR}"/0001-linux-fix-build-against-musl.patch + "${FILESDIR}"/0002-Rework-injection-and-synchronisaion-on-linux.patch + + # Pass CXXFLAGS and LDFLAGS through to qmake when qrenderdoc is built. + "${FILESDIR}"/0003-build-qrenderdoc-Respect-CXX-and-LDFLAGS.patch + + # Needed to prevent sandbox violations during build. + "${FILESDIR}"/0004-always-use-HOME-env-variable-for-home-directory.patch + + # Only search for PySide2 if pyside2 USE flag is set. + # Bug #833627 + "${FILESDIR}"/0005-build-Only-search-for-PySide2-if-required.patch + + # Bug #925578 + "${FILESDIR}"/0006-Remove-undefined-symbols-from-version-script.patch + + # The analytics seem very reasonable, and even without this patch + # they are NOT sent before the user accepts. But default the + # selection to off, just in case. + "${FILESDIR}"/0007-analytics-Default-selection-to-off.patch +) + +DOCS=( util/LINUX_DIST_README ) + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/baldurkarlsson.gpg + +pkg_setup() { + use qt5 && python-single-r1_pkg_setup +} + +src_unpack() { + if use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc} + fi + + # Do not unpack the swig sources here. CMake will do that if + # required. + unpack ${P}.tar.gz +} + +src_prepare() { + cmake_src_prepare + + # Remove the calls to install the documentation files. Instead, + # install them with einstalldocs. + sed -i '/share\/doc\/renderdoc/d' \ + "${S}"/CMakeLists.txt "${S}"/qrenderdoc/CMakeLists.txt \ + || die 'sed remove doc install failed' + + # Assumes that the build directory is "${S}"/build, which it is not. + sed -i "s|../build/lib|${BUILD_DIR}/lib|" \ + "${S}"/docs/conf.py \ + || die 'sed patch doc sys.path failed' + + # Bug #836235 + sed -i '/#include <stdarg/i #include <time.h>' \ + "${S}"/renderdoc/os/os_specific.h \ + || die 'sed include time.h failed' +} + +src_configure() { + local mycmakeargs=( + # Build system does not know that this is a tagged release, as + # we just have the tarball and not the git repository. + -DBUILD_VERSION_STABLE=ON + + -DENABLE_EGL=ON + -DENABLE_GL=ON + -DENABLE_GLES=ON + -DENABLE_PYRENDERDOC=$(usex qt5) + -DENABLE_QRENDERDOC=$(usex qt5) + -DENABLE_VULKAN=ON + + # Upstream says that this option is unsupported and should not + # be used yet. + -DENABLE_UNSUPPORTED_EXPERIMENTAL_POSSIBLY_BROKEN_WAYLAND=OFF + + -DENABLE_XCB=ON + -DENABLE_XLIB=ON + + # renderdoc_capture.json is installed here + -DVULKAN_LAYER_FOLDER="${EPREFIX}"/etc/vulkan/implicit_layer.d + ) + + use qt5 && mycmakeargs+=( + -DPython3_EXECUTABLE="${PYTHON}" + -DRENDERDOC_SWIG_PACKAGE="${DISTDIR}"/${MY_SWIG}.tar.gz + + # Needed after qtchooser removal, bug #836474. + -DQMAKE_QT5_COMMAND="$(qt5_get_bindir)"/qmake + + # Bug #926549 + -DQRENDERDOC_ENABLE_PYSIDE2=OFF + ) + + # Lots of type mismatch issues. + filter-lto + + cmake_src_configure +} + +src_compile() { + cmake_src_compile + docs_compile +} + +pkg_postinst() { + xdg_pkg_postinst + optfeature "android remote contexts" dev-util/android-tools + optfeature "vulkan contexts" media-libs/vulkan-loader +}