mirror of
git://repo.or.cz/tinycc.git
synced 2026-07-07 11:58:41 +08:00
Fix cross compiling on windows
Some checks are pending
build and test / test-x86_64-linux (push) Waiting to run
build and test / test-x86_64-osx (push) Waiting to run
build and test / test-aarch64-osx (push) Waiting to run
build and test / test-x86_64-win32 (push) Waiting to run
build and test / test-i386-win32 (push) Waiting to run
build and test / test-armv7-linux (push) Waiting to run
build and test / test-aarch64-linux (push) Waiting to run
build and test / test-riscv64-linux (push) Waiting to run
Some checks are pending
build and test / test-x86_64-linux (push) Waiting to run
build and test / test-x86_64-osx (push) Waiting to run
build and test / test-aarch64-osx (push) Waiting to run
build and test / test-x86_64-win32 (push) Waiting to run
build and test / test-i386-win32 (push) Waiting to run
build and test / test-armv7-linux (push) Waiting to run
build and test / test-aarch64-linux (push) Waiting to run
build and test / test-riscv64-linux (push) Waiting to run
This commit is contained in:
parent
b45cea5f4b
commit
8c3396a76f
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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user