Commit Graph
7 Commits
Author SHA1 Message Date
Olaf Hering 338c437515 tools: pass EXTRA_CFLAGS via environment
Currently qemu-xen will be compiled with CFLAGS only if CFLAGS was
already in the environment during make invocation. If CFLAGS is in
environment then make will append all of the various flags specified in
xen Makefiles to this environment variable, which is then used in qemu
configure. Since qemu-xen is not ready for compiler flags like
"-std=gnu99" compilation will fail. If CFLAGS is not in environment,
then configure will use just its own "-O2 -g" because make does not
export its own CFLAGS variable.

>From a distro perspective, it is required to build libraries and
binaries with certain global cflags (arbitrary gcc options). Up to the
point when qemu-xen was imported it worked as expected by exporting
CFLAGS before 'make tools'.  Now qemu-upstream reuses these CFLAGS, but
it cant deal with the result.

This patch extends the tools Makefiles so that three new environment
variables are recognized:
  EXTRA_CFLAGS_XEN_TOOLS= specifies CFLAGS for the tools build.
  EXTRA_CFLAGS_QEMU_TRADITIONAL= specifies CFLAGS for old qemu.
  EXTRA_CFLAGS_QEMU_XEN= specifies CFLAGS for new qemu.

Special care needs to be taken in tools/firmware because the resulting
binaries are not linked with the hosts runtime libraries. These binaries
run in guest context. To avoid build errors from gcc options like
-fstack-protector, reuse existing practice to unset the new
EXTRA_CFLAGS_XEN_TOOLS for the firmware dirs.


The new feature can be used like this in a rpm xen.spec file:

   export EXTRA_CFLAGS_XEN_TOOLS="${RPM_OPT_FLAGS}"
   export EXTRA_CFLAGS_QEMU_TRADITIONAL="${RPM_OPT_FLAGS}"
   export EXTRA_CFLAGS_QEMU_XEN="${RPM_OPT_FLAGS}"
   ./configure \
   	--libdir=%{_libdir} \
   	--prefix=/usr
   make


   Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-06-07 18:51:42 +01:00
Keir Fraser 55a2e36cbc x86: Add -fno-exceptions to list of possibly-supported CFLAGS for embedded targets.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-25 22:20:47 +01:00
Keir Fraser 6b1ce5497d build: Define cc-option-add to immediately add options to CFLAGS
without deferring the test execution of CC. This avoids extra
executions of CC every time CFLAGS is expanded.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-13 08:59:49 +00:00
Keir Fraser bd3358a451 tools: Don't turn CFLAGS into a := (immediate evaluation) variable as
this breaks 'CFLAGS += -MMD -MF .$(@F).d'

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-12 16:39:07 +00:00
Keir Fraser 64a86b092f hvmloader: Debug build incorporates HVM environment tests which must
pass for the HVM guest to successfully boot.

Currently only one test (REP INS across page boundaries) but more will
be added in future.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-21 15:18:05 +01:00
Keir Fraser 656217ee9c hvmloader: Build with -Werror.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-09 13:52:52 +01:00
Keir Fraser 0080a146fc x86 firmware: Consolidate firmware common build rules.
Also avoid overriding global optimisation default (-O1, -O2, etc.)

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-02 10:42:27 +01:00