[kernel] r15241 - in dists/sid/linux-kbuild-2.6: . arch arch/ia64 arch/ia64/scripts debian

Ben Hutchings benh at alioth.debian.org
Sat Feb 20 05:10:51 UTC 2010


Author: benh
Date: Sat Feb 20 05:10:49 2010
New Revision: 15241

Log:
Include ia64-specific scripts (Closes: #392592)

Added:
   dists/sid/linux-kbuild-2.6/arch/
   dists/sid/linux-kbuild-2.6/arch/ia64/
   dists/sid/linux-kbuild-2.6/arch/ia64/scripts/
   dists/sid/linux-kbuild-2.6/arch/ia64/scripts/Makefile
   dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-gas
   dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-gas-asm.S
   dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-model.c
   dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-segrel.S
   dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-segrel.lds
   dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-serialize.S
   dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-text-align.S
   dists/sid/linux-kbuild-2.6/arch/ia64/scripts/pvcheck.sed
   dists/sid/linux-kbuild-2.6/arch/ia64/scripts/toolchain-flags
   dists/sid/linux-kbuild-2.6/arch/ia64/scripts/unwcheck.py
Modified:
   dists/sid/linux-kbuild-2.6/Makefile
   dists/sid/linux-kbuild-2.6/debian/changelog
   dists/sid/linux-kbuild-2.6/debian/rules.real

Modified: dists/sid/linux-kbuild-2.6/Makefile
==============================================================================
--- dists/sid/linux-kbuild-2.6/Makefile	Sat Feb 20 05:07:11 2010	(r15240)
+++ dists/sid/linux-kbuild-2.6/Makefile	Sat Feb 20 05:10:49 2010	(r15241)
@@ -3,7 +3,8 @@
 	Makefile \
 
 SUBDIRS = \
-	scripts
+	scripts \
+	$(wildcard arch/$(SRCARCH)/scripts)
 
 OUTDIR = .
 

Added: dists/sid/linux-kbuild-2.6/arch/ia64/scripts/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-kbuild-2.6/arch/ia64/scripts/Makefile	Sat Feb 20 05:10:49 2010	(r15241)
@@ -0,0 +1,26 @@
+SCRIPTS = \
+	check-gas \
+	pvcheck.sed \
+	toolchain-flags \
+	unwcheck.py
+
+DATA = \
+	check-gas-asm.S \
+	check-model.c \
+	check-segrel.S \
+	check-segrel.lds \
+	check-serialize.S \
+	check-text-align.S
+
+OUTDIR = arch/ia64/scripts
+
+top_srcdir = ../../..
+
+VPATH = $(top_srcdir)/kbuild/$(OUTDIR)
+
+# kluge for scripts added in Debian diff
+$(top_srcdir)/kbuild/$(OUTDIR)/%: $(top_srcdir)/$(OUTDIR)/%
+	mkdir -p $(@D)
+	cp $< $@
+
+include $(top_srcdir)/Makefile.inc

Added: dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-gas
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-gas	Sat Feb 20 05:10:49 2010	(r15241)
@@ -0,0 +1,15 @@
+#!/bin/sh
+dir=$(dirname $0)
+CC=$1
+OBJDUMP=$2
+tmp=${TMPDIR:-/tmp}
+out=$tmp/out$$.o
+$CC -c $dir/check-gas-asm.S -o $out
+res=$($OBJDUMP -r --section .data $out | fgrep 00004 | tr -s ' ' |cut -f3 -d' ')
+rm -f $out
+if [ $res != ".text" ]; then
+	echo buggy
+else
+	echo good
+fi
+exit 0

Added: dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-gas-asm.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-gas-asm.S	Sat Feb 20 05:10:49 2010	(r15241)
@@ -0,0 +1,2 @@
+[1:]	nop 0
+	.xdata4 ".data", 0, 1b-.

Added: dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-model.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-model.c	Sat Feb 20 05:10:49 2010	(r15241)
@@ -0,0 +1 @@
+int __attribute__ ((__model__ (__small__))) x;

Added: dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-segrel.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-segrel.S	Sat Feb 20 05:10:49 2010	(r15241)
@@ -0,0 +1,4 @@
+	.rodata
+	data4 @segrel(start)
+	.data
+start:

Added: dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-segrel.lds
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-segrel.lds	Sat Feb 20 05:10:49 2010	(r15241)
@@ -0,0 +1,12 @@
+SECTIONS {
+	. = SIZEOF_HEADERS;
+	.rodata : { *(.rodata) } :ro
+	.note : { *(.note*) }
+	. = 0xa0000;
+	.data : { *(.data) } :dat
+	/DISCARD/ : { *(*) }
+}
+PHDRS {
+  ro PT_LOAD FILEHDR PHDRS;
+  dat PT_LOAD;
+}

Added: dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-serialize.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-serialize.S	Sat Feb 20 05:10:49 2010	(r15241)
@@ -0,0 +1,2 @@
+	.serialize.data
+	.serialize.instruction

Added: dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-text-align.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-kbuild-2.6/arch/ia64/scripts/check-text-align.S	Sat Feb 20 05:10:49 2010	(r15241)
@@ -0,0 +1,6 @@
+	.proc foo
+	.prologue
+foo:	.save rp, r2
+	nop 0
+	.align 64
+	.endp foo

Added: dists/sid/linux-kbuild-2.6/arch/ia64/scripts/pvcheck.sed
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-kbuild-2.6/arch/ia64/scripts/pvcheck.sed	Sat Feb 20 05:10:49 2010	(r15241)
@@ -0,0 +1,33 @@
+#
+# Checker for paravirtualizations of privileged operations.
+#
+s/ssm.*psr\.ic.*/.warning \"ssm psr.ic should not be used directly\"/g
+s/rsm.*psr\.ic.*/.warning \"rsm psr.ic should not be used directly\"/g
+s/ssm.*psr\.i.*/.warning \"ssm psr.i should not be used directly\"/g
+s/rsm.*psr\.i.*/.warning \"rsm psr.i should not be used directly\"/g
+s/ssm.*psr\.dt.*/.warning \"ssm psr.dt should not be used directly\"/g
+s/rsm.*psr\.dt.*/.warning \"rsm psr.dt should not be used directly\"/g
+s/mov.*=.*cr\.ifa/.warning \"cr.ifa should not used directly\"/g
+s/mov.*=.*cr\.itir/.warning \"cr.itir should not used directly\"/g
+s/mov.*=.*cr\.isr/.warning \"cr.isr should not used directly\"/g
+s/mov.*=.*cr\.iha/.warning \"cr.iha should not used directly\"/g
+s/mov.*=.*cr\.ipsr/.warning \"cr.ipsr should not used directly\"/g
+s/mov.*=.*cr\.iim/.warning \"cr.iim should not used directly\"/g
+s/mov.*=.*cr\.iip/.warning \"cr.iip should not used directly\"/g
+s/mov.*=.*cr\.ivr/.warning \"cr.ivr should not used directly\"/g
+s/mov.*=[^\.]*psr/.warning \"psr should not used directly\"/g	# avoid ar.fpsr
+s/mov.*=.*ar\.eflags/.warning \"ar.eflags should not used directly\"/g
+s/mov.*=.*ar\.itc.*/.warning \"ar.itc should not used directly\"/g
+s/mov.*cr\.ifa.*=.*/.warning \"cr.ifa should not used directly\"/g
+s/mov.*cr\.itir.*=.*/.warning \"cr.itir should not used directly\"/g
+s/mov.*cr\.iha.*=.*/.warning \"cr.iha should not used directly\"/g
+s/mov.*cr\.ipsr.*=.*/.warning \"cr.ipsr should not used directly\"/g
+s/mov.*cr\.ifs.*=.*/.warning \"cr.ifs should not used directly\"/g
+s/mov.*cr\.iip.*=.*/.warning \"cr.iip should not used directly\"/g
+s/mov.*cr\.kr.*=.*/.warning \"cr.kr should not used directly\"/g
+s/mov.*ar\.eflags.*=.*/.warning \"ar.eflags should not used directly\"/g
+s/itc\.i.*/.warning \"itc.i should not be used directly.\"/g
+s/itc\.d.*/.warning \"itc.d should not be used directly.\"/g
+s/bsw\.0/.warning \"bsw.0 should not be used directly.\"/g
+s/bsw\.1/.warning \"bsw.1 should not be used directly.\"/g
+s/ptc\.ga.*/.warning \"ptc.ga should not be used directly.\"/g

Added: dists/sid/linux-kbuild-2.6/arch/ia64/scripts/toolchain-flags
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-kbuild-2.6/arch/ia64/scripts/toolchain-flags	Sat Feb 20 05:10:49 2010	(r15241)
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# Check whether linker can handle cross-segment @segrel():
+#
+CPPFLAGS=""
+CC=$1
+OBJDUMP=$2
+READELF=$3
+dir=$(dirname $0)
+tmp=${TMPDIR:-/tmp}
+out=$tmp/out$$
+
+# Check whether cross-segment segment-relative relocs work fine.  We need
+# that for building the gate DSO:
+
+$CC -nostdlib -static -Wl,-T$dir/check-segrel.lds $dir/check-segrel.S -o $out
+res=$($OBJDUMP --full --section .rodata $out | fgrep 000 | cut -f3 -d' ')
+rm -f $out
+if [ $res != 00000a00 ]; then
+    CPPFLAGS="$CPPFLAGS -DHAVE_BUGGY_SEGREL"
+    cat >&2 <<EOF
+warning: your linker cannot handle cross-segment segment-relative relocations.
+         please upgrade to a newer version (it is safe to use this linker, but
+         the kernel will be bigger than strictly necessary).
+EOF
+fi
+
+# Check whether .align inside a function works as expected.
+
+$CC -c $dir/check-text-align.S -o $out
+$READELF -u $out | fgrep -q 'prologue(rlen=12)'
+res=$?
+rm -f $out
+if [ $res -eq 0 ]; then
+    CPPFLAGS="$CPPFLAGS -DHAVE_WORKING_TEXT_ALIGN"
+fi
+
+if ! $CC -c $dir/check-model.c -o $out 2>&1 | grep  __model__ | grep -q attrib
+then
+    CPPFLAGS="$CPPFLAGS -DHAVE_MODEL_SMALL_ATTRIBUTE"
+fi
+rm -f $out
+
+# Check whether assembler supports .serialize.{data,instruction} directive.
+
+$CC -c $dir/check-serialize.S -o $out 2>/dev/null
+res=$?
+rm -f $out
+if [ $res -eq 0 ]; then
+    CPPFLAGS="$CPPFLAGS -DHAVE_SERIALIZE_DIRECTIVE"
+fi
+
+echo $CPPFLAGS

Added: dists/sid/linux-kbuild-2.6/arch/ia64/scripts/unwcheck.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-kbuild-2.6/arch/ia64/scripts/unwcheck.py	Sat Feb 20 05:10:49 2010	(r15241)
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+#
+# Usage: unwcheck.py FILE
+#
+# This script checks the unwind info of each function in file FILE
+# and verifies that the sum of the region-lengths matches the total
+# length of the function.
+#
+# Based on a shell/awk script originally written by Harish Patil,
+# which was converted to Perl by Matthew Chapman, which was converted
+# to Python by David Mosberger.
+#
+import os
+import re
+import sys
+
+if len(sys.argv) != 2:
+    print "Usage: %s FILE" % sys.argv[0]
+    sys.exit(2)
+
+readelf = os.getenv("READELF", "readelf")
+
+start_pattern = re.compile("<([^>]*)>: \[0x([0-9a-f]+)-0x([0-9a-f]+)\]")
+rlen_pattern  = re.compile(".*rlen=([0-9]+)")
+
+def check_func (func, slots, rlen_sum):
+    if slots != rlen_sum:
+        global num_errors
+        num_errors += 1
+        if not func: func = "[%#x-%#x]" % (start, end)
+        print "ERROR: %s: %lu slots, total region length = %lu" % (func, slots, rlen_sum)
+    return
+
+num_funcs = 0
+num_errors = 0
+func = False
+slots = 0
+rlen_sum = 0
+for line in os.popen("%s -u %s" % (readelf, sys.argv[1])):
+    m = start_pattern.match(line)
+    if m:
+        check_func(func, slots, rlen_sum)
+
+        func  = m.group(1)
+        start = long(m.group(2), 16)
+        end   = long(m.group(3), 16)
+        slots = 3 * (end - start) / 16
+        rlen_sum = 0L
+        num_funcs += 1
+    else:
+        m = rlen_pattern.match(line)
+        if m:
+            rlen_sum += long(m.group(1))
+check_func(func, slots, rlen_sum)
+
+if num_errors == 0:
+    print "No errors detected in %u functions." % num_funcs
+else:
+    if num_errors > 1:
+        err="errors"
+    else:
+        err="error"
+    print "%u %s detected in %u functions." % (num_errors, err, num_funcs)
+    sys.exit(1)

Modified: dists/sid/linux-kbuild-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-kbuild-2.6/debian/changelog	Sat Feb 20 05:07:11 2010	(r15240)
+++ dists/sid/linux-kbuild-2.6/debian/changelog	Sat Feb 20 05:10:49 2010	(r15241)
@@ -1,3 +1,9 @@
+linux-kbuild-2.6 (2.6.32-2) UNRELEASED; urgency=low
+
+  * Include ia64-specific scripts (Closes: #392592)
+
+ -- Ben Hutchings <ben at decadent.org.uk>  Sat, 20 Feb 2010 05:07:48 +0000
+
 linux-kbuild-2.6 (2.6.32-1) unstable; urgency=low
 
   [ Ben Hutchings ]

Modified: dists/sid/linux-kbuild-2.6/debian/rules.real
==============================================================================
--- dists/sid/linux-kbuild-2.6/debian/rules.real	Sat Feb 20 05:07:11 2010	(r15240)
+++ dists/sid/linux-kbuild-2.6/debian/rules.real	Sat Feb 20 05:10:49 2010	(r15241)
@@ -1,5 +1,20 @@
 export DH_OPTIONS
 
+DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+KERNEL_ARCH := $(DEB_BUILD_ARCH)
+ifneq ($(filter amd64 i386,$(DEB_BUILD_ARCH)),)
+	KERNEL_ARCH := x86
+endif
+ifneq ($(filter armeb armel,$(DEB_BUILD_ARCH)),)
+	KERNEL_ARCH := arm
+endif
+ifeq (hppa,$(DEB_BUILD_ARCH))
+	KERNEL_ARCH := parisc
+endif
+ifeq (mipsel,$(DEB_BUILD_ARCH))
+	KERNEL_ARCH := mips
+endif
+
 include debian/rules.defs
 
 binary-arch: install-kbuild
@@ -12,7 +27,7 @@
 	rm -rf '$(DIR)'
 	mkdir -p '$(DIR)'
 	cp -al $(SOURCE_FILES) '$(DIR)'
-	$(MAKE) -C $(DIR) top_srcdir=$(CURDIR)
+	$(MAKE) -C $(DIR) top_srcdir=$(CURDIR) SRCARCH=$(KERNEL_ARCH)
 	touch '$@'
 
 install-kbuild: PACKAGE_NAME = linux-kbuild-$(VERSION)
@@ -24,7 +39,7 @@
 	dh_testdir
 	dh_testroot
 	dh_clean -k -d
-	$(MAKE) -C $(SOURCE_DIR) install prefix=$(DIR) top_srcdir=$(CURDIR)
+	$(MAKE) -C $(SOURCE_DIR) install prefix=$(DIR) top_srcdir=$(CURDIR) SRCARCH=$(KERNEL_ARCH)
 	dh_link $(BASE_DIR) /usr/src/$(PACKAGE_NAME)
 	dh_installchangelogs
 	dh_installdocs



More information about the Kernel-svn-changes mailing list