mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-12-16 04:09:07 +00:00
LLVM JIT: do not produce broken binaries on crash
Some checks are pending
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.3, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1, rpcs3/rpcs3-binaries-linux-arm64, /rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.3, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (d812f1254a1157c80fd402f94446310560f54e5f, rpcs3/rpcs3-binaries-linux, /rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.3, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Some checks are pending
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.3, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1, rpcs3/rpcs3-binaries-linux-arm64, /rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.3, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (d812f1254a1157c80fd402f94446310560f54e5f, rpcs3/rpcs3-binaries-linux, /rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.3, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
This commit is contained in:
parent
55190c2125
commit
cd840ef70a
@ -413,7 +413,7 @@ public:
|
||||
{
|
||||
std::string name = m_path;
|
||||
|
||||
name.append(_module->getName().data());
|
||||
name.append(_module->getName());
|
||||
//fs::file(name, fs::rewrite).write(obj.getBufferStart(), obj.getBufferSize());
|
||||
name.append(".gz");
|
||||
|
||||
@ -425,9 +425,9 @@ public:
|
||||
|
||||
ensure(m_compiler);
|
||||
|
||||
fs::file module_file(name, fs::rewrite);
|
||||
fs::pending_file module_file;
|
||||
|
||||
if (!module_file)
|
||||
if (!module_file.open((name)))
|
||||
{
|
||||
jit_log.error("LLVM: Failed to create module file: %s (%s)", name, fs::g_tls_error);
|
||||
return;
|
||||
@ -442,18 +442,17 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if (!zip(obj.getBufferStart(), obj.getBufferSize(), module_file))
|
||||
if (!zip(obj.getBufferStart(), obj.getBufferSize(), module_file.file))
|
||||
{
|
||||
jit_log.error("LLVM: Failed to compress module: %s", _module->getName().data());
|
||||
module_file.close();
|
||||
fs::remove_file(name);
|
||||
jit_log.error("LLVM: Failed to compress module: %s", std::string(_module->getName()));
|
||||
return;
|
||||
}
|
||||
|
||||
jit_log.trace("LLVM: Created module: %s", _module->getName().data());
|
||||
jit_log.trace("LLVM: Created module: %s", std::string(_module->getName()));
|
||||
|
||||
// Restore space that was overestimated
|
||||
ensure(m_compiler->add_sub_disk_space(max_size - module_file.size()));
|
||||
ensure(m_compiler->add_sub_disk_space(max_size - module_file.file.size()));
|
||||
module_file.commit();
|
||||
}
|
||||
|
||||
static std::unique_ptr<llvm::MemoryBuffer> load(const std::string& path)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user