mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-25 18:05:12 -04:00
fix PSX_BSS section attribute for Mach-O / macOS
Apple Clang requires segment,section form; ELF .bss breaks Bomberman World CI. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,11 +3,16 @@
|
||||
* MinGW + LTO has been observed to place multi‑MiB uninitialized globals into
|
||||
* .rdata as literal zeros, bloating release .exe size by ~100+ MiB (e.g.
|
||||
* g_fntrace_ring). Explicit .bss placement keeps them RAM-only on disk.
|
||||
*
|
||||
* Mach-O requires "segment,section" (not ELF ".bss"); Apple Clang rejects
|
||||
* section(".bss") at compile time.
|
||||
*/
|
||||
#ifndef PSXRECOMP_PSX_BSS_H
|
||||
#define PSXRECOMP_PSX_BSS_H
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#if defined(__APPLE__)
|
||||
#define PSX_BSS __attribute__((section("__DATA,__bss")))
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#define PSX_BSS __attribute__((section(".bss")))
|
||||
#elif defined(_MSC_VER)
|
||||
/* MSVC already puts uninitialized globals in .bss by default. */
|
||||
|
||||
Reference in New Issue
Block a user