aboutsummaryrefslogtreecommitdiff
path: root/rules.mak
AgeCommit message (Collapse)AuthorFilesLines
2016-07-10build: Use $(AS) for optionrom explicitlyRichard Henderson1-1/+1
For clang before 3.5, -fno-integrated-as does not exist, so the workaround in 5f6f0e27fb24 fails to build. Use clang's default assembler for linux-user/safe-syscall.S, and explicitly change to use the system assembler for the option roms. Tested-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
2016-07-05build: Use $(CCAS) for compiling .S filesRichard Henderson1-5/+2
We fail to pass to $(AS) all of the different flags that may be required for a given set of CFLAGS. Rather than figuring out the host-specific mapping, it's better to allow the compiler driver to do that. However, simply using $(CC) runs afoul of clang trying to build the option roms. C.f. 3dd46c78525a30e98c68, wherein we changed from using $(CC) to using $(AS) in the first place. Work around this by passing -fno-integrated-as to clang, so that we use the external assembler, and the clang driver still passes along all of the options that the assembler might require. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net> Message-Id: <1466703558-7723-1-git-send-email-rth@twiddle.net>
2016-06-08Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell1-1/+1
* max-ram-below-4g improvement (Gerd) * escc fix (xiaoqiang) * ESP fix (Prasad) * scsi-disk tweaks/fix (me) * Makefile dependency fixes (me) * PKGVERSION improvement (Fam) * -vnc man improvement (Robert) # gpg: Signature made Tue 07 Jun 2016 18:06:22 BST # gpg: using RSA key 0xBFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" * remotes/bonzini/tags/for-upstream: vnc: list the 'to' parameter of '-vnc' in the qemu man page scsi-disk: add missing break Makefile: Derive "PKGVERSION" from "git describe" by default Makefile: add dependency on scripts/hxtool Makefile: add dependency on scripts/make_device_config.sh Makefile: add dependency on scripts/create_config Makefile: Add a "FORCE" target scsi: megasas: null terminate bios version buffer scsi: mark TYPE_SCSI_DISK_BASE as abstract scsi: esp: check TI buffer index before read/write hw/char: QOM'ify escc.c (fix) pc: allow raising low memory via max-ram-below-4g option tests: Rename tests/Makefile to tests/Makefile.include Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-06-07Fix linking relocatable objects on SparcJames Clarke1-1/+1
On Sparc, gcc implicitly passes --relax to the linker, but -r is incompatible with this. Therefore, if --no-relax is supported, it should be passed to the linker. Signed-off-by: James Clarke <jrtc27@jrtc27.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-06-07Makefile: add dependency on scripts/create_configPaolo Bonzini1-1/+1
Make sure that config-host.h and config-target.h are rebuilt whenever there is a change in the scripts that generates them; add the dependency to the pattern rule as suggested by Peter. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-06-01rules.mak: Add "COMMA" constantFam Zheng1-0/+2
Using "," literal in $(call quiet-command, ...) arguments is awkward. Add this constant to make it at least doable. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1464755128-32490-3-git-send-email-famz@redhat.com
2016-02-17rules: filter out irrelevant filesMichael S. Tsirkin1-1/+1
It's often handy to make executables depend on each other, e.g. make a test depend on a helper. This doesn't work now, as linker will attempt to use the helper as an object. To fix, filter only relevant file types before linking an executable. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-02-11remove libtool supportMichael Tokarev1-18/+0
Libtool support was needed to build shared library for libcacard. Now there's no need to use libtool, and since the build system is already complicated enough, we have a way to slightly de-complicate it. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
2015-08-13make: load only required dependency files.Victor Kaplansky1-1/+1
The old rules.mak loads dependency .d files using include directive with file glob pattern "*.d". This breaks the build when build tree has left-over *.d files from another build. This patch fixes this by - loading precise list of .d files made from *.o and *.mo. - specifying explicit list of required dependency info files for *.hex autogenerated sources. Note that Makefile still includes some .d in root directory by including "*.d". Signed-off-by: Victor Kaplansky <victork@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-08-13make: fix where dependency *.d are stored.Victor Kaplansky1-1/+1
In rules like "bar/%.o: %.c" there is a difference between $(*D) and $(@D). $(*D) expands to '.', while $(@D) expands to 'bar'. It is cleaner to generate *.d in the same directory where appropriate *.o resides. This allows precise including of dependency info from .d files. As a hack, we also touch two sources for generated *.hex files. Without this hack, anyone doing "git pull; make" will not get *.hex rebuilt correctly since the dependency file would be missing. Signed-off-by: Victor Kaplansky <victork@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-05-08rules.mak: Force CFLAGS for all objects in DSOFam Zheng1-1/+3
Because of the trick of process-archive-undefs, all .mo objects, even with --enable-modules, are dependencies of executables. This breaks CFLAGS propogation because the compiling of module object will happen too early before building for DSO. With GCC 5, the linking would fail because .o doesn't have -fPIC. Also, BUILD_DSO will be missed. (module-common.o will have it, so the stamp symbol was still liked in .so). Fix the problem by forcing the CFLAGS on individual .o-cflags during unnest-vars. Reported-by: Alexander Graf <agraf@suse.de> Signed-off-by: Fam Zheng <famz@redhat.com> Cc: qemu-stable@nongnu.org # 2.3 Message-Id: <1430981715-31465-1-git-send-email-famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-01-14rules.mak: Fix module buildFam Zheng1-11/+12
Module build is broken since commit c261d774fb ( rules.mak: Fix DSO build by pulling in archive symbols). That commit added .mo placeholders of DSO to -y variables, in order to pull stub symbols to executable. But the placeholders are unintentionally expanded in -y, rather than filtered out while linking. Fix it by moving the -objs expanding to before inserting .mo placeholders. Note that passing -cflags and -libs to member objects are also moved to keep it happening before object expanding. Reported-by: Bharata B Rao <bharata.rao@gmail.com> Tested-by: Bharata B Rao <bharata.rao@gmail.com> Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-31rules.mak: Allow .mo-objs and .mo-cflags in -y variablesFam Zheng1-0/+5
Expand %.mo-objs in -y nested objects, so that we can write combined object -cflags rules like what will be done in the coming patch. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-19Fix cross compilation (nm command)Stefan Weil1-1/+1
Commit c261d774fb9093d00e0938a19f502fb220f62718 added one more binutils tool: nm also needs a cross prefix. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1411070108-8954-1-git-send-email-sw@weilnetz.de Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-09rules.mak: Fix DSO build by pulling in archive symbolsFam Zheng1-3/+40
This fixes an issue with module build system. block/iscsi.so is currently broken: $ ~/build/last/qemu-img Failed to open module: /home/fam/build/master/block-iscsi.so: undefined symbol: qmp_query_uuid qemu-img: Not enough arguments Try 'qemu-img --help' for more information To fix this, we should (at least) let qemu-img link qmp_query_uuid from libqemustub.a. (There are a few other symbols missing, as well.) This patch changes the linking rules to: 1) Build ".mo" with "ld -r -o $@ $^" for each ".so", and later build .so with it. 2) Always build all the .mo before linking the executables. This is achieved by adding those .mo files to the executables' "-y" variables. 3) When linking an executable, those .mo files in its "-y" variables are filtered out, and replaced by one or more -Wl,-u,$symbol flags. This is done in the added macro "process-archive-undefs". These "-Wl,-u,$symbol" flags will force ld to pull in the function definition from the archives when linking. Note that the .mo objects, that are actually meant to be linked in the executables, are already expanded in unnest-vars, before the linking command. So we are safe to simply filter out .mo for the purpose of pulling undefined symbols. process-archive-undefs works as this: For each ".mo", find all the undefined symbols in it, filter ones that are defined in the archives. For each of these symbols, generate a "-Wl,-u,$symbol" in the link command, and put them before archive names in the command line. Suggested-by: H.J. Lu <hjl.tools@gmail.com> Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-24build-sys: introduce install-prog macro to install&strip binaries and use itMichael Tokarev1-0/+7
Use common rule (macro) to install and strip binaries, and use it in all places where we install binaries, instead of fixing bugs like 1319493 in every place. (This fixes https://bugs.launchpad.net/bugs/1319493) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-16rules.mak: remove $(sort) from extract-libsPaolo Bonzini1-1/+1
Duplicate removal was added to extract-libs in order to avoid including the same library multiple times into the linking command line; this could potentially happen when using "foo.mo-libs" (which adds the library to all components, causing it to appear N times if the module is composed of N objects). However, sorting and removing duplicates causes problems with static linking, and also with space-separated linker options as found in some Mac OS X packaging systems. Furthermore, the "optimization" is really a non-problem since we do not expect .mo modules to be composed of many files. Reported-by: Sean Bruno <sbruno@ignoranthack.me> Tested-by: Sean Bruno <sbruno@ignoranthack.me> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1402929805-16836-1-git-send-email-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-10rules.mak: Rewrite unnest-varsFam Zheng1-79/+158
The macro unnest-vars is the most important, complicated but hard to track magic in QEMU's build system. Rewrite it in a (hopefully) clearer way, with more comments, to make it easier to understand and maintain. Remove DSO_CFLAGS and module-objs-m that are not used. A bonus fix of this version is, per object variables are properly protected in save-objs and load-objs, before including sub-dir Makefile.objs, just as nested variables are. So the occasional same object name from different directory levels won't step on each other's foot. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-05-09build: simplify and fix fix-obj-varsPaolo Bonzini1-7/+7
fix-obj-vars has the undesired side effect of breaking -cflags -objs and -libs variables in the toplevel Makefile.objs. The variables in the toplevel Makefile.objs do not need any fix, so fix-obj-vars need not do anything. Since we are touching it, remove the now unnecessary $(if) in the callers. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-05-08build: add support for per-object -cflags and -libs to all rulesPaolo Bonzini1-5/+5
This is needed in order to use per-object flags variables. Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-05-08build: Fix per-object variables for Makefile.targetPaolo Bonzini1-0/+1
The compiling is done in a subdir, so the extraction of per-object libs and cflags are referencing objects with ../ prefixed. So prefix the per-object variables "foo.o-cflags" and "foo.o-libs" to "../foo.o-cflags" and "../foo.o-libs". Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-03-17rules.mak: Fix per object libs extractionFam Zheng1-2/+2
Don't sort the extracted options, sort the objects. Reported-by: Christian Mahnke <cmahnke@googlemail.com> Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-02-20module: implement module loadingFam Zheng1-0/+3
This patch adds loading, stamp checking and initialization of modules. The init function of dynamic module is no longer directly called as __attribute__((constructor)) in static linked version, it is called only after passed the checking of presense of stamp symbol: qemu_stamp_$RELEASEHASH where $RELEASEHASH is generated by hashing version strings and content of configure script. With this, modules built from a different tree/version/configure will not be loaded. The module loading code requires gmodule-2.0. Modules are searched under - CONFIG_MODDIR - executable folder (to allow running qemu-{img,io} in the build directory) - ../ of executable folder (to allow running system emulator in the build directory) Modules are linked under their subdir respectively, then copied to top level of build directory for above convinience, e.g.: $(BUILD_DIR)/block/curl.so -> $(BUILD_DIR)/block-curl.so Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-02-20rules.mak: introduce DSO rulesFam Zheng1-9/+43
Add necessary rules and flags for shared object generation. The new rules introduced here are: 1) %.o in $(common-obj-m) is compiled to %.o, then linked to %.so. 2) %.mo in $(common-obj-m) is the placeholder for %.so for pattern matching in Makefile. It's linked to "-shared" with all its dependencies (multiple *.o) as input. Which means the list of depended objects must be specified in each sub-Makefile.objs: foo.mo-objs := bar.o baz.o qux.o in the same style with foo.o-cflags and foo.o-libs. The objects here will be prefixed with "$(obj)/" if it's a subdirectory Makefile.objs. 3) For all files ending up in %.so, the following is added automatically: foo.o-cflags += -fPIC -DBUILD_DSO Also introduce --enable-modules in configure, the option will enable support of shared object build. Otherwise objects are static linked to executables. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-02-20rules.mak: allow per object cflags and libsFam Zheng1-3/+16
Adds extract-libs in LINK to expand any "per object libs", the syntax to define such a libs options is like: foo.o-libs := $(CURL_LIBS) in block/Makefile.objs. Similarly, foo.o-cflags := $(FOO_CFLAGS) is also supported. "foo.o" must be listed in a nested var (e.g. common-obj-y) to make the option variables effective. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-02-20rules.mak: fix $(obj) to a real relative pathFam Zheng1-5/+9
Makefile.target includes rule.mak and unnested common-obj-y, then prefix them with '../', this will ignore object specific QEMU_CFLAGS in subdir Makefile.objs: $(obj)/curl.o: QEMU_CFLAGS += $(CURL_CFLAGS) Because $(obj) here is './block', instead of '../block'. This doesn't hurt compiling because we basically build all .o from top Makefile, before entering Makefile.target, but it will affact arriving per-object libs support. The starting point of $(obj) is passed in as argument of unnest-vars, as well as nested variables, so that different Makefiles can pass in a right value. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-02-08rules.mak: Link with C++ if we have a C++ compilerPeter Maydell1-2/+6
If we have a C++ compiler available, link with it, because we might be linking some C++ files in. This allows us to include C++ object files in the QEMU binary proper. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net>
2014-02-08rules.mak: Support .cc as a C++ source file suffixPeter Maydell1-1/+5
The A64 disassembler libvixl uses .cc as its suffix for C++ source files, so add support for it (we already support .cpp). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net>
2013-10-16rules.mak: New string testing functionsPeter Maydell1-0/+11
Add new string testing functions which return a y/n result: eq : are two strings equal (ignoring leading/trailing space)? ne : are two strings unequal? isempty : is a string empty? notempty : is a string non-empty? Based on an idea by Ákos Kovács <akoskovacs@gmx.com>. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-10-16rules.mak: New logical functions for handling y/n valuesPeter Maydell1-0/+17
Add new logical functions for handling y/n values like those we use in CONFIG_FOO variables: lnot : logical NOT land : logical AND lor : logical OR lxor : logical XOR leqv : logical equality, inverse of lxor lif : like Make's $(if) but with an eq-like test Based on an idea by Ákos Kovács <akoskovacs@gmx.com>. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-09configure: Support configuring C++ compilerTomoki Sekiyama1-1/+8
Add configuration for C++ compiler in configure and Makefiles. The C++ compiler is choosed as following: - ${CXX}, if it is specified. - ${cross_prefix}g++, if ${cross_prefix} is specified. - Otherwise, c++ is used. Currently, usage of C++ language is only for access to Windows VSS using COM+ services in qemu-guest-agent for Windows. Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Micael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-05-03win32: fix compilation againPaolo Bonzini1-5/+1
While commit c02817e5bfbb27955cac970019e6670dc427bc41 fixed compilation without an installed libtool, moving the dependencies to rules.mak does not work because the version-*-y variables are not defined yet. Building in a clean tree thus fails. Revert the commit and remove the dummy /bin/false assignment to LIBTOOL. This makes the build work, at the price of slightly worse errors when there are Makefile bugs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1367425815-15083-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-30rules.mk: Fix build breakageDunrong Huang1-1/+1
The following error occurs when building dtc module: CHK version_gen.h CC libfdt/fdt.o cc1: error: dtc: No such file or directory [-Werror] cc1: all warnings being treated as errors make[1]: *** [libfdt/fdt.o] Error 1 make: *** [subdir-dtc] Error 2 In rules.mak, "-I$(<D) -I$(@D)" was expanded to "-Idtc -I." when building submodule dct. Due to the using of "-Wmissing-include-dirs, a warning would be rarsed. To avoid it, add "-I$(<D) -I$(@D)" to QEMU_INCLUDES instead of QEMU_CFLAGS so that QEMU_CFLAGS does not contain the "-Idtc". Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Dunrong Huang <riegamaths@gmail.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1367247132-19622-1-git-send-email-riegamaths@gmail.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-27win32: move Makefile dependencies on version-obj-y to rules.makPaolo Bonzini1-0/+3
This makes the test on $(LIBTOOL) work. Otherwise, LIBTOOL is /bin/false by the time the test is done. Fixes Win32 compilation without a working cross-libtool. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-27win32: add generic RC rules to rules.makPaolo Bonzini1-0/+4
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-24libcacard: fix mingw64 cross-compilationMarc-André Lureau1-1/+2
Compile and link with version.lo Signed-off-by: Marc-André Lureau <mlureau@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com>
2013-04-24build-sys: must link with -fstack-protectorMarc-André Lureau1-0/+1
It is needed to give that flag to the linker as well, but latest libtool 2.4.2 still swallows that argument, so let's pass it with libtool -Wc argument. qemu-1.4.0/stubs/arch-query-cpu-def.c:6: undefined reference to `__stack_chk_guard' Signed-off-by: Marc-André Lureau <mlureau@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com>
2013-01-30rules/mak: make clean should blow away timestamp filesMichael S. Tsirkin1-0/+5
Using a global pattern makes it easier to clean out old generated files. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-01-30rules.mak: cleanup config generation rulesMichael S. Tsirkin1-5/+4
This addresses two issues with config generation 1. rule generating timestamp has side effect. Thus cleanup on error does not work. 2. rule for handling timestamp is too generic. It can create any missing .h file. As a result when .h file is removed, build might try to create it using this rule which results in build errors. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-01-12build: move version-obj-y to the generic LINK rulePaolo Bonzini1-2/+2
There is no reason for it to be in block-obj-y, in particular. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-12libcacard: require libtool to build itPaolo Bonzini1-5/+1
Do not fail at build time, instead just disable the library if libtool is not present. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-12build: move dtrace rules to rules.makPaolo Bonzini1-0/+9
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-12build: support linking with libtool objects/librariesPaolo Bonzini1-2/+8
This patch moves the complication of using libtool to the generic rules.mak file. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-12build: make libtool verbose when making with V=1Paolo Bonzini1-1/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-12optionrom: build with discrete CPP and AS stepsBlue Swirl1-2/+5
Build option ROM .S files with separate preprocessor and assembler steps because the C compiler could be unsuitable. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-12-19build: add $(TARGET_DIR) to "GEN config-target.h" linesPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19build: adjust setting of QEMU_INCLUDESPaolo Bonzini1-0/+3
Make it correct for nested directories, and move the static part from Makefile to configure. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-11-18build: replace weak symbols with a static libraryPaolo Bonzini1-1/+1
Weak symbols were a nice idea, but they turned out not to be a good one. Toolchain support is just too sparse, in particular llvm-gcc is totally broken. This patch uses a surprisingly low-tech approach: a static library. Symbols in a static library are always overridden by symbols in an object file. Furthermore, if you place each function in a separate source file, object files for unused functions will not be taken in. This means that each function can use all the dependencies that it needs (especially QAPI stuff such as error_setg). Thus, all stubs are placed in separate object files and put together in a static library. The library then is linked to all programs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Tested-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-16Support using a different compiler for Objective-C filesPeter Maydell1-1/+1
MacOSX 10.8 ("Mountain Lion") requires us to compile our one Objective-C source file with clang even if the rest of QEMU requires a real gcc, because the system headers we use make use of Apple's "Blocks" extension to C/ObjC, and mainline gcc doesn't support that. Since we only need to use a true gcc for the parts of QEMU that use the fixed-register env variable, we can simply use clang to build the ObjC file: it will link to the gcc-built objects with no problems. Add the necessary support for an OBJCC variable in the makefile and configure machinery; we default to clang if we have it, otherwise whatever CC is (since gcc might be the Apple gcc which does support Blocks). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-28build: get dependency file directories from object file namesPaolo Bonzini1-1/+2
After commit dcff25f2cd8c11a9368cc2369aeb0319c32d9e26, Dependency file are taken from the directories that have a Makefile.objs file. This is not enough, since files can be included from other directories. So, pick them from directories that have an object file in them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>