Skip to contentSkip to conversation

kbuild fixes

GIT Sam Ravnborg 2 participants 2 messages Jul 3, 2009

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

Hi Linus.

- various .gitignore updates
- disabling of -Wformat-security
We looked at it and 'fixing' the warnings was not pleasant
- fixes/improvements for the newly introduced macros in asm-generic/vmlinux.lds.h

Nothing earth-shaking..
And it has been in -next for a few days with no issues.

I am heading for a two week vacation in Sweden and will be offline in that period.
Enjoy the kernel hacking while I enjoy my vacation :-)

Sam

The following changes since commit 4075ea8c54a7506844a69f674990241e7766357b:
Linus Torvalds (1):
Merge branch 'for-linus' of git://git.kernel.org/.../bp/bp

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes.git master

Amerigo Wang (2):
gitignore: ignore gcov output files
kbuild: finally remove the obsolete variable $TOPDIR

Floris Kraak (1):
Kbuild: Disable the -Wformat-security gcc flag

Jaswinder Singh Rajput (1):
gitignore: ignore scripts/ihex2fw

Paul Mundt (1):
asm-generic/vmlinux.lds.h: Fix up RW_DATA_SECTION definition.

Tim Abbott (3):
Add new macros for page-aligned data and bss sections. asm-generic/vmlinux.lds.h: shuffle INIT_TASK* macro names in vmlinux.lds.h Add new __init_task_data macro to be used in arch init_task.c files.

maximilian attems (1):
kbuild: deb-pkg ship changelog

 .gitignore                        |    1 +
 Makefile                          |    7 +++----
 arch/mn10300/kernel/vmlinux.lds.S |    2 +-
 drivers/scsi/cxgb3i/Kbuild        |    2 +-
 include/asm-generic/vmlinux.lds.h |   12 ++++++------
 include/linux/init_task.h         |    3 +++
 include/linux/linkage.h           |    9 +++++++++
 scripts/.gitignore                |    1 +
 scripts/package/builddeb          |    2 ++
 9 files changed, 27 insertions(+), 12 deletions(-)
.gitignore +1 -0
index cecb3b0..b93fb7e 100644
@@ -27,6 +27,7 @@
 *.gz
 *.lzma
 *.patch
+*.gcno
 
 #
 # Top-level generic files
Makefile +3 -4
index d1216fe..b4c7ef5 100644
@@ -140,15 +140,13 @@ _all: modules
 endif
 
 srctree		:= $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
-TOPDIR		:= $(srctree)
-# FIXME - TOPDIR is obsolete, use srctree/objtree
 objtree		:= $(CURDIR)
 src		:= $(srctree)
 obj		:= $(objtree)
 
 VPATH		:= $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
 
-export srctree objtree VPATH TOPDIR
+export srctree objtree VPATH
 
 
 # SUBARCH tells the usermode build what the underlying arch is.  That is set
@@ -344,7 +342,8 @@ KBUILD_CPPFLAGS := -D__KERNEL__
 
 KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
 		   -fno-strict-aliasing -fno-common \
-		   -Werror-implicit-function-declaration
+		   -Werror-implicit-function-declaration \
+		   -Wno-format-security
 KBUILD_AFLAGS   := -D__ASSEMBLY__
 
 # Read KERNELRELEASE from include/config/kernel.release (if it exists)
arch/mn10300/kernel/vmlinux.lds.S +1 -1
index bcebcef..c96ba3d 100644
@@ -61,7 +61,7 @@ SECTIONS
 	_edata = .;		/* End of data section */
   }
 
-  .data.init_task : { INIT_TASK(THREAD_SIZE); }
+  .data.init_task : { INIT_TASK_DATA(THREAD_SIZE); }
 
   /* might get freed after init */
   . = ALIGN(PAGE_SIZE);
drivers/scsi/cxgb3i/Kbuild +1 -1
index 25a2032..70d060b 100644
@@ -1,4 +1,4 @@
-EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3
+EXTRA_CFLAGS += -I$(srctree)/drivers/net/cxgb3
 
 cxgb3i-y := cxgb3i_init.o cxgb3i_iscsi.o cxgb3i_pdu.o cxgb3i_offload.o cxgb3i_ddp.o
 obj-$(CONFIG_SCSI_CXGB3_ISCSI) += cxgb3i.o
include/asm-generic/vmlinux.lds.h +6 -6
index 92b73b6..720af4c 100644
@@ -191,7 +191,7 @@
 	. = ALIGN(align);						\
 	*(.data.cacheline_aligned)
 
