mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-06 01:24:10 +00:00
Fixes for MXE build
This commit is contained in:
parent
c3f6e0ea85
commit
f103bfb9ba
4
Makefile
4
Makefile
|
@ -162,8 +162,8 @@ yosys.html: misc/yosys.html
|
||||||
$(P) cp misc/yosys.html yosys.html
|
$(P) cp misc/yosys.html yosys.html
|
||||||
|
|
||||||
else ifeq ($(CONFIG),mxe)
|
else ifeq ($(CONFIG),mxe)
|
||||||
CXX = /usr/local/src/mxe/usr/bin/i686-pc-mingw32-gcc
|
CXX = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-gcc
|
||||||
LD = /usr/local/src/mxe/usr/bin/i686-pc-mingw32-gcc
|
LD = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-gcc
|
||||||
CXXFLAGS += -std=gnu++0x -Os -D_POSIX_SOURCE
|
CXXFLAGS += -std=gnu++0x -Os -D_POSIX_SOURCE
|
||||||
CXXFLAGS := $(filter-out -fPIC,$(CXXFLAGS))
|
CXXFLAGS := $(filter-out -fPIC,$(CXXFLAGS))
|
||||||
LDFLAGS := $(filter-out -rdynamic,$(LDFLAGS)) -s
|
LDFLAGS := $(filter-out -rdynamic,$(LDFLAGS)) -s
|
||||||
|
|
14
kernel/log.h
14
kernel/log.h
|
@ -163,11 +163,13 @@ struct PerformanceTimer
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t query() {
|
static int64_t query() {
|
||||||
#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)
|
# if _WIN32
|
||||||
|
return 0;
|
||||||
|
# elif defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
|
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
|
||||||
return int64_t(ts.tv_sec)*1000000000 + ts.tv_nsec;
|
return int64_t(ts.tv_sec)*1000000000 + ts.tv_nsec;
|
||||||
#elif defined(RUSAGE_SELF)
|
# elif defined(RUSAGE_SELF)
|
||||||
struct rusage rusage;
|
struct rusage rusage;
|
||||||
int64_t t;
|
int64_t t;
|
||||||
if (getrusage(RUSAGE_SELF, &rusage) == -1) {
|
if (getrusage(RUSAGE_SELF, &rusage) == -1) {
|
||||||
|
@ -177,11 +179,9 @@ struct PerformanceTimer
|
||||||
t = 1000000000ULL * (int64_t) rusage.ru_utime.tv_sec + (int64_t) rusage.ru_utime.tv_usec * 1000ULL;
|
t = 1000000000ULL * (int64_t) rusage.ru_utime.tv_sec + (int64_t) rusage.ru_utime.tv_usec * 1000ULL;
|
||||||
t += 1000000000ULL * (int64_t) rusage.ru_stime.tv_sec + (int64_t) rusage.ru_stime.tv_usec * 1000ULL;
|
t += 1000000000ULL * (int64_t) rusage.ru_stime.tv_sec + (int64_t) rusage.ru_stime.tv_usec * 1000ULL;
|
||||||
return t;
|
return t;
|
||||||
#elif _WIN32
|
# else
|
||||||
return 0;
|
# error Dont know how to measure per-process CPU time. Need alternative method (times()/clocks()/gettimeofday()?).
|
||||||
#else
|
# endif
|
||||||
#error Dont know how to measure per-process CPU time. Need alternative method (times()/clocks()/gettimeofday()?).
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset() {
|
void reset() {
|
||||||
|
|
|
@ -91,9 +91,9 @@
|
||||||
# define mkdir _mkdir
|
# define mkdir _mkdir
|
||||||
# define popen _popen
|
# define popen _popen
|
||||||
# define pclose _pclose
|
# define pclose _pclose
|
||||||
# define PATH_MAX MAX_PATH
|
|
||||||
|
|
||||||
# ifndef __MINGW32__
|
# ifndef __MINGW32__
|
||||||
|
# define PATH_MAX MAX_PATH
|
||||||
# define isatty _isatty
|
# define isatty _isatty
|
||||||
# define fileno _fileno
|
# define fileno _fileno
|
||||||
# endif
|
# endif
|
||||||
|
|
Loading…
Reference in a new issue