LibC: Make environ a weak alias

If user program defines its own global `environ` variable it will still
work :)
This commit is contained in:
Bananymous 2024-12-03 20:27:54 +02:00
parent 176693dd5a
commit 88c9f6d233
1 changed files with 2 additions and 1 deletions

View File

@ -16,7 +16,8 @@
#include <termios.h> #include <termios.h>
#include <unistd.h> #include <unistd.h>
char** environ; char** __environ;
extern char** environ __attribute__((weak, alias("__environ")));
extern void _init_malloc(); extern void _init_malloc();
extern void _init_stdio(); extern void _init_stdio();