Skip to contentSkip to conversation

Stringify support commas

RFC PATCH Applied Mathieu Desnoyers 5 participants 16 messages Apr 22, 2008 – Apr 25, 2008

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Stringify support commas

Hi,

I noticed that the __stringify() macro does not support defines with commas. This patchset change the macro so it takes variable arguments. All the "-traditional" compilation flags are removed from all architectures which still use it so the variadic macro is supported.

It is used by the x86 NMI-safe int3 and page fault patch.

Mathieu

Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#1 lore raw

RFC PATCH 1/9 CRIS remove -traditional

Subject: [RFC patch 1/9] Re: [PATCH] Stringify support commas

Quoted 5 lines

This is a no-no for those archs that still use -traditional.

Quoted 4 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Sam

---
 arch/cris/arch-v10/boot/compressed/Makefile |    2 +-
 arch/cris/arch-v10/boot/rescue/Makefile     |    1 -
 arch/cris/arch-v10/lib/Makefile             |    3 ---
 3 files changed, 1 insertion(+), 5 deletions(-)
arch/cris/arch-v10/boot/compressed/Makefile +1 -1
Index: linux-2.6-lttng/arch/cris/arch-v10/boot/compressed/Makefile
===================================================================
@@ -22,7 +22,7 @@ $(obj)/decompress.bin: $(obj)/decompress
 	$(call if_changed,objcopy)
 
 $(obj)/head.o: $(obj)/head.S .config
-	@$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
+	@$(CC) -D__ASSEMBLY__ -c $< -o $@
 
 $(obj)/misc.o: $(obj)/misc.c .config
 	@$(CC) -D__KERNEL__ -c $< -o $@
arch/cris/arch-v10/boot/rescue/Makefile +0 -1
Index: linux-2.6-lttng/arch/cris/arch-v10/boot/rescue/Makefile
===================================================================
@@ -4,7 +4,6 @@
 
 CC = gcc-cris -mlinux $(LINUXINCLUDE)
 ccflags-y += -O2
-asflags-y += -traditional
 LD = gcc-cris -mlinux -nostdlib
 ldflags-y += -T $(obj)/rescue.ld
 OBJCOPY = objcopy-cris
arch/cris/arch-v10/lib/Makefile +0 -3
Index: linux-2.6-lttng/arch/cris/arch-v10/lib/Makefile
===================================================================
@@ -2,8 +2,5 @@
 # Makefile for Etrax-specific library files..
 #
 
-
-EXTRA_AFLAGS := -traditional
-
 lib-y  = checksum.o checksumcopy.o string.o usercopy.o memset.o csumcpfruser.o
 
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#2 lore raw

RFC PATCH 2/9 M32R remove -traditional

In reply to Mathieu Desnoyers

Subject: [RFC patch 2/9] Re: [PATCH] Stringify support commas

Quoted 5 lines

This is a no-no for those archs that still use -traditional.

Quoted 4 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Sam

---
 arch/m32r/boot/compressed/Makefile |    1 -
 arch/m32r/kernel/Makefile          |    2 --
 2 files changed, 3 deletions(-)
arch/m32r/boot/compressed/Makefile +0 -1
Index: linux-2.6-lttng/arch/m32r/boot/compressed/Makefile
===================================================================
@@ -6,7 +6,6 @@
 
 targets		:= vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o \
 		   piggy.o vmlinux.lds
-EXTRA_AFLAGS	:= -traditional
 
 OBJECTS = $(obj)/head.o $(obj)/misc.o
 
arch/m32r/kernel/Makefile +0 -2
Index: linux-2.6-lttng/arch/m32r/kernel/Makefile
===================================================================
@@ -9,5 +9,3 @@ obj-y	:= process.o entry.o traps.o align
 
 obj-$(CONFIG_SMP)		+= smp.o smpboot.o
 obj-$(CONFIG_MODULES)		+= module.o
-
-EXTRA_AFLAGS	:= -traditional
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#3 lore raw

RFC PATCH 3/9 H8300 remove -traditional

In reply to Mathieu Desnoyers

Subject: [RFC patch 3/9] Re: [PATCH] Stringify support commas

Quoted 5 lines

This is a no-no for those archs that still use -traditional.

Quoted 4 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Sam

CC Sam Ravnborg <[email protected]>
CC Yoshinori Sato <[email protected]>
---
 arch/h8300/boot/compressed/Makefile |    1 -
 1 file changed, 1 deletion(-)
arch/h8300/boot/compressed/Makefile +0 -1
Index: linux-2.6-lttng/arch/h8300/boot/compressed/Makefile
===================================================================
@@ -5,7 +5,6 @@
 #
 
 targets		:= vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
