aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-07-11 05:59:20 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-07-12 07:17:46 +0000
commit376454e172c208d16c5d188802301102090e6b85 (patch)
tree6051127dacfcfcb46cf8b07e02c073dea47df617
parent5e3f5ab9a2ea79b93da052a274d8b709410b8381 (diff)
downloadaports-376454e172c208d16c5d188802301102090e6b85.tar.bz2
aports-376454e172c208d16c5d188802301102090e6b85.tar.xz
main/gdb: support crosscompiling and musl
-rw-r--r--main/gdb/APKBUILD33
-rw-r--r--main/gdb/gdb-linux_nat.patch30
-rw-r--r--main/gdb/gdb-linux_osdata.patch10
-rw-r--r--main/gdb/gdb-linux_threaddb.patch28
4 files changed, 96 insertions, 5 deletions
diff --git a/main/gdb/APKBUILD b/main/gdb/APKBUILD
index 3fd3eef8bd..b9b4439be0 100644
--- a/main/gdb/APKBUILD
+++ b/main/gdb/APKBUILD
@@ -12,7 +12,11 @@ makedepends="ncurses-dev expat-dev texinfo readline-dev libiconv-dev python-dev
subpackages="$pkgname-doc"
source="http://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.bz2
05_all_readline-headers.patch
- cpuid-pic.patch"
+ cpuid-pic.patch
+ gdb-linux_nat.patch
+ gdb-linux_osdata.patch
+ gdb-linux_threaddb.patch
+ "
# patches were found here:
# http://distfiles.gentoo.org/distfiles/gdb-7.4-patches-1.tar.xz
_builddir="$srcdir"/$pkgname-$pkgver
@@ -31,11 +35,21 @@ prepare() {
build () {
cd "$_builddir"
local _config="--prefix=/usr
+ --build=$CBUILD
+ --host=$CHOST
+ --target=$CTARGET
+ --with-build-sysroot=$CBUILDROOT
--disable-nls
- --with-system-readline
--disable-werror
--mandir=/usr/share/man
--infodir=/usr/share/info"
+
+ # use system readline if not cross compiling
+ [ "$CBUILD" = "$CHOST" ] && _config="$_config --with-system-readline"
+
+ # gdb server does not compile with musl
+ [ "${CHOST#*musl}" != "$CHOST" ] && _config="$_config --disable-gdbserver"
+
./configure $_config
cd opcodes && ./configure $_config || return 1
cd ..
@@ -53,10 +67,19 @@ package() {
md5sums="fda57170e4d11cdde74259ca575412a8 gdb-7.6.tar.bz2
701b030be4c141eab6409d37f5afa11b 05_all_readline-headers.patch
-a679796124dc56798cdebffa524f661c cpuid-pic.patch"
+a679796124dc56798cdebffa524f661c cpuid-pic.patch
+fa690484f7cdd2d552216d515653b97f gdb-linux_nat.patch
+58e5c62bd1104f61d1f01809aab55abb gdb-linux_osdata.patch
+70777c7a82f3cbab0a70a9088feea4ac gdb-linux_threaddb.patch"
sha256sums="a410e8f35ee70cce83dbbf1da9e2a8373f271ac0e4b71db4336ae293fc7bdf1b gdb-7.6.tar.bz2
390a88feac5f1d3980458057e1903a3fa104edb32daa6bb76396af1cb91cefc2 05_all_readline-headers.patch
-d22ce97b01c3bb25cc17831c60b984eebe2c1fe573b04a0d87e535794294e399 cpuid-pic.patch"
+d22ce97b01c3bb25cc17831c60b984eebe2c1fe573b04a0d87e535794294e399 cpuid-pic.patch
+15eef2bf2679353de30e31f6b60b1045e453519f4f2e9fc84472b68a0c35d83d gdb-linux_nat.patch
+9d92d4e760d604771a835181b35930b960abdaa9aaee699544484602cc09dfb5 gdb-linux_osdata.patch
+0ec1c6c3fa09ecce7872bf1ba8a40b06238f62b4587b4d15fe29229f75cbc997 gdb-linux_threaddb.patch"
sha512sums="3b4f7f25ab8a8014a339966fd165dac6ac63df7d6403c338bbd38737bc0033d7e6461cdea2cd6dd095335a9d2a0ecd9d694e862b8d54d269dae577402e2b3ffe gdb-7.6.tar.bz2
dfb7f7272305779599d3da51ce1158628473534a96f2721d7060930c94800a4efc061321bc5a9e455c72f670cfb77f0eb01cb696da55a4accf96f555377f551f 05_all_readline-headers.patch
-10551a28767b270ff5107fde595ad8877f3f2d684edccc85c18d08e3a9a2c4afe48da804adf9f8e716b666817906b22565a614d22fbc91e4ee650e1ecdb8fb0e cpuid-pic.patch"
+10551a28767b270ff5107fde595ad8877f3f2d684edccc85c18d08e3a9a2c4afe48da804adf9f8e716b666817906b22565a614d22fbc91e4ee650e1ecdb8fb0e cpuid-pic.patch
+c61cdf6a0b518125d977a26f8929948a47205a396e011730719b49d1395d4889a03e216108c00b1ffe28fc4ac9a820e1cdf55b69fa246d2b2f890b8da46d8508 gdb-linux_nat.patch
+209de5ce0f2c01e313fc39f97576e67b8a98a991d45d302906e4b85f2e21e2948e76d530f2554964042e53d827af0414aee64a30bfa176e77815658fbc11ea0b gdb-linux_osdata.patch
+af29422ef3b5bf2d95868532a1054a50141dd072c061003e6b86ac922e20d2e16baabb9eeb92c06734ae5ee86cdd40f1ef8e807fe258b56ad6b3513ad7915523 gdb-linux_threaddb.patch"
diff --git a/main/gdb/gdb-linux_nat.patch b/main/gdb/gdb-linux_nat.patch
new file mode 100644
index 0000000000..ba947ad07a
--- /dev/null
+++ b/main/gdb/gdb-linux_nat.patch
@@ -0,0 +1,30 @@
+diff -u -r -N gdb-7.3.1-org//gdb/linux-nat.c gdb-7.3.1-patched//gdb/linux-nat.c
+--- gdb-7.3.1-org//gdb/linux-nat.c 1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.1-patched//gdb/linux-nat.c 2011-09-22 22:17:38.647841814 +0000
+@@ -18,6 +18,7 @@
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
++#include "stopcode.h"
+ #include "defs.h"
+ #include "inferior.h"
+ #include "target.h"
+@@ -68,6 +69,10 @@
+ # endif
+ #endif /* HAVE_PERSONALITY */
+
++#ifndef __SIGRTMIN
++#define __SIGRTMIN SIGRTMIN
++#endif
++
+ /* This comment documents high-level logic of this file.
+
+ Waiting for events in sync mode
+diff -u -r -N gdb-7.3.1-org//gdb/stopcode.h gdb-7.3.1-patched//gdb/stopcode.h
+--- gdb-7.3.1-org//gdb/stopcode.h 1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.1-patched//gdb/stopcode.h 2011-09-22 22:17:38.648841814 +0000
+@@ -0,0 +1,4 @@
++#ifndef W_STOPCODE
++#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
++#endif
++
diff --git a/main/gdb/gdb-linux_osdata.patch b/main/gdb/gdb-linux_osdata.patch
new file mode 100644
index 0000000000..aa2a392f4c
--- /dev/null
+++ b/main/gdb/gdb-linux_osdata.patch
@@ -0,0 +1,10 @@
+--- gdb-7.6/gdb/common/linux-osdata.c.orig
++++ gdb-7.6/gdb/common/linux-osdata.c
+@@ -27,6 +27,7 @@
+
+ #include <sys/types.h>
+ #include <sys/sysinfo.h>
++#include <sys/socket.h>
+ #include <ctype.h>
+ #include <stdlib.h>
+ #include <string.h>
diff --git a/main/gdb/gdb-linux_threaddb.patch b/main/gdb/gdb-linux_threaddb.patch
new file mode 100644
index 0000000000..4148a1a263
--- /dev/null
+++ b/main/gdb/gdb-linux_threaddb.patch
@@ -0,0 +1,28 @@
+diff -u -r -N gdb-7.3.1-org//gdb/linux-thread-db.c gdb-7.3.1-patched//gdb/linux-thread-db.c
+--- gdb-7.3.1-org//gdb/linux-thread-db.c 1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.1-patched//gdb/linux-thread-db.c 2011-09-22 22:17:38.648841814 +0000
+@@ -47,6 +47,8 @@
+ #include <gnu/libc-version.h>
+ #endif
+
++#include "threadpathhack.h"
++
+ /* GNU/Linux libthread_db support.
+
+ libthread_db is a library, provided along with libpthread.so, which
+diff -u -r -N gdb-7.3.1-org//gdb/threadpathhack.h gdb-7.3.1-patched//gdb/threadpathhack.h
+--- gdb-7.3.1-org//gdb/threadpathhack.h 1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.1-patched//gdb/threadpathhack.h 2011-09-22 22:17:38.648841814 +0000
+@@ -0,0 +1,12 @@
++#ifndef HACK_PATH_SO
++#define HACK_PATH_SO
++
++#ifndef LIBTHREAD_DB_SO
++#define LIBTHREAD_DB_SO "bug.so"
++#endif
++#ifndef LIBTHREAD_DB_SEARCH_PATH
++#define LIBTHREAD_DB_SEARCH_PATH "/lib"
++#endif
++
++#endif
++