[uClibc] Makefile VERSION check in fix-includes.sh
Peter S. Mazinger
ps.m at gmx.net
Mon Jan 5 11:38:03 UTC 2004
Hello!
Due to the changes in fix-includes.sh, checking for
<kernel-source>/Makefile and using
VERSION/PATCHLEVEL/SUBLEVEL/EXTRAVERSION later on to detect if it is 2.6.x
header or not, it is not possible to build against installed
kernel-headers in /usr/include/{linux/asm/...}, noone will have a
/usr/Makefile. Alternative solution would be to use
include/linux/version.h if Makefile is not present (ok, this file is not
present in a clean kernel-source, but can be built easily with "make
include/linux/version.h").
For this I have added a patch (clean it up as you like, it works for me)
Easier solution would be to copy asm-generic for all cases if it is
present (I think the 2.0 kernel does not have it)
Also attached a patch for the case you'll stay with the COMPLETELY_PIC
option.
Peter
--
Peter S. Mazinger <ps.m at gmx.net> ID: 0xA5F059F2 NIC: IXUYHSKQLI
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08 BB6E C389 975E A5F0 59F2
____________________________________________________________________
Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a FreeStarttol.
Probald ki most! http://www.freestart.hu
-------------- next part --------------
--- extra/scripts/fix_includes.sh.mps 2004-01-05 11:14:05.000000000 +0100
+++ extra/scripts/fix_includes.sh 2004-01-05 12:25:11.000000000 +0100
@@ -59,10 +59,10 @@
esac;
done;
-if [ ! -f "$KERNEL_SOURCE/Makefile" ]; then
+if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
echo "";
echo "";
- echo "The file $KERNEL_SOURCE/Makefile is missing!";
+ echo "The file $KERNEL_SOURCE/Makefile or $KERNEL_SOURCE/include/linux/version.h is missing!";
echo "Perhaps your kernel source is broken?"
echo "";
echo "";
@@ -78,8 +78,21 @@
exit 1;
fi;
-# set current VERSION, PATCHLEVEL, SUBLEVEL, EXTERVERSION
+if [ -f "$KERNEL_SOURCE/Makefile" ] ; then
+# set current VERSION, PATCHLEVEL, SUBLEVEL, EXTRAVERSION
eval `sed -n -e 's/^\([A-Z]*\) = \([0-9]*\)$/\1=\2/p' -e 's/^\([A-Z]*\) = \(-[-a-z0-9]*\)$/\1=\2/p' $KERNEL_SOURCE/Makefile`
+else
+ver=`grep UTS_RELEASE $KERNEL_SOURCE/include/linux/version.h | cut -d '"' -f 2`
+VERSION=`echo "$ver" | cut -d '.' -f 1`
+PATCHLEVEL=`echo "$ver" | cut -d '.' -f 2`
+if echo "$ver" | grep -q '-' ; then
+SUBLEVEL=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.//" | cut -d '-' -f 1`
+EXTRAVERSION=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.${SUBLEVEL}-//"`
+else
+SUBLEVEL=`echo "$ver" | cut -d '.' -f 3`
+#EXTRAVERSION=
+fi
+fi
if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ]
then
echo "Unable to determine version for kernel headers"
-------------- next part --------------
--- extra/Configs/Config.in.mps 2004-01-05 11:07:27.000000000 +0100
+++ extra/Configs/Config.in 2004-01-05 11:10:58.000000000 +0100
@@ -180,13 +180,14 @@
config UCLIBC_PIE_SUPPORT
bool "Support ET_DYN in shared library loader"
select FORCE_SHAREABLE_TEXT_SEGMENTS
+ select UCLIBC_COMPLETELY_PIC
default n
help
If you answer Y here, the uClibc native shared library loader will
support ET_DYN/PIE executables.
It requires binutils-2.14.90.0.6 or later and the usage of the
-pie option.
- More about ET_DYN/PIE binaries on <http://pageexec.virtualave.net/> .
+ More about ET_DYN/PIE binaries on <http://pax.grsecurity.net/> .
WARNING: This option also enables FORCE_SHAREABLE_TEXT_SEGMENTS, so all
libraries have to be built with -fPIC or -fpic, and all assembler
functions must be written as position independent code (PIC).
More information about the uClibc
mailing list