-EXTRA_AFLAGS	:= -traditional
 
 OBJECTS = $(obj)/head.o $(obj)/misc.o
 
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#4 lore raw

RFC PATCH 4/9 M68K remove -traditional

In reply to Mathieu Desnoyers

Subject: [RFC patch 4/9] Re: [PATCH] Stringify support commas

Quoted 5 lines

This is a no-no for those archs that still use -traditional.

Quoted 4 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Sam

(cross-compile test ok)

---
 arch/m68k/fpsp040/Makefile  |    1 -
 arch/m68k/ifpsp060/Makefile |    1 -
 arch/m68k/kernel/Makefile   |    2 --
 arch/m68k/lib/Makefile      |    2 --
 arch/m68k/math-emu/Makefile |    2 --
 5 files changed, 8 deletions(-)
arch/m68k/fpsp040/Makefile +0 -1
Index: linux-2.6-lttng/arch/m68k/fpsp040/Makefile
===================================================================
@@ -10,7 +10,6 @@ obj-y    := bindec.o binstr.o decbin.o d
 	    x_bsun.o x_fline.o x_operr.o x_ovfl.o x_snan.o x_store.o \
 	    x_unfl.o x_unimp.o x_unsupp.o bugfix.o skeleton.o
 
-EXTRA_AFLAGS := -traditional
 EXTRA_LDFLAGS := -x
 
 $(OS_OBJS): fpsp.h
arch/m68k/ifpsp060/Makefile +0 -1
Index: linux-2.6-lttng/arch/m68k/ifpsp060/Makefile
===================================================================
@@ -6,5 +6,4 @@
 
 obj-y := fskeleton.o iskeleton.o os.o
 
-EXTRA_AFLAGS := -traditional
 EXTRA_LDFLAGS := -x
arch/m68k/kernel/Makefile +0 -2
Index: linux-2.6-lttng/arch/m68k/kernel/Makefile
===================================================================
@@ -16,5 +16,3 @@ devres-y = ../../../kernel/irq/devres.o
 
 obj-$(CONFIG_PCI)	+= bios32.o
 obj-y$(CONFIG_MMU_SUN3) += dma.o	# no, it's not a typo
-
-EXTRA_AFLAGS := -traditional
arch/m68k/lib/Makefile +0 -2
Index: linux-2.6-lttng/arch/m68k/lib/Makefile
===================================================================
@@ -2,7 +2,5 @@
 # Makefile for m68k-specific library files..
 #
 
-EXTRA_AFLAGS := -traditional
-
 lib-y	:= ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
 	   checksum.o string.o semaphore.o uaccess.o
arch/m68k/math-emu/Makefile +0 -2
Index: linux-2.6-lttng/arch/m68k/math-emu/Makefile
===================================================================
@@ -2,8 +2,6 @@
 # Makefile for the linux kernel.
 #
 
-EXTRA_AFLAGS := -traditional
-
 #EXTRA_AFLAGS += -DFPU_EMU_DEBUG
 #EXTRA_CFLAGS += -DFPU_EMU_DEBUG
 
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#5 lore raw

RFC PATCH 5/9 PARISC remove -traditional

In reply to Mathieu Desnoyers

Subject: [RFC patch 5/9] Re: [PATCH] Stringify support commas

Quoted 5 lines

This is a no-no for those archs that still use -traditional.

Quoted 4 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Sam

---
 arch/parisc/kernel/Makefile |    3 ---
 1 file changed, 3 deletions(-)
arch/parisc/kernel/Makefile +0 -3
Index: linux-2.6-lttng/arch/parisc/kernel/Makefile
===================================================================
@@ -4,9 +4,6 @@
 
 extra-y			:= init_task.o head.o vmlinux.lds
 
-AFLAGS_entry.o	:= -traditional
-AFLAGS_pacache.o := -traditional
-
 obj-y	     	:= cache.o pacache.o setup.o traps.o time.o irq.o \
 		   pa7300lc.o syscall.o entry.o sys_parisc.o firmware.o \
 		   ptrace.o hardware.o inventory.o drivers.o semaphore.o \
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#6 lore raw

Re: [RFC patch 5/9] PARISC remove -traditional

Quoted 5 lines · Mathieu Desnoyers

Subject: [RFC patch 5/9] Re: [PATCH] Stringify support commas

Quoted 4 lines

This is a no-no for those archs that still use -traditional.

Quoted 3 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Quoted 8 lines
Quoted 1 line
Quoted 1 line

Sam

no. more work needs to be done to remove it. i have a patch already.

it would likely be smarter to just use a private stringify for the C code for now.

#7 lore raw

