Skip to contentSkip to conversation

xen/arm: Allow cleaning the directory even when CONFIG_EARLY_PRINTK is set

PATCH In review Julien Grall 3 participants 5 messages Apr 22, 2019 – May 23, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: Allow cleaning the directory even when CONFIG_EARLY_PRINTK is set

CONFIG_EARLY_PRINTK can only be set when CONFIG_DEBUG is enabled. It can be quite convenient to only modify the target.

However, the target clean will not include the .config. This means CONFIG_DEBUG is not enabled and therefore make will throw an error preventing clean to continue.

The check is not moved at linking time.

---

This code is pretty nasty, but I haven't found a better way for avoiding to check if CONFIG_DEBUG is enabled when the target clean is called.

Ideally we will want to move CONFIG_EARLY_PRINTK in Kconfig. I haven't had time yet to look at it properly so far.

---
 xen/arch/arm/Makefile | 5 +++++
 xen/arch/arm/Rules.mk | 7 -------
 2 files changed, 5 insertions(+), 7 deletions(-)
xen/arch/arm/Makefile +5 -0
index cb902cb6fe..fef508c836 100644
@@ -101,6 +101,11 @@ prelink.o: $(ALL_OBJS)
 endif
 
 $(TARGET)-syms: prelink.o xen.lds
+ifneq ($(CONFIG_EARLY_PRINTK), )
+ifneq ($(CONFIG_DEBUG), y)
+	$(error CONFIG_EARLY_PRINTK enabled for non-debug build)
+endif
+endif
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0
 	$(NM) -pa --format=sysv $(@D)/.$(@F).0 \
xen/arch/arm/Rules.mk +0 -7
index f264592aef..12150986c5 100644
@@ -80,11 +80,4 @@ CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD)
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_BASE_ADDRESS=$(EARLY_UART_BASE_ADDRESS)
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_REG_SHIFT=$(EARLY_UART_REG_SHIFT)
 
-else # !CONFIG_DEBUG
-
-ifneq ($(CONFIG_EARLY_PRINTK),)
-# Early printk is dependant on a debug build.
-$(error CONFIG_EARLY_PRINTK enabled for non-debug build)
-endif
-
 endif
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 9 lines · Julien Grall

CONFIG_EARLY_PRINTK can only be set when CONFIG_DEBUG is enabled. It can be quite convenient to only modify the target.

However, the target clean will not include the .config.

This means CONFIG_DEBUG is not enabled and therefore make will throw an error preventing clean to continue.

The check is not moved at linking time.

               ^ now ?
Quoted 9 lines

---

This code is pretty nasty, but I haven't found a better way for avoiding to check if CONFIG_DEBUG is enabled when the target clean is called.

Ideally we will want to move CONFIG_EARLY_PRINTK in Kconfig. I haven't had time yet to look at it properly so far.

Can we include .config in the clean target?

Quoted 27 lines
---
 xen/arch/arm/Makefile | 5 +++++
 xen/arch/arm/Rules.mk | 7 -------
 2 files changed, 5 insertions(+), 7 deletions(-)
xen/arch/arm/Makefile +5 -0
index cb902cb6fe..fef508c836 100644
@@ -101,6 +101,11 @@ prelink.o: $(ALL_OBJS)
 endif
 
 $(TARGET)-syms: prelink.o xen.lds
+ifneq ($(CONFIG_EARLY_PRINTK), )
+ifneq ($(CONFIG_DEBUG), y)
+	$(error CONFIG_EARLY_PRINTK enabled for non-debug build)
+endif
+endif
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0
 	$(NM) -pa --format=sysv $(@D)/.$(@F).0 \
xen/arch/arm/Rules.mk +0 -0
index f264592aef..12150986c5 100644
@@ -80,11 +80,4 @@ CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD)
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_BASE_ADDRESS=$(EARLY_UART_BASE_ADDRESS)

xen/arch/arm/Rules.mk CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD) · line 83

Quoted 10 lines
xen/arch/arm/Rules.mk +0 -7
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_REG_SHIFT=$(EARLY_UART_REG_SHIFT)
 
-else # !CONFIG_DEBUG
-
-ifneq ($(CONFIG_EARLY_PRINTK),)
-# Early printk is dependant on a debug build.
-$(error CONFIG_EARLY_PRINTK enabled for non-debug build)
-endif
-
 endif

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw

Hi,

Quoted 17 lines · Stefano Stabellini
Quoted 9 lines · Julien Grall

CONFIG_EARLY_PRINTK can only be set when CONFIG_DEBUG is enabled. It can be quite convenient to only modify the target.

However, the target clean will not include the .config.

This means CONFIG_DEBUG is not enabled and therefore make will throw an error preventing clean to continue.

The check is not moved at linking time.

                ^ now ?
Quoted 4 lines

---

Quoted 7 lines
Quoted 5 lines

This code is pretty nasty, but I haven't found a better way for avoiding to check if CONFIG_DEBUG is enabled when the target clean is called.

Ideally we will want to move CONFIG_EARLY_PRINTK in Kconfig. I haven't had time yet to look at it properly so far.

Can we include .config in the clean target?

I did only mention the clean target in the commit message but the issue is the same for any target not include .config. For instance, a distclean results to the same error.

It also feels quite wrong to expect the .config to be in place for any target other than build.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#3 lore raw
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 24.04.19 at 12:47, <[email protected]> wrote:
Quoted 6 lines · Stefano Stabellini
Quoted 5 lines · Julien Grall

This code is pretty nasty, but I haven't found a better way for avoiding to check if CONFIG_DEBUG is enabled when the target clean is called.

Ideally we will want to move CONFIG_EARLY_PRINTK in Kconfig. I haven't had time yet to look at it properly so far.

This, to me, would seem to be the much better approach, as it would avoid replacing one nasty construct by another. Are there any complications?

Quoted 7 lines
Quoted 1 line

Can we include .config in the clean target?

I did only mention the clean target in the commit message but the issue is the same for any target not include .config. For instance, a distclean results to the same error.

It also feels quite wrong to expect the .config to be in place for any target other than build.

I agree.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw

Hi Jan,

Thank you for the feedback.

Quoted 6 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 24.04.19 at 12:47, <[email protected]> wrote:
Quoted 4 lines · Stefano Stabellini
Quoted 3 lines · Julien Grall

This code is pretty nasty, but I haven't found a better way for avoiding to check if CONFIG_DEBUG is enabled when the target clean is called.

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Ideally we will want to move CONFIG_EARLY_PRINTK in Kconfig. I haven't had time yet to look at it properly so far.

This, to me, would seem to be the much better approach, as it would avoid replacing one nasty construct by another. Are there any complications?

Last time I looked at moving earlyprintk to Kconfig I was struggling to find a good way describing them.

I guess I can have another look if I can manage to do it in a couple of hours.

This patch is more a way to paper the problem before causing more trouble when building using Yocto.

Cheers,

Quoted 13 lines
Quoted 7 lines
Quoted 1 line

Can we include .config in the clean target?

I did only mention the clean target in the commit message but the issue is the same for any target not include .config. For instance, a distclean results to the same error.

It also feels quite wrong to expect the .config to be in place for any target other than build.

I agree.

Jan

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel