mirror of
https://github.com/frida/tinycc
synced 2024-11-28 10:33:07 +03:00
Fix coredump on linux when boostrapping tcc with -std=c11
This commit is contained in:
parent
03646ad46f
commit
6a15f15093
@ -105,6 +105,15 @@ void parse_args(TCCState *s)
|
|||||||
else if (a[1] == 'L')
|
else if (a[1] == 'L')
|
||||||
tcc_add_library_path(s, a+2);
|
tcc_add_library_path(s, a+2);
|
||||||
else if (a[1] == 'D') {
|
else if (a[1] == 'D') {
|
||||||
|
#if defined(__linux__) \
|
||||||
|
&& defined(__STDC_VERSION__) \
|
||||||
|
&& (__STDC_VERSION__ >= 201112L)
|
||||||
|
/*
|
||||||
|
* gcc -std=c11 no longer declare strdup which fails with
|
||||||
|
* coredump (at least on Linux x64).
|
||||||
|
*/
|
||||||
|
extern char* strdup(const char*);
|
||||||
|
#endif
|
||||||
char *dup = strdup(a);
|
char *dup = strdup(a);
|
||||||
char *eq = strchr(dup+2, '=');
|
char *eq = strchr(dup+2, '=');
|
||||||
if (eq) {
|
if (eq) {
|
||||||
|
Loading…
Reference in New Issue
Block a user