-#define INIT_TASK(align)						\
+#define INIT_TASK_DATA(align)						\
 	. = ALIGN(align);						\
 	*(.data.init_task)
 
@@ -434,10 +434,10 @@
 /*
  * Init task
  */
-#define INIT_TASK_DATA(align)						\
+#define INIT_TASK_DATA_SECTION(align)					\
 	. = ALIGN(align);						\
 	.data.init_task : {						\
-		INIT_TASK						\
+		INIT_TASK_DATA(align)					\
 	}
 
 #ifdef CONFIG_CONSTRUCTORS
@@ -704,15 +704,15 @@
  * matches the requirment of PAGE_ALIGNED_DATA.
  *
  * use 0 as page_align if page_aligned data is not used */
-#define RW_DATA_SECTION(cacheline, nosave, pagealigned, inittask)	\
+#define RW_DATA_SECTION(cacheline, pagealigned, inittask)		\
 	. = ALIGN(PAGE_SIZE);						\
 	.data : AT(ADDR(.data) - LOAD_OFFSET) {				\
-		INIT_TASK(inittask)					\
+		INIT_TASK_DATA(inittask)				\
 		CACHELINE_ALIGNED_DATA(cacheline)			\
 		READ_MOSTLY_DATA(cacheline)				\
 		DATA_DATA						\
 		CONSTRUCTORS						\
-		NOSAVE_DATA(nosave)					\
+		NOSAVE_DATA						\
 		PAGE_ALIGNED_DATA(pagealigned)				\
 	}
 
include/linux/init_task.h +3 -0
index 5368fbd..7fc01b1 100644
@@ -183,5 +183,8 @@ extern struct cred init_cred;
 	LIST_HEAD_INIT(cpu_timers[2]),					\
 }
 
+/* Attach to the init_task data structure for proper alignment */
+#define __init_task_data __attribute__((__section__(".data.init_task")))
+
 
 #endif
include/linux/linkage.h +9 -0
index fee9e59..691f591 100644
@@ -22,6 +22,15 @@
 #define __page_aligned_bss	__section(.bss.page_aligned) __aligned(PAGE_SIZE)
 
 /*
+ * For assembly routines.
+ *
+ * Note when using these that you must specify the appropriate
+ * alignment directives yourself
+ */
+#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw"
+#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw"
+
+/*
  * This is used by architectures to keep arguments on the stack
  * untouched by the compiler by keeping them live until the end.
  * The argument stack may be owned by the assembly-language
scripts/.gitignore +1 -0
index b939fbd..52cab46 100644
@@ -7,3 +7,4 @@ pnmtologo
 bin2c
 unifdef
 binoffset
+ihex2fw
scripts/package/builddeb +2 -0
index 01c2d13..b19f1f4 100644
@@ -16,6 +16,8 @@ create_package() {
 	local pname="$1" pdir="$2"
 
 	cp debian/copyright "$pdir/usr/share/doc/$pname/"
+	cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian"
+	gzip -9 "$pdir/usr/share/doc/$pname/changelog.Debian"
 
 	# Fix ownership and permissions
 	chown -R root:root "$pdir"
#1 lore raw
Quoted 3 lines · Sam Ravnborg

- disabling of -Wformat-security
 We looked at it and 'fixing' the warnings was not pleasant

The alternative is roughly 136 'trivial' patches to shut them all up* and one to turn this flag on unconditionally to prevent hackers from adding more of them after that ;-)

The alternative to *that* is improving on this silly flag:
- Either finding some way to teach GCC how to not emit warnings about usage that is entirely sane.
- Or finding some way to teach some other build tool to catch unsafe usage without polluting the build with false positives.

Take your pick.

*) While I can't give you 100% certainty about every warning I know for a fact the vast majority of the warnings at least consists of false positives so there'd be no other benefit from them except a quieter kernel build on certain distro's ;-)

Regards,
Floris
---
'Or lawyers may say, “But if I decline, someone else will do it. So what is gained?” My reply: “Let someone else do it. But not you. Honor is personal. Worry about yourself. You don’t get a pass from moral responsibility because you acted for a client.”

That’s the first lesson I would offer, aimed at lawyers. A second lesson, aimed at all, is this: Keep ready your capacity for outrage. This is very important. Next to the vote, outrage is the one response each of us can contribute. Outrage is how honor must confront dishonor. If we lose the capacity for outrage, we are in serious trouble. '
--- Stephen Gillers