On Wed, Mar 22, 2017 at 02:37:21PM +0100, Paolo Bonzini wrote: > > > On 22/03/2017 03:03, Xu, Anthony wrote: > > When building target x86_64-softmmu, all other architectures' trace.o are > > linked into > > x86_64-softmmu/qemu-system-x86_64, like hw/arm/trace.o, hw/mips/trace.o > > etc., > > that is not necessary. > > Same thing happens when building other targets. > > > > Only current target arch traces should be linked into qemu-system. > > > > Signed-off -by: Anthony Xu <anthony...@intel.com> > > It's a bit cleaner, but does the benefit outweight the maintenance cost > of the additional code added to the Makefiles?
Perhaps all trace.o files should be put into their own .a instead of being added directly to the linker line: COMMON_LDADDS = $(trace-obj-y) libqemuutil.a libqemustub.a I think the linker would only pull in .o files containing symbols that are actually referenced by the program. It would look like this: ###################################################################### # Build libraries libqemustub.a: $(stub-obj-y) libqemuutil.a: $(util-obj-y) libqemutrace.a: $(trace-obj-y) ###################################################################### COMMON_LDADDS = libqemuutil.a libqemustub.a libqemutrace.a This eliminates the maintenance burden with Anthony's patch. Stefan
signature.asc
Description: PGP signature