mirror of
https://github.com/TinyCC/tinycc.git
synced 2025-12-26 09:09:04 +00:00
Fix cross compiling on windows
This commit is contained in:
5
tccelf.c
5
tccelf.c
@@ -2804,7 +2804,9 @@ static void create_arm_attribute_section(TCCState *s1)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TARGETOS_OpenBSD || TARGETOS_NetBSD || TARGETOS_FreeBSD
|
#if TARGETOS_OpenBSD || TARGETOS_NetBSD || TARGETOS_FreeBSD
|
||||||
|
#ifndef _WIN32
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static void fill_bsd_note(Section *s, int type,
|
static void fill_bsd_note(Section *s, int type,
|
||||||
const char *value, uint32_t data)
|
const char *value, uint32_t data)
|
||||||
@@ -2837,10 +2839,13 @@ static Section *create_bsd_note_section(TCCState *s1,
|
|||||||
{
|
{
|
||||||
Section *s;
|
Section *s;
|
||||||
unsigned int major = 0, minor = 0, patch = 0;
|
unsigned int major = 0, minor = 0, patch = 0;
|
||||||
|
#ifndef _WIN32
|
||||||
struct utsname uts;
|
struct utsname uts;
|
||||||
|
|
||||||
|
/* Maybe move this to configure option for cross compiling */
|
||||||
if (!uname(&uts))
|
if (!uname(&uts))
|
||||||
sscanf(uts.release, "%u.%u.%u", &major, &minor, &patch);
|
sscanf(uts.release, "%u.%u.%u", &major, &minor, &patch);
|
||||||
|
#endif
|
||||||
#if TARGETOS_FreeBSD
|
#if TARGETOS_FreeBSD
|
||||||
if (major < 14)
|
if (major < 14)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user