Re: [RFC patch 5/9] PARISC remove -traditional

Quoted 15 lines · * Kyle McMartin ([email protected]) wrote:
Quoted 5 lines · Mathieu Desnoyers

Subject: [RFC patch 5/9] Re: [PATCH] Stringify support commas

Quoted 4 lines

This is a no-no for those archs that still use -traditional.

Quoted 3 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Quoted 8 lines
Quoted 1 line
Quoted 1 line

Sam

Quoted 4 lines

no. more work needs to be done to remove it. i have a patch already.

it would likely be smarter to just use a private stringify for the C code for now.

OK, this is what I wanted to know.

Thanks,

Mathieu

Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#8 lore raw

RFC PATCH 6/9 POWERPC remove -traditional

In reply to Mathieu Desnoyers

Subject: [RFC patch 6/9] Re: [PATCH] Stringify support commas

Quoted 5 lines

This is a no-no for those archs that still use -traditional.

Quoted 4 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Sam

---
 arch/powerpc/boot/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/boot/Makefile +1 -1
Index: linux-2.6-lttng/arch/powerpc/boot/Makefile
===================================================================
@@ -23,7 +23,7 @@ BOOTCFLAGS    := -Wall -Wundef -Wstrict-
 		 -fno-strict-aliasing -Os -msoft-float -pipe \
 		 -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
 		 -isystem $(shell $(CROSS32CC) -print-file-name=include)
-BOOTAFLAGS	:= -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
+BOOTAFLAGS	:= -D__ASSEMBLY__ $(BOOTCFLAGS) -nostdinc
 
 ifdef CONFIG_DEBUG_INFO
 BOOTCFLAGS	+= -g
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#9 lore raw

Re: [RFC patch 6/9] POWERPC remove -traditional

Quoted 7 lines · Mathieu Desnoyers

Subject: [RFC patch 6/9] Re: [PATCH] Stringify support commas

Quoted 5 lines

This is a no-no for those archs that still use -traditional.

Quoted 4 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Sam

Quoted 7 lines
---
 arch/powerpc/boot/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Looks OK. I'll put it in my tree.

Paul.

#10 lore raw

Re: [RFC patch 6/9] POWERPC remove -traditional

Quoted 16 lines · * Paul Mackerras ([email protected]) wrote:
Quoted 7 lines · Mathieu Desnoyers

Subject: [RFC patch 6/9] Re: [PATCH] Stringify support commas

Quoted 5 lines

This is a no-no for those archs that still use -traditional.

Quoted 4 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Sam

Quoted 7 lines
---
 arch/powerpc/boot/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 3 lines

Looks OK. I'll put it in my tree.

Paul.

OK, although it won't be needed with v2 of the stringify with commas. There seems to be some important details which differ between -traditional and stdc gcc operation which makes it non-trivial to remove the -traditional, at least on sparc. Maybe Kyle could tell us a bit more about the nature of these limitations ?

I would wait a bit before merging until we at least identify what those limitations are.

Mathieu

Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#11 lore raw

RFC PATCH 7/9 S390 remove -traditional

In reply to Mathieu Desnoyers

Subject: [RFC patch 7/9] Re: [PATCH] Stringify support commas

Quoted 5 lines

This is a no-no for those archs that still use -traditional.

Quoted 4 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Sam

(cross-compile test ok)

---
 arch/s390/kernel/Makefile   |    2 --
 arch/s390/lib/Makefile      |    2 --
 arch/s390/math-emu/Makefile |    1 -
 3 files changed, 5 deletions(-)
arch/s390/kernel/Makefile +0 -2
Index: linux-2.6-lttng/arch/s390/kernel/Makefile
===================================================================
@@ -2,8 +2,6 @@
 # Makefile for the linux kernel.
 #
 
-EXTRA_AFLAGS	:= -traditional
-
 #
 # Passing null pointers is ok for smp code, since we access the lowcore here.
 #
arch/s390/lib/Makefile +0 -2
Index: linux-2.6-lttng/arch/s390/lib/Makefile
===================================================================
@@ -2,8 +2,6 @@
 # Makefile for s390-specific library files..
 #
 
-EXTRA_AFLAGS := -traditional
-
 lib-y += delay.o string.o uaccess_std.o uaccess_pt.o
 obj-$(CONFIG_32BIT) += div64.o qrnnd.o
 lib-$(CONFIG_64BIT) += uaccess_mvcos.o
arch/s390/math-emu/Makefile +0 -1
Index: linux-2.6-lttng/arch/s390/math-emu/Makefile
===================================================================
@@ -5,4 +5,3 @@
 obj-$(CONFIG_MATHEMU) := math.o
 
 EXTRA_CFLAGS := -I$(src) -Iinclude/math-emu -w
