Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-09-26 15:56:27 +0200
committerMichal Marek <mmarek@suse.cz>2011-09-26 22:20:48 +0200
commit1de23845d6d1cd38763d9d9b6121c51925c61035 (patch)
tree33fe5865b2f629a06c2300cce6dd445f62f69fcd
parentee8cc90d708d00daa875c99f43c628b1d5a93fef (diff)
- rpm/host-memcpy-hack.h: Hack to use older version of the memcpy symbol
in userspace programs, so that they keep working on older systems. - rpm/kernel-binary.spec.in: Pass -include %_sourcedir/host-memcpy-hack.h to the compiler when compiling userspace programs.
-rw-r--r--rpm/host-memcpy-hack.h7
-rw-r--r--rpm/kernel-binary.spec.in28
-rw-r--r--rpm/kernel-source.spec.in1
3 files changed, 23 insertions, 13 deletions
diff --git a/rpm/host-memcpy-hack.h b/rpm/host-memcpy-hack.h
new file mode 100644
index 0000000000..28b9baa055
--- /dev/null
+++ b/rpm/host-memcpy-hack.h
@@ -0,0 +1,7 @@
+#ifdef __x86_64__
+/*
+ * Force the linker to use the older memcpy variant, so that the user programs
+ * work on older systems
+ */
+__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
+#endif
diff --git a/rpm/kernel-binary.spec.in b/rpm/kernel-binary.spec.in
index c1d46b30c2..e38d92f67f 100644
--- a/rpm/kernel-binary.spec.in
+++ b/rpm/kernel-binary.spec.in
@@ -217,6 +217,21 @@ cd linux-%srcversion
cd %kernel_build_dir
+# Override the timestamp 'uname -v' reports with the source timestamp and
+# the commit hash.
+date=$(head -n 1 %_sourcedir/source-timestamp)
+commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
+cat > .kernel-binary.spec.buildenv <<EOF
+export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
+export KBUILD_VERBOSE=0
+export KBUILD_SYMTYPES=1
+export KBUILD_OVERRIDE=1
+export KBUILD_BUILD_USER=geeko
+export KBUILD_BUILD_HOST=buildhost
+export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
+EOF
+source .kernel-binary.spec.buildenv
+
if [ -f %_sourcedir/localversion ] ; then
cat %_sourcedir/localversion > localversion
fi
@@ -262,19 +277,6 @@ make clean $MAKE_ARGS
rm -f source
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
-# Override the timestamp 'uname -v' reports with the source timestamp and
-# the commit hash.
-date=$(head -n 1 %_sourcedir/source-timestamp)
-commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
-cat > .kernel-binary.spec.buildenv <<EOF
-export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
-export KBUILD_VERBOSE=0
-export KBUILD_SYMTYPES=1
-export KBUILD_OVERRIDE=1
-export KBUILD_BUILD_USER=geeko
-export KBUILD_BUILD_HOST=buildhost
-EOF
-
%build
cd %kernel_build_dir
source .kernel-binary.spec.buildenv
diff --git a/rpm/kernel-source.spec.in b/rpm/kernel-source.spec.in
index 1156d2ae61..26ead99533 100644
--- a/rpm/kernel-source.spec.in
+++ b/rpm/kernel-source.spec.in
@@ -86,6 +86,7 @@ Source64: package-descriptions
Source65: kernel-spec-macros
Source66: configtool.pl
Source67: log.sh
+Source68: host-memcpy-hack.h
Source100: config.tar.bz2
Source101: config.addon.tar.bz2
Source102: patches.arch.tar.bz2