History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: kbuild: introduce utsrelease.h kbuild: explicit turn off gcc stack-protector

Linus Torvalds committed 20 years ago

Commit 51bece92 parents d8cb7c1 63104ee14 files · +36 −27Browse files

Unified · Split

14 files
  1. Makefile +21 −12
  2. arch/alpha/boot/bootp.c +1 −1
  3. arch/alpha/boot/bootpz.c +1 −1
  4. arch/alpha/boot/main.c +1 −1
  5. arch/frv/kernel/setup.c +1 −1
  6. arch/i386/boot/setup.S +1 −1
  7. arch/powerpc/platforms/chrp/setup.c +1 −1
  8. arch/powerpc/platforms/powermac/bootx_init.c +1 −1
  9. arch/ppc/syslib/btext.c +1 −1
  10. arch/x86_64/boot/setup.S +1 −1
  11. drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c +1 −1
  12. include/linux/vermagic.h +1 −1
  13. init/version.c +1 −0
  14. scripts/checkversion.pl +3 −4
Makefile+21−12
@@ -309,6 +309,9 @@ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) · 308 unmodified lines
309309
310310 CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
311311 -fno-strict-aliasing -fno-common
312+# Force gcc to behave correct even for buggy distributions
313+CFLAGS += $(call cc-option, -fno-stack-protector-all \
314+ -fno-stack-protector)
312315 AFLAGS := -D__ASSEMBLY__
313316
314317 # Read KERNELRELEASE from include/config/kernel.release (if it exists)
@@ -809,8 +812,8 @@ endif · 494 unmodified lines
809812 # prepare2 creates a makefile if using a separate output directory
810813 prepare2: prepare3 outputmakefile
811814
812−prepare1: prepare2 include/linux/version.h include/asm \
813− include/config/auto.conf
815+prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
816+ include/asm include/config/auto.conf
814817 ifneq ($(KBUILD_MODULES),)
815818 $(Q)mkdir -p $(MODVERDIR)
816819 $(Q)rm -f $(MODVERDIR)/*
@@ -845,21 +848,26 @@ include/asm: · 28 unmodified lines
845848 # needs to be updated, so this check is forced on all builds
846849
847850 uts_len := 64
851+define filechk_utsrelease.h
852+ if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
853+ echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
854+ exit 1; \
855+ fi; \
856+ (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";)
857+endef
848858
849859 define filechk_version.h
850− if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
851− echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
852− exit 1; \
853− fi; \
854− (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \
855− echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \
856− echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
857− )
860+ (echo \#define LINUX_VERSION_CODE $(shell \
861+ expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \
862+ echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
858863 endef
859864
860−include/linux/version.h: $(srctree)/Makefile include/config/kernel.release FORCE
865+include/linux/version.h: $(srctree)/Makefile FORCE
861866 $(call filechk,version.h)
862867
868+include/linux/utsrelease.h: include/config/kernel.release FORCE
869+ $(call filechk,utsrelease.h)
870+
863871 # ---------------------------------------------------------------------------
864872
865873 PHONY += depend dep
@@ -952,7 +960,8 @@ CLEAN_FILES += vmlinux System.map \ · 86 unmodified lines
952960 # Directories & files removed with 'make mrproper'
953961 MRPROPER_DIRS += include/config include2
954962 MRPROPER_FILES += .config .config.old include/asm .version .old_version \
955− include/linux/autoconf.h include/linux/version.h \
963+ include/linux/autoconf.h include/linux/version.h \
964+ include/linux/utsrelease.h \
956965 Module.symvers tags TAGS cscope*
957966
958967 # clean - Delete most, but leave enough to build external modules
arch/alpha/boot/bootp.c+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 */
1010 #include <linux/kernel.h>
1111 #include <linux/string.h>
12−#include <linux/version.h>
12+#include <linux/utsrelease.h>
1313 #include <linux/mm.h>
1414
1515 #include <asm/system.h>
arch/alpha/boot/bootpz.c+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111 */
1212 #include <linux/kernel.h>
1313 #include <linux/string.h>
14−#include <linux/version.h>
14+#include <linux/utsrelease.h>
1515 #include <linux/mm.h>
1616
1717 #include <asm/system.h>
arch/alpha/boot/main.c+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 */
88 #include <linux/kernel.h>
99 #include <linux/string.h>
10−#include <linux/version.h>
10+#include <linux/utsrelease.h>
1111 #include <linux/mm.h>
1212
1313 #include <asm/system.h>
arch/frv/kernel/setup.c+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 * 2 of the License, or (at your option) any later version.
1111 */
1212
13−#include <linux/version.h>
13+#include <linux/utsrelease.h>
1414 #include <linux/kernel.h>
1515 #include <linux/sched.h>
1616 #include <linux/delay.h>
arch/i386/boot/setup.S+1−1
@@ -47,7 +47,7 @@ · 46 unmodified lines
4747 */
4848
4949 #include <asm/segment.h>
50−#include <linux/version.h>
50+#include <linux/utsrelease.h>
5151 #include <linux/compile.h>
5252 #include <asm/boot.h>
5353 #include <asm/e820.h>
arch/powerpc/platforms/chrp/setup.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424 #include <linux/reboot.h>
2525 #include <linux/init.h>
2626 #include <linux/pci.h>
27−#include <linux/version.h>
27+#include <linux/utsrelease.h>
2828 #include <linux/adb.h>
2929 #include <linux/module.h>
3030 #include <linux/delay.h>
arch/powerpc/platforms/powermac/bootx_init.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #include <linux/kernel.h>
1313 #include <linux/string.h>
1414 #include <linux/init.h>
15−#include <linux/version.h>
15+#include <linux/utsrelease.h>
1616 #include <asm/sections.h>
1717 #include <asm/prom.h>
1818 #include <asm/page.h>
arch/ppc/syslib/btext.c+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 #include <linux/kernel.h>
77 #include <linux/string.h>
88 #include <linux/init.h>
9−#include <linux/version.h>
9+#include <linux/utsrelease.h>
1010
1111 #include <asm/sections.h>
1212 #include <asm/bootx.h>
arch/x86_64/boot/setup.S+1−1
@@ -46,7 +46,7 @@ · 45 unmodified lines
4646 */
4747
4848 #include <asm/segment.h>
49−#include <linux/version.h>
49+#include <linux/utsrelease.h>
5050 #include <linux/compile.h>
5151 #include <asm/boot.h>
5252 #include <asm/e820.h>
drivers/net/wireless/bcm43xx/bcm43xx_ethtool.c+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 #include <linux/netdevice.h>
3333 #include <linux/pci.h>
3434 #include <linux/string.h>
35−#include <linux/version.h>
35+#include <linux/utsrelease.h>
3636
3737
3838 static void bcm43xx_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
include/linux/vermagic.h+1−1
@@ -1,4 +1,4 @@
1−#include <linux/version.h>
1+#include <linux/utsrelease.h>
22 #include <linux/module.h>
33
44 /* Simply sanity version stamp for modules. */
init/version.c+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/module.h>
1111 #include <linux/uts.h>
1212 #include <linux/utsname.h>
13+#include <linux/utsrelease.h>
1314 #include <linux/version.h>
1415
1516 #define version(a) Version_ ## a
scripts/checkversion.pl+3−4
@@ -1,7 +1,7 @@
11 #! /usr/bin/perl
22 #
3−# checkversion find uses of LINUX_VERSION_CODE, KERNEL_VERSION, or
4−# UTS_RELEASE without including <linux/version.h>, or cases of
3+# checkversion find uses of LINUX_VERSION_CODE or KERNEL_VERSION
4+# without including <linux/version.h>, or cases of
55 # including <linux/version.h> that don't need it.
66 # Copyright (C) 2003, Randy Dunlap <rdunlap@xenotime.net>
77
@@ -41,8 +41,7 @@ foreach $file (@ARGV) · 33 unmodified lines
4141 }
4242
4343 # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE
44− if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/) ||
45− ($_ =~ /UTS_RELEASE/)) {
44+ if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) {
4645 $fUseVersion = 1;
4746 last LINE if $iLinuxVersion;
4847 }