All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Aaron Carroll <aaronc@cse.unsw.edu.au>
Cc: Greg Freemyer <greg.freemyer@gmail.com>, fio@vger.kernel.org
Subject: Re: FIO 2.0.14 - getting a compile error on opensuse
Date: Thu, 28 Mar 2013 15:21:51 -0600	[thread overview]
Message-ID: <20130328212151.GG19488@kernel.dk> (raw)
In-Reply-To: <CAKCZDgkX1JPo6_+cUzAU3bCo_ceawyd64Ki08BVZS7y4Uoooqg@mail.gmail.com>

On Wed, Mar 27 2013, Aaron Carroll wrote:
> On 26 March 2013 05:44, Greg Freemyer <greg.freemyer@gmail.com> wrote:
> > But this is the basic error which happens on the first gcc call.
> >
> > [   48s] gcc -o gettime.o -std=gnu99 -Wwrite-strings -Wall
> > -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches -O2
> > -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables
> > -fasynchronous-unwind-tables -DBITS_PER_LONG=32
> > -DFIO_VERSION='"fio-2.0.14"' -D_LARGEFILE_SOURCE
> > -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG -c
> > gettime.c
> 
> Something has happened to the CFLAGS -- you're missing -D_GNU_SOURCE
> which is needed for the definition of CPU_ZERO.
> 
> I can get the same behaviour with:
>    make EXTFLAGS=
> but then I got confused looking at the Makefile. I don't understand
> how that ever works, since EXTFLAGS is used before it's defined.

This should (hopefully) improve the situation. Greg, can you test with
this?

diff --git a/Makefile b/Makefile
index ea96a89..cae07c3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,3 @@
-DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
-CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(DEBUGFLAGS)
-OPTFLAGS= -O3 -g -ffast-math $(EXTFLAGS)
-CFLAGS	= -std=gnu99 -Wwrite-strings -Wall $(OPTFLAGS)
-LIBS	= -lm $(EXTLIBS)
-PROGS	= fio
-SCRIPTS = fio_generate_plots
-
 ifneq ($(wildcard config-host.mak),)
 all:
 include config-host.mak
@@ -20,6 +12,14 @@ all:
 include config-host.mak
 endif
 
+DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
+CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(DEBUGFLAGS)
+OPTFLAGS= -O3 -g -ffast-math $(EXTFLAGS) $(BUILD_CFLAGS)
+CFLAGS	= -std=gnu99 -Wwrite-strings -Wall $(OPTFLAGS)
+LIBS	= -lm $(EXTLIBS)
+PROGS	= fio
+SCRIPTS = fio_generate_plots
+
 SOURCE := gettime.c fio.c ioengines.c init.c stat.c log.c time.c filesetup.c \
 		eta.c verify.c memory.c io_u.c parse.c mutex.c options.c \
 		rbtree.c smalloc.c filehash.c profile.c debug.c lib/rand.c \
diff --git a/configure b/configure
index 836d7ad..13cf8d5 100755
--- a/configure
+++ b/configure
@@ -39,7 +39,7 @@ fatal() {
 
 # Default CFLAGS
 CFLAGS="-D_GNU_SOURCE"
-EXTFLAGS="-include config-host.h"
+BUILD_CFLAGS="-include config-host.h"
 
 # Print a helpful header at the top of config.log
 echo "# FIO configure log $(date)" >> config.log
@@ -230,7 +230,7 @@ CYGWIN*)
   output_sym "CONFIG_SCHED_IDLE"
   output_sym "CONFIG_TCP_NODELAY"
   echo "CC=$CC" >> $config_host_mak
-  echo "EXTFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
+  echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
   exit 0
   ;;
 esac
@@ -1088,4 +1088,4 @@ fi
 
 echo "LIBS+=$LIBS" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
-echo "EXTFLAGS=$EXTFLAGS $CFLAGS" >> $config_host_mak
+echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak

-- 
Jens Axboe


  reply	other threads:[~2013-03-28 21:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25 18:44 FIO 2.0.14 - getting a compile error on opensuse Greg Freemyer
2013-03-26 21:15 ` Jens Axboe
2013-03-26 22:00   ` Greg Freemyer
2013-03-27  3:57 ` Aaron Carroll
2013-03-28 21:21   ` Jens Axboe [this message]
2013-03-28 23:35     ` Greg Freemyer
2013-03-29 13:40       ` Jens Axboe
2013-03-29 14:14         ` Greg Freemyer
2013-03-29 14:54           ` Jens Axboe
2013-03-29 15:31             ` Greg Freemyer
2013-03-29 15:44               ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130328212151.GG19488@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=aaronc@cse.unsw.edu.au \
    --cc=fio@vger.kernel.org \
    --cc=greg.freemyer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.