* [PATCH v2 0/2] build: minor adjustment
@ 2016-12-23 12:24 Wei Liu
2016-12-23 12:24 ` [PATCH v2 1/2] build: move debug{, _symbols} to tools/Rules.mk Wei Liu
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Wei Liu @ 2016-12-23 12:24 UTC (permalink / raw)
To: Xen-devel; +Cc: Wei Liu
Wei Liu (2):
build: move debug{,_symbols} to tools/Rules.mk
build: use debug_symbols to add -g3
Config.mk | 9 ---------
tools/Rules.mk | 10 +++++++++-
2 files changed, 9 insertions(+), 10 deletions(-)
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/2] build: move debug{, _symbols} to tools/Rules.mk
2016-12-23 12:24 [PATCH v2 0/2] build: minor adjustment Wei Liu
@ 2016-12-23 12:24 ` Wei Liu
2017-01-03 9:06 ` Jan Beulich
2016-12-23 12:24 ` [PATCH v2] build: move setting LTO options to xen/Rules.mk Wei Liu
2016-12-23 12:24 ` [PATCH v2 2/2] build: use debug_symbols to add -g3 Wei Liu
2 siblings, 1 reply; 9+ messages in thread
From: Wei Liu @ 2016-12-23 12:24 UTC (permalink / raw)
To: Xen-devel
Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
Ian Jackson, Tim Deegan, Jan Beulich
31d41d7b tried to make debug affect tools build only but failed to take
care of debug_symbols (which appends "-g" to CFLAGS).
Move both to tools/Rules.mk at once in this patch.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
Config.mk | 9 ---------
tools/Rules.mk | 8 ++++++++
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/Config.mk b/Config.mk
index b26e15c..189a443 100644
--- a/Config.mk
+++ b/Config.mk
@@ -16,11 +16,6 @@ or = $(if $(strip $(1)),$(1),$(if $(strip $(2)),$(2),$(if $(strip $(3)),$(
-include $(XEN_ROOT)/.config
-# A debug build of tools?
-# Hypervisor debug build is controlled by Kconfig.
-debug ?= y
-debug_symbols ?= $(debug)
-
XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
-e s/i86pc/x86_32/ -e s/amd64/x86_64/ \
-e s/armv7.*/arm32/ -e s/armv8.*/arm64/ \
@@ -211,10 +206,6 @@ define buildmakevars2header-closure
$(call move-if-changed,$(1).tmp,$(1))
endef
-ifeq ($(debug_symbols),y)
-CFLAGS += -g
-endif
-
CFLAGS += -fno-strict-aliasing
CFLAGS += -std=gnu99
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 0e73690..9a87f18 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -26,6 +26,14 @@ CFLAGS_xeninclude = -I$(XEN_INCLUDE)
XENSTORE_XENSTORED ?= y
+# A debug build of tools?
+debug ?= y
+debug_symbols ?= $(debug)
+
+ifeq ($(debug_symbols),y)
+CFLAGS += -g
+endif
+
ifneq ($(nosharedlibs),y)
INSTALL_SHLIB = $(INSTALL_PROG)
SYMLINK_SHLIB = ln -sf
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2] build: move setting LTO options to xen/Rules.mk
2016-12-23 12:24 [PATCH v2 0/2] build: minor adjustment Wei Liu
2016-12-23 12:24 ` [PATCH v2 1/2] build: move debug{, _symbols} to tools/Rules.mk Wei Liu
@ 2016-12-23 12:24 ` Wei Liu
2016-12-23 12:25 ` Wei Liu
2016-12-23 12:24 ` [PATCH v2 2/2] build: use debug_symbols to add -g3 Wei Liu
2 siblings, 1 reply; 9+ messages in thread
From: Wei Liu @ 2016-12-23 12:24 UTC (permalink / raw)
To: Xen-devel
Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
Ian Jackson, Tim Deegan, Jan Beulich
Having them in StdGNU.mk would affect both hypervisor and tools build.
However judging from the commit message of e4cdd74f LTO was only meant
to affect hypvervisor build.
Move the relevant bits to xen/Rules.mk.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
config/StdGNU.mk | 4 ----
xen/Rules.mk | 2 ++
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 6be8233..039274e 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -35,7 +35,3 @@ UTIL_LIBS = -lutil
SONAME_LDFLAG = -soname
SHLIB_LDFLAGS = -shared
-ifeq ($(lto),y)
-CFLAGS += -flto
-LDFLAGS-$(clang) += -plugin LLVMgold.so
-endif
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 24d13dc..77bcd44 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -120,6 +120,8 @@ $(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -
endif
ifeq ($(CONFIG_LTO),y)
+CFLAGS += -flto
+LDFLAGS-$(clang) += -plugin LLVMgold.so
# Would like to handle all object files as bitcode, but objects made from
# pure asm are in a different format and have to be collected separately.
# Mirror the directory tree, collecting them as built_in_bin.o.
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/2] build: use debug_symbols to add -g3
2016-12-23 12:24 [PATCH v2 0/2] build: minor adjustment Wei Liu
2016-12-23 12:24 ` [PATCH v2 1/2] build: move debug{, _symbols} to tools/Rules.mk Wei Liu
2016-12-23 12:24 ` [PATCH v2] build: move setting LTO options to xen/Rules.mk Wei Liu
@ 2016-12-23 12:24 ` Wei Liu
2017-01-03 9:07 ` Jan Beulich
2 siblings, 1 reply; 9+ messages in thread
From: Wei Liu @ 2016-12-23 12:24 UTC (permalink / raw)
To: Xen-devel
Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
Ian Jackson, Tim Deegan, Jan Beulich
While doing archeology I found 38ce7ce3, we should also make sure
debug_symbols is the responsible for adding "-g" to CFLAGS.
Move adding "-g3" from being guarded by debug to being guarded by
debug_symbols.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
tools/Rules.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 9a87f18..c8386b1 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -31,7 +31,7 @@ debug ?= y
debug_symbols ?= $(debug)
ifeq ($(debug_symbols),y)
-CFLAGS += -g
+CFLAGS += -g3
endif
ifneq ($(nosharedlibs),y)
@@ -146,7 +146,7 @@ SHLIB_libxenvchan = $(SHDEPS_libxenvchan) -Wl,-rpath-link=$(XEN_LIBVCHAN)
ifeq ($(debug),y)
# Disable optimizations and enable debugging information for macros
-CFLAGS += -O0 -g3 -fno-omit-frame-pointer
+CFLAGS += -O0 -fno-omit-frame-pointer
# But allow an override to -O0 in case Python enforces -D_FORTIFY_SOURCE=<n>.
PY_CFLAGS += $(PY_NOOPT_CFLAGS)
else
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2] build: move setting LTO options to xen/Rules.mk
2016-12-23 12:24 ` [PATCH v2] build: move setting LTO options to xen/Rules.mk Wei Liu
@ 2016-12-23 12:25 ` Wei Liu
0 siblings, 0 replies; 9+ messages in thread
From: Wei Liu @ 2016-12-23 12:25 UTC (permalink / raw)
To: Xen-devel
Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
Ian Jackson, Tim Deegan, Jan Beulich
On Fri, Dec 23, 2016 at 12:24:17PM +0000, Wei Liu wrote:
> Having them in StdGNU.mk would affect both hypervisor and tools build.
> However judging from the commit message of e4cdd74f LTO was only meant
> to affect hypvervisor build.
>
> Move the relevant bits to xen/Rules.mk.
>
Ah, git send-email *.patch -- please ignore this patch in this series.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/2] build: move debug{, _symbols} to tools/Rules.mk
2016-12-23 12:24 ` [PATCH v2 1/2] build: move debug{, _symbols} to tools/Rules.mk Wei Liu
@ 2017-01-03 9:06 ` Jan Beulich
0 siblings, 0 replies; 9+ messages in thread
From: Jan Beulich @ 2017-01-03 9:06 UTC (permalink / raw)
To: Wei Liu
Cc: Stefano Stabellini, George Dunlap, Andrew Cooper, Ian Jackson,
Tim Deegan, Xen-devel
>>> On 23.12.16 at 13:24, <wei.liu2@citrix.com> wrote:
> 31d41d7b tried to make debug affect tools build only but failed to take
> care of debug_symbols (which appends "-g" to CFLAGS).
>
> Move both to tools/Rules.mk at once in this patch.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/2] build: use debug_symbols to add -g3
2016-12-23 12:24 ` [PATCH v2 2/2] build: use debug_symbols to add -g3 Wei Liu
@ 2017-01-03 9:07 ` Jan Beulich
2017-01-05 15:14 ` Wei Liu
0 siblings, 1 reply; 9+ messages in thread
From: Jan Beulich @ 2017-01-03 9:07 UTC (permalink / raw)
To: Wei Liu
Cc: Stefano Stabellini, George Dunlap, Andrew Cooper, Ian Jackson,
Tim Deegan, Xen-devel
>>> On 23.12.16 at 13:24, <wei.liu2@citrix.com> wrote:
> @@ -146,7 +146,7 @@ SHLIB_libxenvchan = $(SHDEPS_libxenvchan) -Wl,-rpath-link=$(XEN_LIBVCHAN)
>
> ifeq ($(debug),y)
> # Disable optimizations and enable debugging information for macros
> -CFLAGS += -O0 -g3 -fno-omit-frame-pointer
> +CFLAGS += -O0 -fno-omit-frame-pointer
I think you want to also adjust the comment then.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/2] build: use debug_symbols to add -g3
2017-01-03 9:07 ` Jan Beulich
@ 2017-01-05 15:14 ` Wei Liu
2017-01-05 16:27 ` Ian Jackson
0 siblings, 1 reply; 9+ messages in thread
From: Wei Liu @ 2017-01-05 15:14 UTC (permalink / raw)
To: Jan Beulich
Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
Ian Jackson, Tim Deegan, Xen-devel
On Tue, Jan 03, 2017 at 02:07:31AM -0700, Jan Beulich wrote:
> >>> On 23.12.16 at 13:24, <wei.liu2@citrix.com> wrote:
> > @@ -146,7 +146,7 @@ SHLIB_libxenvchan = $(SHDEPS_libxenvchan) -Wl,-rpath-link=$(XEN_LIBVCHAN)
> >
> > ifeq ($(debug),y)
> > # Disable optimizations and enable debugging information for macros
> > -CFLAGS += -O0 -g3 -fno-omit-frame-pointer
> > +CFLAGS += -O0 -fno-omit-frame-pointer
>
> I think you want to also adjust the comment then.
>
I think I will just change the comment to:
# Disable optimizations
Wei.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/2] build: use debug_symbols to add -g3
2017-01-05 15:14 ` Wei Liu
@ 2017-01-05 16:27 ` Ian Jackson
0 siblings, 0 replies; 9+ messages in thread
From: Ian Jackson @ 2017-01-05 16:27 UTC (permalink / raw)
To: Wei Liu
Cc: Stefano Stabellini, George Dunlap, Andrew Cooper, Tim Deegan,
Jan Beulich, Xen-devel
Wei Liu writes ("Re: [PATCH v2 2/2] build: use debug_symbols to add -g3"):
> On Tue, Jan 03, 2017 at 02:07:31AM -0700, Jan Beulich wrote:
> > On 23.12.16 at 13:24, <wei.liu2@citrix.com> wrote:
> > > @@ -146,7 +146,7 @@ SHLIB_libxenvchan = $(SHDEPS_libxenvchan) -Wl,-rpath-link=$(XEN_LIBVCHAN)
> > >
> > > ifeq ($(debug),y)
> > > # Disable optimizations and enable debugging information for macros
> > > -CFLAGS += -O0 -g3 -fno-omit-frame-pointer
> > > +CFLAGS += -O0 -fno-omit-frame-pointer
> >
> > I think you want to also adjust the comment then.
> >
>
> I think I will just change the comment to:
>
> # Disable optimizations
With that change,
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-01-05 16:27 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-23 12:24 [PATCH v2 0/2] build: minor adjustment Wei Liu
2016-12-23 12:24 ` [PATCH v2 1/2] build: move debug{, _symbols} to tools/Rules.mk Wei Liu
2017-01-03 9:06 ` Jan Beulich
2016-12-23 12:24 ` [PATCH v2] build: move setting LTO options to xen/Rules.mk Wei Liu
2016-12-23 12:25 ` Wei Liu
2016-12-23 12:24 ` [PATCH v2 2/2] build: use debug_symbols to add -g3 Wei Liu
2017-01-03 9:07 ` Jan Beulich
2017-01-05 15:14 ` Wei Liu
2017-01-05 16:27 ` Ian Jackson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).