FreeBSD build broken due to missing -lrt
authorBruce Cran <bruce@cran.org.uk>
Wed, 15 Dec 2010 09:33:03 +0000 (10:33 +0100)
committerJens Axboe <jaxboe@fusionio.com>
Wed, 15 Dec 2010 09:33:03 +0000 (10:33 +0100)
The latest fio fails to link on FreeBSD because timer_create is in
librt but the -lrt flag is missing from Makefile.FreeBSD.

I also noticed a couple of compiler warnings when building with clang -
a format of "%Lu" is used but 'L' doesn't have any effect with 'u' - I
guess %llu is needed since the types are 'unsigned long long'?

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Makefile.FreeBSD
filesetup.c

index e4adfca5c611c67cca1e4bfd8985a593b6554c0f..9378b195392cd75396a7019450f0a0a1a49c5ac6 100644 (file)
@@ -52,7 +52,7 @@ mandir = $(prefix)/man
 %.o: %.c
        $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
 fio: $(OBJS)
-       $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(EXTLIBS) -lpthread -lm
+       $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(EXTLIBS) -lpthread -lm -lrt
 
 depend:
        $(QUIET_DEP)$(CC) -MM $(ALL_CFLAGS) $(SOURCE) 1> .depend
index ae893c7b178ecf4ab3080afd70095a3af2c97e2e..bb3623422d6ba10fff7d49c1f4a418f10e96e13c 100644 (file)
@@ -316,7 +316,7 @@ static int get_file_size(struct thread_data *td, struct fio_file *f)
                return ret;
 
        if (f->file_offset > f->real_file_size) {
-               log_err("%s: offset extends end (%Lu > %Lu)\n", td->o.name,
+               log_err("%s: offset extends end (%llu > %llu)\n", td->o.name,
                                        f->file_offset, f->real_file_size);
                return 1;
        }
@@ -734,7 +734,7 @@ int setup_files(struct thread_data *td)
                temp_stall_ts = 1;
                if (!terse_output)
                        log_info("%s: Laying out IO file(s) (%u file(s) /"
-                                " %LuMB)\n", td->o.name, need_extend,
+                                " %lluMB)\n", td->o.name, need_extend,
                                        extend_size >> 20);
 
                for_each_file(td, f, i) {