- May 08, 2015
-
-
Fam Zheng authored
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>
-
- Jan 14, 2015
-
-
Fam Zheng authored
Module build is broken since commit c261d774 ( 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>
-
- Oct 31, 2014
-
-
Fam Zheng authored
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>
-
- Sep 19, 2014
-
-
Stefan Weil authored
Commit c261d774 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>
-
- Sep 09, 2014
-
-
Fam Zheng authored
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>
-
- Jun 24, 2014
-
-
Michael Tokarev authored
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>
-
- Jun 16, 2014
-
-
Paolo Bonzini authored
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>
-
- Jun 10, 2014
-
-
Fam Zheng authored
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>
-
- May 09, 2014
-
-
Paolo Bonzini authored
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>
-
- May 08, 2014
-
-
Paolo Bonzini authored
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>
-
Paolo Bonzini authored
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>
-
- Mar 17, 2014
-
-
Fam Zheng authored
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>
-
- Feb 20, 2014
-
-
Fam Zheng authored
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>
-
Fam Zheng authored
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>
-
Fam Zheng authored
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>
-
Fam Zheng authored
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>
-
- Feb 08, 2014
-
-
Peter Maydell authored
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>
-
Peter Maydell authored
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>
-
- Oct 16, 2013
-
-
Peter Maydell authored
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>
-
Peter Maydell authored
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>
-
- Sep 09, 2013
-
-
Tomoki Sekiyama authored
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>
-
- May 03, 2013
-
-
Paolo Bonzini authored
While commit c02817e5 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>
-
- Apr 30, 2013
-
-
Dunrong Huang authored
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>
-
- Apr 26, 2013
-
-
Paolo Bonzini authored
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>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Apr 24, 2013
-
-
Marc-André Lureau authored
Compile and link with version.lo Signed-off-by:
Marc-André Lureau <mlureau@redhat.com> Reviewed-by:
Alon Levy <alevy@redhat.com>
-
Marc-André Lureau authored
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>
-
- Jan 29, 2013
-
-
Michael S. Tsirkin authored
Using a global pattern makes it easier to clean out old generated files. Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Michael S. Tsirkin authored
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>
-
- Jan 12, 2013
-
-
Paolo Bonzini authored
There is no reason for it to be in block-obj-y, in particular. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Do not fail at build time, instead just disable the library if libtool is not present. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
This patch moves the complication of using libtool to the generic rules.mak file. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Blue Swirl authored
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>
-
- Dec 19, 2012
-
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Make it correct for nested directories, and move the static part from Makefile to configure. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Nov 18, 2012
-
-
Paolo Bonzini authored
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>
-
- Aug 16, 2012
-
-
Peter Maydell authored
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>
-
- Jul 28, 2012
-
-
Paolo Bonzini authored
After commit dcff25f2, 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>
-