mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 08:23:29 +00:00
[Linux] Add support for PCK embedding section with non GNU-ld linkers.
This commit is contained in:
parent
0bcc0e92b3
commit
625c4bdace
5 changed files with 14 additions and 40 deletions
|
@ -41,6 +41,18 @@
|
|||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
// For export templates, add a section; the exporter will patch it to enclose
|
||||
// the data appended to the executable (bundled PCK).
|
||||
#if !defined(TOOLS_ENABLED) && defined(__GNUC__)
|
||||
static const char dummy[8] __attribute__((section("pck"), used)) = { 0 };
|
||||
|
||||
// Dummy function to prevent LTO from discarding "pck" section.
|
||||
extern "C" const char *pck_section_dummy_call() __attribute__((used));
|
||||
extern "C" const char *pck_section_dummy_call() {
|
||||
return &dummy[0];
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
#if defined(SANITIZERS_ENABLED)
|
||||
// Note: Set stack size to be at least 30 MB (vs 8 MB default) to avoid overflow, address sanitizer can increase stack usage up to 3 times.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue