Remove libqemustub.a in order to improve error
PATCH 1/2 Makefile: Remove libqemustub.a
In reply to Alistair FrancisUsing two libraries (libqemuutil.a and libqemustub.a) would sometimes result in circular dependencies. To avoid these issues let's just combine both into a single library that functions as both.
---
Makefile | 7 +++---- Makefile.target | 2 +- docs/devel/build-system.txt | 14 +++++--------- tests/Makefile.include | 6 +++--- 4 files changed, 12 insertions(+), 17 deletions(-)
Makefile +3 -4
@@ -344,7 +344,7 @@ subdir-dtc:dtc/libfdt dtc/tests dtc/%: mkdir -p $@ -$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(chardev-obj-y) \ +$(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \ $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY)) ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
@@ -364,12 +364,11 @@ Makefile: $(version-obj-y) ###################################################################### # Build libraries -libqemustub.a: $(stub-obj-y) -libqemuutil.a: $(util-obj-y) $(trace-obj-y) +libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y) ###################################################################### -COMMON_LDADDS = libqemuutil.a libqemustub.a +COMMON_LDADDS = libqemuutil.a qemu-img.o: qemu-img-cmds.h
Makefile.target +1 -1
@@ -193,7 +193,7 @@ all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y) $(QEMU_PROG_BUILD): config-devices.mak -COMMON_LDADDS = ../libqemuutil.a ../libqemustub.a +COMMON_LDADDS = ../libqemuutil.a # build either PROG or PROGW $(QEMU_PROG_BUILD): $(all-obj-y) $(COMMON_LDADDS)
docs/devel/build-system.txt +5 -9
@@ -232,15 +232,11 @@ The utility code that is used by all binaries is built into a static archive called libqemuutil.a, which is then linked to all the binaries. In order to provide hooks that are only needed by some of the binaries, code in libqemuutil.a may depend on other functions that are -not fully implemented by all QEMU binaries. To deal with this there is a -second library called libqemustub.a which provides dummy stubs for all -these functions. These will get lazy linked into the binary if the real -implementation is not present. In this way, the libqemustub.a static -library can be thought of as a portable implementation of the weak -symbols concept. All binaries should link to both libqemuutil.a and -libqemustub.a. e.g. - - qemu-img$(EXESUF): qemu-img.o ..snip.. libqemuutil.a libqemustub.a +not fully implemented by all QEMU binaries. To deal with this there are +dummy stubs for all these functions in libqemuutil.a. +All binaries should link to both libqemuutil.a and libqemustub.a. e.g. + + qemu-img$(EXESUF): qemu-img.o ..snip.. libqemuutil.a Windows platform portability
tests/Makefile.include +3 -3
@@ -553,7 +553,7 @@ QEMU_CFLAGS += -I$(SRC_PATH)/tests # Deps that are common to various different sets of tests below -test-util-obj-y = libqemuutil.a libqemustub.a +test-util-obj-y = libqemuutil.a test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y) test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \ tests/test-qapi-event.o tests/test-qmp-introspect.o \
@@ -608,8 +608,8 @@ tests/test-vmstate$(EXESUF): tests/test-vmstate.o \ $(test-io-obj-y) tests/test-timed-average$(EXESUF): tests/test-timed-average.o $(test-util-obj-y) tests/test-base64$(EXESUF): tests/test-base64.o \ - libqemuutil.a libqemustub.a -tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o hw/core/ptimer.o libqemustub.a + libqemuutil.a +tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o hw/core/ptimer.o $(test-util-obj-y) tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y)
Signature · 1 line
2.11.0
PATCH 2/2 Convert remaining single line fprintf() to warn_report()
In reply to Alistair FrancisConvert any remaining uses of fprintf(stderr, "warning:"... to use warn_report() instead. This helps standardise on a single method of printing warnings to the user.
All of the warnings were changed using this command:
find ./* -type f -exec sed -i 's|fprintf(.*".*warning[,:] |warn_report("|Ig' {} +
The #include lines and chagnes to the test Makefile were manually updated to allow the code to compile.
---
This was split out of my original series fixing QEMU warnings.
tests/Makefile.include | 2 +- util/cutils.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
tests/Makefile.include +1 -1
@@ -584,7 +584,7 @@ tests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y) tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o $(test-util-obj-y) $(test-crypto-obj-y) tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o migration/page_cache.o $(test-util-obj-y) -tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o +tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o $(test-util-obj-y) tests/test-int128$(EXESUF): tests/test-int128.o tests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y) tests/test-rcu-list$(EXESUF): tests/test-rcu-list.o $(test-util-obj-y)
util/cutils.c +2 -1
@@ -30,6 +30,7 @@#include "qemu/iov.h" #include "net/net.h" #include "qemu/cutils.h" +#include "qemu/error-report.h" void strpadcpy (char *buf,int buf_size,const char *str,char pad) {
@@ -601,7 +602,7 @@ int parse_debug_env(const char *name, int max, int initial)return initial; }if (debug <0 || debug > max || errno !=0 ) { -fprintf (stderr,"warning: %s not in [0, %d]" , name, max); +warn_report ("%s not in [0, %d]" , name, max);return initial; }return debug;
Signature · 1 line
2.11.0
cover Remove libqemustub.a in order to improve error
As discussed with Paolo and Markus let's combine libqemustub.a into libqemuutil.a to avoid circular dependencies.
Alistair Francis (2):
Makefile: Remove libqemustub.a
Convert remaining single line fprintf() to warn_report()
Makefile | 7 +++---- Makefile.target | 2 +- docs/devel/build-system.txt | 14 +++++--------- tests/Makefile.include | 8 ++++---- util/cutils.c | 3 ++- 5 files changed, 15 insertions(+), 19 deletions(-)
Signature · 1 line
2.11.0
Re: [Qemu-devel] [PATCH v1 1/2] Makefile: Remove libqemustub.a
In reply to Alistair FrancisHi Alistair,
Quoted 64 lines · Alistair Francis
Using two libraries (libqemuutil.a and libqemustub.a) would sometimes result in circular dependencies. To avoid these issues let's just combine both into a single library that functions as both.
Signed-off-by Alistair Francis <[email protected]>---
Makefile | 7 +++---- Makefile.target | 2 +- docs/devel/build-system.txt | 14 +++++--------- tests/Makefile.include | 6 +++--- 4 files changed, 12 insertions(+), 17 deletions(-)Makefile +3
-4@@ -344,7 +344,7 @@ subdir-dtc:dtc/libfdt dtc/tests dtc/%: mkdir -p $@ -$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(chardev-obj-y) \ +$(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \ $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY)) ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))@@ -364,12 +364,11 @@ Makefile: $(version-obj-y) ###################################################################### # Build libraries -libqemustub.a: $(stub-obj-y) -libqemuutil.a: $(util-obj-y) $(trace-obj-y) +libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y) ###################################################################### -COMMON_LDADDS = libqemuutil.a libqemustub.a +COMMON_LDADDS = libqemuutil.a qemu-img.o: qemu-img-cmds.hMakefile.target +1
-1@@ -193,7 +193,7 @@ all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y) $(QEMU_PROG_BUILD): config-devices.mak -COMMON_LDADDS = ../libqemuutil.a ../libqemustub.a +COMMON_LDADDS = ../libqemuutil.a # build either PROG or PROGW $(QEMU_PROG_BUILD): $(all-obj-y) $(COMMON_LDADDS)docs/devel/build-system.txt +0
-2@@ -232,15 +232,11 @@ The utility code that is used by all binaries is built into a static archive called libqemuutil.a, which is then linked to all the binaries. In order to provide hooks that are only needed by some of the binaries, code in libqemuutil.a may depend on other functions that are -not fully implemented by all QEMU binaries. To deal with this there is a -second library called libqemustub.a which provides dummy stubs for all
docs/devel/build-system.txt The utility code that is used by all binaries is built into a · line 237
Quoted 10 lines
docs/devel/build-system.txt +3
-7-these functions. These will get lazy linked into the binary if the real -implementation is not present. In this way, the libqemustub.a static -library can be thought of as a portable implementation of the weak -symbols concept. All binaries should link to both libqemuutil.a and -libqemustub.a. e.g. - - qemu-img$(EXESUF): qemu-img.o ..snip.. libqemuutil.a libqemustub.a +not fully implemented by all QEMU binaries. To deal with this there are +dummy stubs for all these functions in libqemuutil.a. +All binaries should link to both libqemuutil.a and libqemustub.a. e.g.
still libqemustub.a
docs/devel/build-system.txt The utility code that is used by all binaries is built into a · line 239
Quoted 2 lines
docs/devel/build-system.txt +2
-0+ + qemu-img$(EXESUF): qemu-img.o ..snip.. libqemuutil.a
changed a bit:
The utility code that is used by all binaries is built into a static archive called libqemuutil.a, which is then linked to all the binaries. In order to provide hooks that are only needed by some of the binaries, code in libqemuutil.a may depend on other functions that are not fully implemented by all QEMU binaries. Dummy stubs for all these functions are also provided by this library, and will get lazy linked into the binary if the real implementation is not present. In this way, this static library can be thought of as a portable implementation of the weak symbols concept. All binaries should link to libqemuutil.a. e.g.
qemu-img$(EXESUF): qemu-img.o ..snip.. libqemuutil.a
This or removing "libqemustub.a":
Quoted 26 lines
docs/devel/build-system.txt +0
-0Windows platform portabilitytests/Makefile.include +3
-3@@ -553,7 +553,7 @@ QEMU_CFLAGS += -I$(SRC_PATH)/tests # Deps that are common to various different sets of tests below -test-util-obj-y = libqemuutil.a libqemustub.a +test-util-obj-y = libqemuutil.a test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y) test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \ tests/test-qapi-event.o tests/test-qmp-introspect.o \@@ -608,8 +608,8 @@ tests/test-vmstate$(EXESUF): tests/test-vmstate.o \ $(test-io-obj-y) tests/test-timed-average$(EXESUF): tests/test-timed-average.o $(test-util-obj-y) tests/test-base64$(EXESUF): tests/test-base64.o \ - libqemuutil.a libqemustub.a -tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o hw/core/ptimer.o libqemustub.a + libqemuutil.a +tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o hw/core/ptimer.o $(test-util-obj-y) tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y)
Re: [Qemu-devel] [PATCH v1 2/2] Convert remaining single line fprintf() to warn_report()
In reply to Alistair FrancisQuoted 8 lines · Alistair Francis
Convert any remaining uses of fprintf(stderr, "warning:"... to use
warn_report()instead. This helps standardise on a single method of printing warnings to the user.All of the warnings were changed using this command:
find ./* -type f -exec sed -i 's|fprintf(.*".*warning[,:] |warn_report("|Ig' {} +The #include lines and chagnes to the test
Makefilewere manually
line, changes
Quoted 3 lines
updated to allow the code to compile.
Signed-off-by Alistair Francis <[email protected]>
Quoted 42 lines
---
This was split out of my original series fixing QEMU warnings.tests/Makefile.include | 2 +- util/cutils.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)tests/Makefile.include +1
-1@@ -584,7 +584,7 @@ tests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y) tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o $(test-util-obj-y) $(test-crypto-obj-y) tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/xbzrle.o migration/page_cache.o $(test-util-obj-y) -tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o +tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o $(test-util-obj-y) tests/test-int128$(EXESUF): tests/test-int128.o tests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y) tests/test-rcu-list$(EXESUF): tests/test-rcu-list.o $(test-util-obj-y)util/cutils.c +2
-1@@ -30,6 +30,7 @@#include "qemu/iov.h" #include "net/net.h" #include "qemu/cutils.h" +#include "qemu/error-report.h" void strpadcpy (char *buf,int buf_size,const char *str,char pad) {@@ -601,7 +602,7 @@ int parse_debug_env(const char *name, int max, int initial)return initial; }if (debug <0 || debug > max || errno !=0 ) { -fprintf (stderr,"warning: %s not in [0, %d]" , name, max); +warn_report ("%s not in [0, %d]" , name, max);return initial; }return debug;
Re: [Qemu-devel] [PATCH v1 1/2] Makefile: Remove libqemustub.a
In reply to Philippe Mathieu-DaudéQuoted 66 lines · Philippe Mathieu-Daudé
Hi Alistair,
Quoted 62 lines · Alistair Francis
Using two libraries (libqemuutil.a and libqemustub.a) would sometimes result in circular dependencies. To avoid these issues let's just combine both into a single library that functions as both.
Signed-off-by Alistair Francis <[email protected]>---
Makefile | 7 +++---- Makefile.target | 2 +- docs/devel/build-system.txt | 14 +++++--------- tests/Makefile.include | 6 +++--- 4 files changed, 12 insertions(+), 17 deletions(-)Makefile +3
-1@@ -344,7 +344,7 @@ subdir-dtc:dtc/libfdt dtc/tests dtc/%: mkdir -p $@ -$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(chardev-obj-y) \ +$(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \ $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY)) ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))@@ -364,12 +364,11 @@ Makefile: $(version-obj-y) ###################################################################### # Build libraries -libqemustub.a: $(stub-obj-y) -libqemuutil.a: $(util-obj-y) $(trace-obj-y) +libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y) ###################################################################### -COMMON_LDADDS = libqemuutil.a libqemustub.a +COMMON_LDADDS = libqemuutil.a qemu-img.o: qemu-img-cmds.h diff --git a/Makefile.target b/Makefile.targetindex
7f42c45db8..0a80caf79c100644Makefile.target +1
-0@@ -193,7 +193,7 @@ all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y) $(QEMU_PROG_BUILD): config-devices.mak -COMMON_LDADDS = ../libqemuutil.a ../libqemustub.a +COMMON_LDADDS = ../libqemuutil.a # build either PROG or PROGW $(QEMU_PROG_BUILD): $(all-obj-y) $(COMMON_LDADDS)docs/devel/build-system.txt +0
-0@@ -232,15 +232,11 @@ The utility code that is used by all binaries isbuilt into a
static archive called libqemuutil.a, which is then linked to all the binaries. In order to provide hooks that are only needed by some of the binaries, code in libqemuutil.a may depend on other functions that aredocs/devel/build-system.txt +0
-7-not fully implemented by all QEMU binaries. To deal with this there is a -second library called libqemustub.a which provides dummy stubs for all -these functions. These will get lazy linked into the binary if the real -implementation is not present. In this way, the libqemustub.a static -library can be thought of as a portable implementation of the weak -symbols concept. All binaries should link to both libqemuutil.a and -libqemustub.a. e.g.
Quoted 8 lines
docs/devel/build-system.txt The utility code that is used by all binaries is built into a · line 237
Quoted 5 lines
docs/devel/build-system.txt +3
-2- - qemu-img$(EXESUF): qemu-img.o ..snip.. libqemuutil.a libqemustub.a +not fully implemented by all QEMU binaries. To deal with this there are +dummy stubs for all these functions in libqemuutil.a. +All binaries should link to both libqemuutil.a and libqemustub.a. e.g.still libqemustub.a
Ah, I missed this. I'll fix this up.
Quoted 17 lines
Quoted 3 lines
+
+ qemu-img$(EXESUF): qemu-img.o ..snip.. libqemuutil.achanged a bit:
The utility code that is used by all binaries is built into a static archive called libqemuutil.a, which is then linked to all the binaries. In order to provide hooks that are only needed by some of the binaries, code in libqemuutil.a may depend on other functions that are not fully implemented by all QEMU binaries. Dummy stubs for all these functions are also provided by this library, and will get lazy linked into the binary if the real implementation is not present. In this way, this static library can be thought of as a portable implementation of the weak symbols concept. All binaries should link to libqemuutil.a. e.g.
Quoted 4 lines
qemu-img$(EXESUF): qemu-img.o ..snip.. libqemuutil.a
This or removing "libqemustub.a":
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Thanks!
Alistair
Quoted 27 lines
Quoted 27 lines
Windows platform portability
tests/Makefile.include +1
-3@@ -553,7 +553,7 @@ QEMU_CFLAGS += -I$(SRC_PATH)/tests # Deps that are common to various different sets of tests below -test-util-obj-y = libqemuutil.a libqemustub.a +test-util-obj-y = libqemuutil.a test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y) test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \ tests/test-qapi-event.o tests/test-qmp-introspect.o \@@ -608,8 +608,8 @@ tests/test-vmstate$(EXESUF): tests/test-vmstate.o \ $(test-io-obj-y) tests/test-timed-average$(EXESUF): tests/test-timed-average.o $(test-util-obj-y) tests/test-base64$(EXESUF): tests/test-base64.o \ - libqemuutil.a libqemustub.a -tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o
hw/core/ptimer.olibqemustub.atests/Makefile.include +2
-0+ libqemuutil.a +tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o
hw/core/ptimer.o$(test-util-obj-y)tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y)
Paolo Bonzini
AppliedQuoted 7 lines · Alistair Francis
As discussed with Paolo and Markus let's combine libqemustub.a into libqemuutil.a to avoid circular dependencies.
Alistair Francis (2):
Makefile: Remove libqemustub.a
Convert remaining single linefprintf()towarn_report()
Quoted 7 lines
Makefile | 7 +++---- Makefile.target | 2 +- docs/devel/build-system.txt | 14 +++++--------- tests/Makefile.include | 8 ++++---- util/cutils.c | 3 ++- 5 files changed, 15 insertions(+), 19 deletions(-)
Queued, thanks (with Philippe's adjustments to the comments).
Paolo
Quoted 16 lines · Paolo Bonzini
Quoted 7 lines · Alistair Francis
As discussed with Paolo and Markus let's combine libqemustub.a into libqemuutil.a to avoid circular dependencies.
Alistair Francis (2):
Makefile: Remove libqemustub.a
Convert remaining single linefprintf()towarn_report()Quoted 7 lines
Makefile | 7 +++---- Makefile.target | 2 +- docs/devel/build-system.txt | 14 +++++--------- tests/Makefile.include | 8 ++++---- util/cutils.c | 3 ++- 5 files changed, 15 insertions(+), 19 deletions(-)
Quoted 1 line
Queued, thanks (with Philippe's adjustments to the comments).
Thanks Paolo.
I actually sent a new version with Philippe's comments, it's included as part of the "More warning reporting fixed" series.
Version 5 of that has been reviewed by Markus, I will send it out today. Can you take that instead?
Thanks,
Alistair
Quoted 2 lines
Paolo
Quoted 19 lines · Alistair Francis
Quoted 16 lines · Paolo Bonzini
Quoted 7 lines · Alistair Francis
As discussed with Paolo and Markus let's combine libqemustub.a into libqemuutil.a to avoid circular dependencies.
Alistair Francis (2):
Makefile: Remove libqemustub.a
Convert remaining single linefprintf()towarn_report()Quoted 7 lines
Makefile | 7 +++---- Makefile.target | 2 +- docs/devel/build-system.txt | 14 +++++--------- tests/Makefile.include | 8 ++++---- util/cutils.c | 3 ++- 5 files changed, 15 insertions(+), 19 deletions(-)Quoted 1 line
Queued, thanks (with Philippe's adjustments to the comments).
Quoted 7 lines
Thanks Paolo.
I actually sent a new version with Philippe's comments, it's included as part of the "More warning reporting fixed" series.
Version 5 of that has been reviewed by Markus, I will send it out today. Can you take that instead?
Ah, I meant version 4.
The series should be very close to being merged. If you want that whole series can go in or you can take this and I can rebase the larger series. Whatever is easiest for you.
Thanks,
Alistair
Quoted 6 lines
Thanks,
AlistairQuoted 2 lines
Paolo