Files
haikuports/dev-util/fenris/patches/fenris-0.07.patchset
2014-11-11 16:12:08 +01:00

288 lines
8.0 KiB
Plaintext

From e3d8ca89514ce7bb26b5b01b6a0fc232a27bac7e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Tue, 11 Nov 2014 03:24:19 +0100
Subject: [PATCH 1/8] Add Haiku to the list of supported OSes
---
build | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/build b/build
index 8b5da45..8685601 100755
--- a/build
+++ b/build
@@ -156,14 +156,17 @@ SYSNAME=`uname -s 2>/dev/null`
test "$SYSNAME" = "" && SYSNAME="unknown"
-if [ ! "$SYSNAME" = "Linux" ]; then
- echo "$SYSNAME is not supported!"
- echo "[-] I do not support your OS yet. Please consult documentation."
- echo
- exit 1
-fi
+case "$SYSNAME" in
+ Linux|Haiku) ;;
+ *)
+ echo "$SYSNAME is not supported!"
+ echo "[-] I do not support your OS yet. Please consult documentation."
+ echo
+ exit 1
+ ;;
+esac
-echo "Linux (supported)"
+echo "$SYSNAME (supported)"
echo -n "[+] Processor check: "
--
1.8.3.4
From 099cc965989d04b239bc8141d5ee31016c7be243 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Tue, 11 Nov 2014 03:28:01 +0100
Subject: [PATCH 2/8] Make BePC recognized as i586
---
build | 1 +
1 file changed, 1 insertion(+)
diff --git a/build b/build
index 8685601..d7a4045 100755
--- a/build
+++ b/build
@@ -172,6 +172,7 @@ echo -n "[+] Processor check: "
PROC=`uname -m 2>/dev/null`
test "$PROC" = "" && PROC="unknown"
+test "$PROC" = "BePC" && PROC="i586"
PROCOK=`echo $PROC|grep ^i.86\$ 2>/dev/null`
if [ "$PROCOK" = "" ]; then
--
1.8.3.4
From ce9115de76f20f7529f8861f829c67384ed19ae5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Tue, 11 Nov 2014 03:36:31 +0100
Subject: [PATCH 3/8] Force glibc version detection on Haiku
Haiku has a mix of glibc versions anyway...
---
build | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/build b/build
index d7a4045..e5af03c 100755
--- a/build
+++ b/build
@@ -186,7 +186,12 @@ echo "$PROC (supported)"
echo -n "[+] GNU C library version: "
-LIBCVER=`/lib/libc.so.6|awk -F'version ' '{print $2}'|awk -F, '{print $1}'|head -1`
+LIBCVER=`/lib/libc.so.6 2>/dev/null|awk -F'version ' '{print $2}'|awk -F, '{print $1}'|head -1`
+
+if [ "$LIBCVER" = "" -a "$SYSNAME" = "Haiku" ]; then
+ # currently Haiku uses a mix of several glibc versions inside libroot...
+ LIBCVER="2.3.2"
+fi
if [ "$LIBCVER" = "" ]; then
echo "cannot determine libc version!"
--
1.8.3.4
From eea4d5c68ee699a7b13bc6c96b2b7bca0370eb68 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Tue, 11 Nov 2014 03:45:04 +0100
Subject: [PATCH 4/8] Test for several candidates for libc
Including libroot for Haiku.
We also test for 64 or 32bit versions on Linux.
---
build | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/build b/build
index e5af03c..a1785ef 100755
--- a/build
+++ b/build
@@ -186,7 +186,15 @@ echo "$PROC (supported)"
echo -n "[+] GNU C library version: "
-LIBCVER=`/lib/libc.so.6 2>/dev/null|awk -F'version ' '{print $2}'|awk -F, '{print $1}'|head -1`
+LIBCS="/lib/libc.so.6
+/lib/x86_64-linux-gnu/libc.so.6
+/lib64/libc.so.6
+/lib32/libc.so.6
+/system/develop/lib/libroot.so"
+for f in $LIBCS; do test -f "$f" && LIBCPATH="$f"; done
+test "$LIBCPATH" = "" && LIBCPATH="unknown"
+
+LIBCVER=`$LIBCPATH 2>/dev/null|awk -F'version ' '{print $2}'|awk -F, '{print $1}'|head -1`
if [ "$LIBCVER" = "" -a "$SYSNAME" = "Haiku" ]; then
# currently Haiku uses a mix of several glibc versions inside libroot...
@@ -241,12 +249,12 @@ fi
echo -n "[+] GNU libc binary test: "
-STRILI=`file -L /lib/libc.so.6 2>/dev/null|grep 'not strip'`
-GENLI=`file -L /lib/libc.so.6 2>/dev/null|grep 'strip'`
+STRILI=`file -L $LIBCPATH 2>/dev/null|grep 'not strip'`
+GENLI=`file -L $LIBCPATH 2>/dev/null|grep 'strip'`
if [ "$GENLI" = "" ]; then
echo "failed!"
- echo "[-] I cannot read your /lib/libc.so.6 (or your 'file' utility"
+ echo "[-] I cannot read your $LIBCPATH (or your 'file' utility"
echo " is broken). Please fix it. Yes, you need libc6, yes, I need"
echo " to be able to read it. Thanks =)"
echo
--
1.8.3.4
From a3195adb5f862452d542fba34f4af021e6c93028 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Tue, 11 Nov 2014 03:59:57 +0100
Subject: [PATCH 5/8] Test for several candidates for crt file
---
build | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/build b/build
index a1785ef..4f70ddd 100755
--- a/build
+++ b/build
@@ -283,12 +283,20 @@ fi
echo -n "[+] GCC crt code binary test: "
-STRILI=`file -L /usr/lib/crt1.o 2>/dev/null|grep 'not strip'`
-GENLI=`file -L /usr/lib/crt1.o 2>/dev/null|grep 'strip'`
+CRTS="/usr/lib/crt1.o
+/usr/lib/x86_64-linux-gnu/crt1.o
+/usr/lib64/crt1.o
+/usr/lib32/crt1.o
+/system/develop/lib/crti.o"
+for f in $CRTS; do test -f "$f" && CRTPATH="$f"; done
+test "$CRTPATH" = "" && CRTPATH="unknown"
+
+STRILI=`file -L $CRTPATH 2>/dev/null|grep 'not strip'`
+GENLI=`file -L $CRTPATH 2>/dev/null|grep 'strip'`
if [ "$GENLI" = "" ]; then
echo "failed!"
- echo "[-] I cannot read your /usr/lib/crt1.o (or your 'file' utility"
+ echo "[-] I cannot read your $CRTPATH (or your 'file' utility"
echo " is broken). Please fix it. Thanks =)"
echo
exit 1
--
1.8.3.4
From 15bff0261495f62ec165fddc60c362e8d1f80c9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Tue, 11 Nov 2014 04:05:06 +0100
Subject: [PATCH 6/8] Test for several candidates for runtime loader
---
build | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/build b/build
index 4f70ddd..a462889 100755
--- a/build
+++ b/build
@@ -324,12 +324,19 @@ fi
echo -n "[+] GNU libc linker test: "
-STRILI=`file -L /lib/ld-linux.so.2 2>/dev/null|grep 'not strip'`
-GENLI=`file -L /lib/ld-linux.so.2 2>/dev/null|grep 'strip'`
+LDRS="/lib/ld-linux.so.2
+/lib/ld-linux.so.2
+/lib32/ld-linux.so.2
+/system/runtime_loader"
+for f in $LDRS; do test -f "$f" && LDRPATH="$f"; done
+test "$LDRPATH" = "" && LDRPATH="unknown"
+
+STRILI=`file -L $LDRPATH 2>/dev/null|grep 'not strip'`
+GENLI=`file -L $LDRPATH 2>/dev/null|grep 'strip'`
if [ "$GENLI" = "" ]; then
echo "failed!"
- echo "[-] I cannot read your /lib/ld-linux.so.2 (or your 'file' utility"
+ echo "[-] I cannot read your $LDRPATH (or your 'file' utility"
echo " is broken). Please fix it. Yes, you need libc6, yes, I need"
echo " to be able to read it. Thanks =)"
echo
--
1.8.3.4
From d3d7280f6eda2fb0a81aac8d14ec0cb29d90df0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Tue, 11 Nov 2014 04:32:09 +0100
Subject: [PATCH 7/8] Force running until breakpoint to force loading shared
libs
Else gdb can't read memory on Haiku
---
build | 1 +
1 file changed, 1 insertion(+)
diff --git a/build b/build
index a462889..cbe8e79 100755
--- a/build
+++ b/build
@@ -416,6 +416,7 @@ fi
echo -n "[+] Library mapping address: "
echo "break main" >.testerr 2>/dev/null
+echo "run" >>.testerr 2>/dev/null
echo "x/2w getuid" >>.testerr 2>/dev/null
echo "x/10w __do_global_ctors_aux" >>.testerr 2>/dev/null
echo "x/10w __do_global_ctors_aux+1" >>.testerr 2>/dev/null
--
1.8.3.4
From 037748ff2cb8320358a7a8381c254fdfdd5a9e26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Tue, 11 Nov 2014 04:42:45 +0100
Subject: [PATCH 8/8] Add breakpoint and run when dumping PLT report
So we do get the wanted disass.
---
build | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/build b/build
index cbe8e79..43473da 100755
--- a/build
+++ b/build
@@ -585,7 +585,9 @@ else
echo >>PLT.txt 2>/dev/null
gcc -v >>PLT.txt 2>&1
echo >>PLT.txt 2>/dev/null
- echo "disass getuid" >.testerr 2>/dev/null
+ echo "break main" >.testerr 2>/dev/null
+ echo "run" >.testerr 2>/dev/null
+ echo "disass getuid" >>.testerr 2>/dev/null
gdb -batch -x .testerr ./.testme >>PLT.txt 2>&1
rm -f .testerr .testme .testme.c
ls -l PLT.txt
--
1.8.3.4