Pārlūkot izejas kodu

[rcore][android] Add WARNING comment for --wrap=fopen build system requirements

pull/5624/head
Federico Gherardi pirms 1 nedēļas
vecāks
revīzija
8cbd4a9b56
1 mainītis faili ar 16 papildinājumiem un 0 dzēšanām
  1. +16
    -0
      src/platforms/rcore_android.c

+ 16
- 0
src/platforms/rcore_android.c Parādīt failu

@ -275,6 +275,22 @@ static int android_write(void *cookie, const char *buf, int size);
static fpos_t android_seek(void *cookie, fpos_t offset, int whence);
static int android_close(void *cookie);
// WARNING: fopen() calls are intercepted via linker flag -Wl,--wrap=fopen: the linker renames
// the original fopen -> __real_fopen and redirects all call sites to __wrap_fopen
// The flag MUST be applied at every final link step that needs wrapping,
// it has no effect when only building a static archive (.a)
//
// CMake: no action required, raylib's CMakeLists.txt already sets
// target_link_options(raylib INTERFACE -Wl,--wrap=fopen) which propagates to
// the final app link, wrapping app code and all static (.a) dependencies too
// Make (SHARED): no action required for raylib itself, src/Makefile already sets
// LDFLAGS += -Wl,--wrap=fopen wrapping fopen inside libraylib.so only;
// app code and static (.a) dependencies are NOT wrapped unless -Wl,--wrap=fopen
// is also added to the final app link step
// Make (STATIC): pass -Wl,--wrap=fopen to the linker command producing the final artifact
// build.zig: no dedicated wrap helper; pass -Wl,--wrap=fopen to the linker command producing
// the final artifact
// custom: pass -Wl,--wrap=fopen to the linker command producing the final artifact
FILE *__real_fopen(const char *fileName, const char *mode); // Real fopen, provided by the linker (--wrap=fopen)
FILE *__wrap_fopen(const char *fileName, const char *mode); // Replacement for fopen()

Notiek ielāde…
Atcelt
Saglabāt