-EXTRA_AFLAGS := -traditional
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#12 lore raw

Re: [RFC patch 7/9] S390 remove -traditional

Quoted 26 lines · Mathieu Desnoyers

Subject: [RFC patch 7/9] Re: [PATCH] Stringify support commas

Quoted 5 lines

This is a no-no for those archs that still use -traditional.

Quoted 4 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Sam

(cross-compile test ok)

---
 arch/s390/kernel/Makefile   |    2 --
 arch/s390/lib/Makefile      |    2 --
 arch/s390/math-emu/Makefile |    1 -
 3 files changed, 5 deletions(-)

Index: linux-2.6-lttng/arch/s390/kernel/Makefile
===================================================================

arch/s390/kernel/Makefile line 6

Quoted 5 lines
arch/s390/kernel/Makefile +0 -2
@@ -2,8 +2,6 @@
 # Makefile for the linux kernel.
 #
 
-EXTRA_AFLAGS	:= -traditional
-

Thanks, applied. This did cause problems in late 2.6.25 and I think Martin had a similar patch ready.

#13 lore raw

RFC PATCH 8/9 SH remove -traditional

In reply to Mathieu Desnoyers

Subject: [RFC patch 8/9] Re: [PATCH] Stringify support commas

Quoted 5 lines

This is a no-no for those archs that still use -traditional.

Quoted 4 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Sam

---
 arch/sh/boot/compressed/Makefile_32 |    1 -
 arch/sh/boot/compressed/Makefile_64 |    1 -
 2 files changed, 2 deletions(-)

Index: linux-2.6-lttng/arch/sh/boot/compressed/Makefile_32
=================================--- linux-2.6-lttng.orig/arch/sh/boot/compressed/Makefile_32 2008-04-21 10:07:12.000000000 -0400
+++ linux-2.6-lttng/arch/sh/boot/compressed/Makefile_32 2008-04-21 10:07:17.000000000 -0400
@@ -6,7 +6,6 @@

targets := vmlinux vmlinux.bin vmlinux.bin.gz \
head_32.o misc_32.o piggy.o
-EXTRA_AFLAGS := -traditional

OBJECTS = $(obj)/head_32.o $(obj)/misc_32.o

Index: linux-2.6-lttng/arch/sh/boot/compressed/Makefile_64
=================================--- linux-2.6-lttng.orig/arch/sh/boot/compressed/Makefile_64 2008-04-21 10:07:12.000000000 -0400
+++ linux-2.6-lttng/arch/sh/boot/compressed/Makefile_64 2008-04-21 10:07:17.000000000 -0400
@@ -13,7 +13,6 @@

targets := vmlinux vmlinux.bin vmlinux.bin.gz \
head_64.o misc_64.o cache.o piggy.o
-EXTRA_AFLAGS := -traditional

OBJECTS := $(obj)/vmlinux_64.lds $(obj)/head_64.o $(obj)/misc_64.o \
$(obj)/cache.o

Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#14 lore raw

Re: [RFC patch 8/9] SH remove -traditional

Quoted 7 lines · Mathieu Desnoyers

Subject: [RFC patch 8/9] Re: [PATCH] Stringify support commas

Quoted 5 lines

This is a no-no for those archs that still use -traditional.

Quoted 4 lines

I dunno if this is a problem for you at the moment and the right fix is anyway to nuke -traditional.

Sam

Quoted 9 lines
---
 arch/sh/boot/compressed/Makefile_32 |    1 -
 arch/sh/boot/compressed/Makefile_64 |    1 -
 2 files changed, 2 deletions(-)

Oops, these must have snuck back in during the sh64 integration, I thought I had killed them all off already. Applied, thanks.

#15 lore raw

RFC PATCH 9/9 Stringify support commas

In reply to Mathieu Desnoyers

#define MYDEF a, b, c

__stringify(MYDEF) should be replaced by "a, b, c", but compilation fails because the __stringify macro expects only one argument. Fix it by using variable macro arguments in __stringify and __stringify_1.

Needed in my current NMI safe iret paravirt support work so I can expand a macro containing assembly code into a string.

---
 include/linux/stringify.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/stringify.h +2 -2
Index: linux-2.6-lttng/include/linux/stringify.h
===================================================================
@@ -6,7 +6,7 @@
  * converts to "bar".
  */
 
-#define __stringify_1(x)	#x
-#define __stringify(x)		__stringify_1(x)
+#define __stringify_1(x...)	#x
+#define __stringify(x...)	__stringify_1(x)
 
 #endif	/* !__LINUX_STRINGIFY_H */
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68