From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <554BD378.70209@cran.org.uk> Date: Thu, 07 May 2015 15:04:56 -0600 From: Bruce Cran MIME-Version: 1.0 Subject: Re: [PATCH] Add Windows ctime_r implementation and empty ioctl.h header References: <554ADC87.2070605@cran.org.uk> <554B99DD.2000902@kernel.dk> In-Reply-To: <554B99DD.2000902@kernel.dk> Content-Type: multipart/mixed; boundary="------------010102020002070300090204" To: Jens Axboe , "fio@vger.kernel.org" List-ID: This is a multi-part message in MIME format. --------------010102020002070300090204 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 5/7/2015 10:59 AM, Jens Axboe wrote: > Added. Side note - your email consistently ends up in my gmail spam, > for some reason... Ugh, it's because DMARC doesn't work through mailing lists without jumping through hoops. I'll see if I can disable it for specified destinations. > > What are the linker errors? I'm guessing you need to check and add > your OS dependencies to T_OBJS in the Makefile, when targetos is Windows. Got it - I'd forgotten that the Makefile is still checked in and it's not generated by the configure script! I've attached a patch which should make the build work a lot better on Windows. -- Bruce --------------010102020002070300090204 Content-Type: text/plain; charset=windows-1252; name="0001-Fix-compiler-warning-and-test-progs-linker-errors-on.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Fix-compiler-warning-and-test-progs-linker-errors-on.pa"; filename*1="tch" >From 4a6ef95b40558b215c113a0260b891b36f376f83 Mon Sep 17 00:00:00 2001 From: Bruce Cran Date: Thu, 7 May 2015 14:56:58 -0600 Subject: [PATCH] Fix compiler warning and test progs linker errors on Windows Add prototype for ctime_r to os-windows.h to avoid compiler warning. Link in os/windows/posix.o and lib/hweight.o to allow test progs to build on Windows. --- Makefile | 6 ++++++ os/os-windows.h | 1 + 2 files changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 1b312cb..d9aedf5 100644 --- a/Makefile +++ b/Makefile @@ -218,6 +218,12 @@ T_OBJS += $(T_LFSR_TEST_OBJS) T_OBJS += $(T_BTRACE_FIO_OBJS) T_OBJS += $(T_DEDUPE_OBJS) +ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS))) + T_DEDUPE_OBJS += os/windows/posix.o lib/hweight.o + T_SMALLOC_OBJS += os/windows/posix.o lib/hweight.o + T_LFSR_TEST_OBJS += os/windows/posix.o lib/hweight.o +endif + T_TEST_PROGS = $(T_SMALLOC_PROGS) T_TEST_PROGS += $(T_IEEE_PROGS) T_PROGS += $(T_ZIPF_PROGS) diff --git a/os/os-windows.h b/os/os-windows.h index 6603635..9e931c9 100644 --- a/os/os-windows.h +++ b/os/os-windows.h @@ -105,6 +105,7 @@ int fcntl(int fildes, int cmd, ...); int fdatasync(int fildes); int lstat(const char * path, struct stat * buf); uid_t geteuid(void); +char* ctime_r(const time_t *t, char *buf); int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset); ssize_t pwrite(int fildes, const void *buf, size_t nbyte, -- 1.9.5.msysgit.1 --------------010102020002070300090204--