Prechádzať zdrojové kódy

musl libc compat updates

Waldemar Brodkorb 10 rokov pred
rodič
commit
8d2f8e89c7

+ 4 - 0
package/busybox/Makefile

@@ -38,8 +38,12 @@ BB_MAKE_FLAGS:=		V=1 IPKG_ARCH="${CPU_ARCH}" ARCH="${ARCH}" GCC_HONOUR_COPTS=s \
 			HOSTCC="${CC_FOR_BUILD}" HOSTCFLAGS="$(CFLAGS_FOR_BUILD)" \
 			-C ${WRKBUILD} 
 ifneq (${ADK_NATIVE},y)
+ifeq ($(ADK_TARGET_LIB_STATIC_LIBGCC),)
 BB_MAKE_FLAGS+=		CROSS_COMPILE="$(TARGET_CROSS)" EXTRA_LDFLAGS='-static-libgcc'
 else
+BB_MAKE_FLAGS+=		CROSS_COMPILE="$(TARGET_CROSS)"
+endif
+else
 BB_MAKE_FLAGS+=		EXTRA_LDFLAGS="-static-libgcc"
 endif
 

+ 12 - 0
package/busybox/patches/014-disable-static-libgcc.patch

@@ -0,0 +1,12 @@
+diff -Nur busybox-1.20.2.orig/Makefile.flags busybox-1.20.2/Makefile.flags
+--- busybox-1.20.2.orig/Makefile.flags	2012-06-26 15:35:45.000000000 +0200
++++ busybox-1.20.2/Makefile.flags	2013-08-13 14:25:53.000000000 +0200
+@@ -50,7 +50,7 @@
+ # -fno-guess-branch-probability: prohibit pseudo-random guessing
+ # of branch probabilities (hopefully makes bloatcheck more stable):
+ CFLAGS += $(call cc-option,-fno-guess-branch-probability,)
+-CFLAGS += $(call cc-option,-funsigned-char -static-libgcc,)
++CFLAGS += $(call cc-option,-funsigned-char,)
+ CFLAGS += $(call cc-option,-falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1,)
+ 
+ # FIXME: These warnings are at least partially to be concerned about and should

+ 3 - 1
package/cfgfs/Makefile

@@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk
 
 PKG_NAME:=		cfgfs
 PKG_VERSION:=		1.0.9
-PKG_RELEASE:=		5
+PKG_RELEASE:=		6
 PKG_DESCR:=		compressed config filesystem
 PKG_SECTION:=		base
 PKG_URL:=		http://openadk.org/
@@ -27,7 +27,9 @@ $(eval $(call PKG_template,CFGFS,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG
 CONFIG_STYLE:=		manual
 INSTALL_STYLE:=		manual
 
+ifeq ($(ADK_TARGET_LIB_STATIC_LIBGCC),y)
 TARGET_LDFLAGS+=	-static-libgcc
+endif
 
 do-install:
 	${INSTALL_DIR} ${IDIR_CFGFS}/sbin

+ 0 - 2
package/cfgfs/src/compress.c

@@ -28,8 +28,6 @@
 #include "defs.h"
 #include "compress.h"
 
-__RCSID("$MirOS: contrib/hosted/fwcf/compress.c,v 1.7 2006/09/23 23:46:35 tg Exp $");
-
 static void compress_initialise(void);
 
 static fwcf_compressor *fwcf_compressors = NULL;

+ 0 - 4
package/cfgfs/src/compress.h

@@ -31,14 +31,11 @@ typedef struct FWCF_COMPRESSOR {
 	uint8_t code;
 } fwcf_compressor;
 
-__BEGIN_DECLS
 /* 0=success 1=EINVAL 2=slot already used */
 int compress_register(fwcf_compressor *);
-__END_DECLS
 
 /* END of plug-in API description, version 1.0 */
 
-__BEGIN_DECLS
 /* low-level */
 fwcf_compressor *compress_enumerate(void);
 int compress_list(void);
@@ -47,6 +44,5 @@ int compress_list(void);
 fwcf_compressor *compressor_get(uint8_t);
 int compressor_getbyname(const char *);
 int list_compressors(void);
-__END_DECLS
 
 #endif

+ 0 - 7
package/cfgfs/src/defs.h

@@ -18,13 +18,6 @@
 #define __RCSID(x)	static const char __rcsid[] __attribute__((used)) = (x)
 #endif
 
-#ifndef BSD
-#define uint8_t		u_int8_t
-#define uint16_t	u_int16_t
-#define uint32_t	u_int32_t
-#define uint64_t	u_int64_t
-#endif
-
 #ifndef __dead
 #define __dead		__attribute__((noreturn))
 #endif

+ 1 - 1
package/cfgfs/src/ft_creat.c

@@ -221,7 +221,7 @@ make_file(char *n, uint8_t *buf, size_t len)
 	}
 
 	if ((size_t)write(fd, buf, len) != len)
-		warn("could not write %lu bytes", (u_long)len);
+		warn("could not write %lu bytes", (unsigned long)len);
 
 	if (close(fd))
 		warn("close");

+ 16 - 18
package/cfgfs/src/fts.c

@@ -52,8 +52,6 @@ static char sccsid[] = "@(#)fts.c	8.6 (Berkeley) 8/14/94";
 
 #include "defs.h"
 
-__RCSID("$MirOS: contrib/hosted/fwcf/fts.c,v 1.3 2007/07/02 14:50:21 tg Exp $");
-
 #define internal_function
 
 /* Largest alignment size needed, minus one.
@@ -67,15 +65,15 @@ __RCSID("$MirOS: contrib/hosted/fwcf/fts.c,v 1.3 2007/07/02 14:50:21 tg Exp $");
 #endif
 
 
-static FTSENT	*fts_alloc __P((FTS *, const char *, int)) internal_function;
-static FTSENT	*fts_build __P((FTS *, int)) internal_function;
-static void	 fts_lfree __P((FTSENT *)) internal_function;
-static void	 fts_load __P((FTS *, FTSENT *)) internal_function;
-static size_t	 fts_maxarglen __P((char * const *)) internal_function;
-static void	 fts_padjust __P((FTS *, FTSENT *)) internal_function;
-static int	 fts_palloc __P((FTS *, size_t)) internal_function;
-static FTSENT	*fts_sort __P((FTS *, FTSENT *, int)) internal_function;
-static u_short	 fts_stat __P((FTS *, FTSENT *, int)) internal_function;
+static FTSENT	*fts_alloc (FTS *, const char *, int) internal_function;
+static FTSENT	*fts_build (FTS *, int) internal_function;
+static void	 fts_lfree (FTSENT *) internal_function;
+static void	 fts_load (FTS *, FTSENT *) internal_function;
+static size_t	 fts_maxarglen (char * const *) internal_function;
+static void	 fts_padjust (FTS *, FTSENT *) internal_function;
+static int	 fts_palloc (FTS *, size_t) internal_function;
+static FTSENT	*fts_sort (FTS *, FTSENT *, int) internal_function;
+static u_short	 fts_stat (FTS *, FTSENT *, int) internal_function;
 static int	 fts_safe_changedir(FTS *, FTSENT *, int, char *);
 
 #ifndef MAX
@@ -101,7 +99,7 @@ FTS *
 fts_open(argv, options, compar)
 	char * const *argv;
 	register int options;
-	int (*compar) __P((const FTSENT **, const FTSENT **));
+	int (*compar) (const FTSENT **, const FTSENT **);
 {
 	register FTS *sp;
 	register FTSENT *p, *root;
@@ -119,7 +117,7 @@ fts_open(argv, options, compar)
 	if ((sp = malloc((u_int)sizeof(FTS))) == NULL)
 		return (NULL);
 	memset(sp, 0, sizeof(FTS));
-	sp->fts_compar = (int (*) __P((const void *, const void *))) compar;
+	sp->fts_compar = (int (*) (const void *, const void *)) compar;
 	sp->fts_options = options;
 
 	/* Logical walks turn on NOCHDIR; symbolic links are too hard. */
@@ -694,11 +692,11 @@ fts_build(sp, type)
 		if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
 			continue;
 
-		if ((p = fts_alloc(sp, dp->d_name, (int)_D_EXACT_NAMLEN (dp))) == NULL)
+		if ((p = fts_alloc(sp, dp->d_name, (int)strlen(dp->d_name))) == NULL)
 			goto mem1;
-		if (_D_EXACT_NAMLEN (dp) >= maxlen) {/* include space for NUL */
+		if (strlen(dp->d_name) >= maxlen) {/* include space for NUL */
 			oldaddr = sp->fts_path;
-			if (fts_palloc(sp, _D_EXACT_NAMLEN (dp) + len + 1)) {
+			if (fts_palloc(sp, strlen(dp->d_name) + len + 1)) {
 				/*
 				 * No more memory for path or structures.  Save
 				 * errno, free up the current structure and the
@@ -723,7 +721,7 @@ mem1:				saved_errno = errno;
 			maxlen = sp->fts_pathlen - len;
 		}
 
-		if (len + _D_EXACT_NAMLEN (dp) >= USHRT_MAX) {
+		if (len + strlen(dp->d_name) >= USHRT_MAX) {
 			/*
 			 * In an FTSENT, fts_pathlen is a u_short so it is
 			 * possible to wraparound here.  If we do, free up
@@ -740,7 +738,7 @@ mem1:				saved_errno = errno;
 		}
 		p->fts_level = level;
 		p->fts_parent = sp->fts_cur;
-		p->fts_pathlen = len + _D_EXACT_NAMLEN (dp);
+		p->fts_pathlen = len + strlen(dp->d_name);
 
 #if defined FTS_WHITEOUT && 0
 		if (dp->d_type == DT_WHT)

+ 0 - 4
package/cfgfs/src/fts_gnu.h

@@ -123,15 +123,11 @@ typedef struct _ftsent {
 	char fts_name[1];		/* file name */
 } FTSENT;
 
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
 FTSENT	*fts_children(FTS *, int);
 int	 fts_close(FTS *);
 FTS	*fts_open(char * const *, int,
 	    int (*)(const FTSENT **, const FTSENT **));
 FTSENT	*fts_read(FTS *);
 int	 fts_set(FTS *, FTSENT *, int);
-__END_DECLS
 
 #endif /* !_FTS_H_ */

+ 0 - 2
package/cfgfs/src/fts_subs.c

@@ -37,8 +37,6 @@
 #define FTSF_INTERNALS
 #include "fts_subs.h"
 
-__RCSID("$MirOS: contrib/hosted/fwcf/fts_subs.c,v 1.8 2007/07/02 14:53:03 tg Exp $");
-
 static FTS *handle;
 
 char ftsf_prefix[PATH_MAX];

+ 0 - 2
package/cfgfs/src/fts_subs.h

@@ -27,11 +27,9 @@ typedef struct FTSF_ENTRY ftsf_entry;
 extern const char ftsf_prefix[];
 #endif
 
-__BEGIN_DECLS
 void ftsf_start(const char *);
 /* returns -1 on error, 0 on empty, 1 on okay */
 int ftsf_next(ftsf_entry *);
 void ftsf_debugent(ftsf_entry *);
-__END_DECLS
 
 #endif

+ 0 - 2
package/cfgfs/src/minilzop.h

@@ -9,11 +9,9 @@
 #ifndef MINILZOP_H
 #define MINILZOP_H
 
-__BEGIN_DECLS
 int minilzop(int ifd, int ofd, int compr_alg, int decompress);
 /* TODO: use the two below for the “outer filesystem” as well */
 void read_aszdata(int, char **, size_t *);
 void write_aszdata(int, const char *, size_t);
-__END_DECLS
 
 #endif

+ 0 - 2
package/cfgfs/src/pack.h

@@ -77,7 +77,6 @@ typedef struct FTSF_ENTRY ftsf_entry;
 		res;				\
 	})
 
-__BEGIN_DECLS
 char *ft_pack(ftsf_entry *);
 char *ft_packm(void);
 
@@ -90,6 +89,5 @@ void ft_creatm(char *, const char *);
 char *fwcf_unpack(int, size_t *);
 char *fwcf_pack(char *, size_t, int, size_t *);
 char *fwcf_packm(const char *, int, size_t *);
-__END_DECLS
 
 #endif

+ 3 - 4
package/cfgfs/src/sys_linux.c

@@ -23,6 +23,7 @@
 
 #include <err.h>
 #include <fcntl.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -30,8 +31,6 @@
 #include "defs.h"
 #include "sysdeps.h"
 
-__RCSID("$MirOS: contrib/hosted/fwcf/sys_linux.c,v 1.3 2006/09/26 10:25:03 tg Exp $");
-
 void
 pull_rndata(uint8_t *buf, size_t n)
 {
@@ -42,7 +41,7 @@ pull_rndata(uint8_t *buf, size_t n)
 		return;
 	}
 	if ((size_t)read(fd, buf, n) != n)
-		warn("Cannot read %lu bytes from /dev/urandom", (u_long)n);
+		warn("Cannot read %lu bytes from /dev/urandom", (unsigned long)n);
 	close(fd);
 }
 
@@ -56,6 +55,6 @@ push_rndata(uint8_t *buf, size_t n)
 		return;
 	}
 	if ((size_t)write(fd, buf, n) != n)
-		warn("Cannot write %lu bytes to /dev/urandom", (u_long)n);
+		warn("Cannot write %lu bytes to /dev/urandom", (unsigned long)n);
 	close(fd);
 }

+ 0 - 2
package/cfgfs/src/sysdeps.h

@@ -9,9 +9,7 @@
 #ifndef SYSDEPS_H
 #define SYSDEPS_H
 
-__BEGIN_DECLS
 void pull_rndata(uint8_t *, size_t);
 void push_rndata(uint8_t *, size_t);
-__END_DECLS
 
 #endif

+ 0 - 2
package/cfgfs/src/tool.c

@@ -32,8 +32,6 @@
 #include "minilzop.h"
 #include "pack.h"
 
-__RCSID("$MirOS: contrib/hosted/fwcf/tool.c,v 1.7 2007/03/09 22:35:13 tg Exp $");
-
 static __dead void usage(void);
 static int mkfwcf(int, const char *, int);
 static int unfwcf(int, const char *);

+ 3 - 3
package/cfgfs/src/unwraps.c

@@ -83,13 +83,13 @@ fwcf_unpack(int fd, size_t *inner)
 
 	if ((x = compressor_get(c)->decompress(udata, *inner, cdata + 12,
 	    outer - 16)) != *inner)
-		errx(1, "size mismatch: decompressed %lu, want %lu", (u_long)x,
-		    (u_long)*inner);
+		errx(1, "size mismatch: decompressed %lu, want %lu", (unsigned long)x,
+		    (unsigned long)*inner);
 	push_rndata((uint8_t *)cdata + outer, maxln - outer);
 	free(cdata);
 #ifdef DEBUG
 	fprintf(stderr, "fwcf_unpack: decompressed outer %lu inner %lu\n",
-	    (u_long)outer, (u_long)*inner);
+	    (unsigned long)outer, (unsigned long)*inner);
 #endif
 	return (udata);
 }

+ 2 - 2
package/cfgfs/src/wraps.c

@@ -67,9 +67,9 @@ fwcf_pack(char *odata, size_t i, int algo, size_t *dstsz)
 	char *data, *cdata;
 
 	if (i > 0xFFFFFF)
-		errx(1, "inner size of %lu too large", (u_long)i);
+		errx(1, "inner size of %lu too large", (unsigned long)i);
 #ifdef DEBUG
-	fprintf(stderr, "fwcf_pack: algo %02X packing %lu\n", algo, (u_long)i);
+	fprintf(stderr, "fwcf_pack: algo %02X packing %lu\n", algo, (unsigned long)i);
 #endif
 
 	if ((j = compressor_get(algo)->compress(&cdata, odata, i)) == -1)

+ 4 - 1
package/dropbear/Makefile

@@ -26,7 +26,10 @@ include $(TOPDIR)/mk/package.mk
 $(eval $(call PKG_template,DROPBEAR,$(PKG_NAME),$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
 $(eval $(call PKG_template,DBCONVERT,dropbearconvert,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_DBCONVERT},${PKG_SECTION}))
 
-TARGET_LDFLAGS+=	$(ADK_TARGET_ABI_CFLAGS)
+TARGET_LDFLAGS+=	$(ADK_TARGET_ABI_CFLAGS) -static
+ifeq ($(ADK_TARGET_LIB_STATIC_LIBGCC),y)
+TARGET_LDFLAGS+=	-static-libgcc
+endif
 BUILD_STYLE:=		manual
 INSTALL_STYLE:=		manual
 CONFIGURE_ARGS+=	--disable-pam \

+ 6 - 21
package/dropbear/patches/patch-Makefile_in

@@ -1,5 +1,5 @@
---- dropbear-2012.55.orig/Makefile.in	2012-02-23 14:47:05.000000000 +0100
-+++ dropbear-2012.55/Makefile.in	2012-10-05 17:24:16.000000000 +0200
+--- dropbear-2013.58.orig/Makefile.in	2013-04-18 16:58:14.000000000 +0200
++++ dropbear-2013.58/Makefile.in	2013-08-13 14:33:37.000000000 +0200
 @@ -56,7 +56,7 @@ HEADERS=options.h dbutil.h session.h pac
  		loginrec.h atomicio.h x11fwd.h agentfwd.h tcpfwd.h compat.h \
  		listener.h fake-rfc2553.h
@@ -9,28 +9,21 @@
  dbclientobjs=$(COMMONOBJS) $(CLISVROBJS) $(CLIOBJS)
  dropbearkeyobjs=$(COMMONOBJS) $(KEYOBJS)
  dropbearconvertobjs=$(COMMONOBJS) $(CONVERTOBJS)
-@@ -75,9 +75,8 @@ AR=@AR@
+@@ -75,10 +75,9 @@ AR=@AR@
  RANLIB=@RANLIB@
  STRIP=@STRIP@
  INSTALL=@INSTALL@
 -CPPFLAGS=@CPPFLAGS@
 -CFLAGS+=-I. -I$(srcdir) $(CPPFLAGS) @CFLAGS@
 -LIBS+=@LIBS@
+-LDFLAGS=@LDFLAGS@
 +CPPFLAGS=@CPPFLAGS@ -I. -I$(srcdir)
 +LIBS+=@LIBS@ @CRYPTLIB@
- LDFLAGS=@LDFLAGS@
++LDFLAGS+=@LDFLAGS@
  
  EXEEXT=@EXEEXT@
-@@ -159,7 +158,7 @@ dropbearkey: $(dropbearkeyobjs)
- dropbearconvert: $(dropbearconvertobjs)
  
- dropbear dbclient dropbearkey dropbearconvert: $(HEADERS) $(LIBTOM_DEPS) Makefile
--	$(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBS)
-+	$(CC) $(LDFLAGS) -static-libgcc -o $@$(EXEEXT) $($@objs) $(LIBS)
- 
- # scp doesn't use the libs so is special.
- scp: $(SCPOBJS)  $(HEADERS) Makefile
-@@ -169,14 +168,14 @@ scp: $(SCPOBJS)  $(HEADERS) Makefile
+@@ -169,7 +168,7 @@ scp: $(SCPOBJS)  $(HEADERS) Makefile
  # multi-binary compilation.
  MULTIOBJS=
  ifeq ($(MULTI),1)
@@ -39,11 +32,3 @@
  	CFLAGS+=$(addprefix -DDBMULTI_, $(PROGRAMS)) -DDROPBEAR_MULTI
  endif
  
- dropbearmulti: multilink 
- 
- multibinary: $(HEADERS) $(MULTIOBJS) $(LIBTOM_DEPS) Makefile
--	$(CC) $(LDFLAGS) -o dropbearmulti$(EXEEXT) $(MULTIOBJS) $(LIBS)
-+	$(CC) $(LDFLAGS) -static-libgcc -o dropbearmulti$(EXEEXT) $(MULTIOBJS) $(LIBS)
- 
- multilink: multibinary $(addprefix link, $(PROGRAMS))
- 

+ 5 - 5
package/dropbear/patches/patch-cli-runopts_c

@@ -1,7 +1,7 @@
 $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- dropbear-0.53.1.orig/cli-runopts.c	2011-03-02 14:23:35.000000000 +0100
-+++ dropbear-0.53.1/cli-runopts.c	2011-08-02 20:03:12.000000000 +0200
-@@ -287,6 +287,10 @@ void cli_getopts(int argc, char ** argv)
+--- dropbear-2013.58.orig/cli-runopts.c	2013-04-18 16:58:14.000000000 +0200
++++ dropbear-2013.58/cli-runopts.c	2013-08-13 14:29:15.000000000 +0200
+@@ -309,6 +309,10 @@ void cli_getopts(int argc, char ** argv)
  					debug_trace = 1;
  					break;
  #endif
@@ -11,8 +11,8 @@ $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
 +					break;
  				case 'F':
  				case 'e':
- 				case 'c':
-@@ -298,7 +302,6 @@ void cli_getopts(int argc, char ** argv)
+ #ifndef ENABLE_USER_ALGO_LIST
+@@ -322,7 +326,6 @@ void cli_getopts(int argc, char ** argv)
  #ifndef ENABLE_CLI_LOCALTCPFWD
  				case 'L':
  #endif

+ 2 - 2
package/dropbear/patches/patch-options_h

@@ -1,7 +1,7 @@
 diff -Nur dropbear-2013.58.orig/options.h dropbear-2013.58/options.h
 --- dropbear-2013.58.orig/options.h	2013-04-18 16:58:14.000000000 +0200
-+++ dropbear-2013.58/options.h	2013-04-29 14:28:47.000000000 +0200
-@@ -247,7 +247,7 @@
++++ dropbear-2013.58/options.h	2013-08-13 14:29:15.000000000 +0200
+@@ -247,7 +247,7 @@ much traffic. */
  /* The command to invoke for xauth when using X11 forwarding.
   * "-q" for quiet */
  #ifndef XAUTH_COMMAND

+ 2 - 1
package/gdb/Makefile

@@ -25,7 +25,8 @@ TARGET_CFLAGS+=		${TARGET_CPPFLAGS} -fPIC
 CONFIGURE_ARGS+=	--without-uiout --enable-gdbmi \
 			--disable-tui --disable-gdbtk --without-x \
 			--without-included-gettext --disable-sim \
-			--enable-threads --with-curses --disable-werror \
+			--with-curses --disable-werror \
+			--disable-gdbserver \
 			--enable-static --without-python
 XAKE_FLAGS+=		LDFLAGS='${TARGET_LDFLAGS}'
 # disable honour cflags stuff

+ 35 - 0
package/gdb/patches/patch-gdb_common_gdb_thread_db_h

@@ -0,0 +1,35 @@
+--- gdb-7.6.orig/gdb/common/gdb_thread_db.h	2013-01-01 07:32:54.000000000 +0100
++++ gdb-7.6/gdb/common/gdb_thread_db.h	2013-08-13 16:37:40.000000000 +0200
+@@ -1,17 +1,6 @@
+ #ifdef HAVE_THREAD_DB_H
+ #include <thread_db.h>
+ 
+-#ifndef LIBTHREAD_DB_SO
+-#define LIBTHREAD_DB_SO "libthread_db.so.1"
+-#endif
+-
+-#ifndef LIBTHREAD_DB_SEARCH_PATH
+-/* $sdir appears before $pdir for some minimal security protection:
+-   we trust the system libthread_db.so a bit more than some random
+-   libthread_db associated with whatever libpthread the app is using.  */
+-#define LIBTHREAD_DB_SEARCH_PATH "$sdir:$pdir"
+-#endif
+-
+ #else
+ 
+ /* Copyright (C) 1999-2013 Free Software Foundation, Inc.
+@@ -453,3 +442,14 @@ extern td_err_e td_thr_dbresume (const t
+ #endif	/* thread_db.h */
+ 
+ #endif /* HAVE_THREAD_DB_H */
++
++#ifndef LIBTHREAD_DB_SO
++#define LIBTHREAD_DB_SO "libthread_db.so.1"
++#endif
++
++#ifndef LIBTHREAD_DB_SEARCH_PATH
++/* $sdir appears before $pdir for some minimal security protection:
++   we trust the system libthread_db.so a bit more than some random
++   libthread_db associated with whatever libpthread the app is using.  */
++#define LIBTHREAD_DB_SEARCH_PATH "$sdir:$pdir"
++#endif

+ 10 - 0
package/gdb/patches/patch-gdb_common_linux-ptrace_h

@@ -0,0 +1,10 @@
+--- gdb-7.6.orig/gdb/common/linux-ptrace.h	2013-01-01 07:32:54.000000000 +0100
++++ gdb-7.6/gdb/common/linux-ptrace.h	2013-08-13 17:10:13.000000000 +0200
+@@ -20,6 +20,7 @@
+ 
+ struct buffer;
+ 
++#include <unistd.h>
+ #include <sys/ptrace.h>
+ 
+ #ifndef PTRACE_GETSIGINFO

+ 26 - 0
package/gdb/patches/patch-gdb_linux-nat_c

@@ -0,0 +1,26 @@
+--- gdb-7.6.orig/gdb/linux-nat.c	2013-02-13 15:59:49.000000000 +0100
++++ gdb-7.6/gdb/linux-nat.c	2013-08-13 17:01:09.000000000 +0200
+@@ -79,6 +79,14 @@
+ # endif
+ #endif /* HAVE_PERSONALITY */
+ 
++#ifndef __SIGRTMIN
++#define __SIGRTMIN SIGRTMIN
++#endif
++
++#ifndef W_STOPCODE
++#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
++#endif
++
+ /* This comment documents high-level logic of this file.
+ 
+ Waiting for events in sync mode
+@@ -2379,7 +2387,7 @@ linux_handle_extended_wait (struct lwp_i
+ 		status = 0;
+ 	    }
+ 
+-	  if (non_stop)
++	  if (1)
+ 	    {
+ 	      /* Add the new thread to GDB's lists as soon as possible
+ 		 so that:

+ 5 - 0
package/libthread_db/Makefile

@@ -9,6 +9,9 @@ endif
 ifeq ($(ADK_TARGET_LIB_EGLIBC),y)
 include ${TOPDIR}/toolchain/eglibc/Makefile.inc
 endif
+ifeq ($(ADK_TARGET_LIB_MUSL),y)
+include ${TOPDIR}/toolchain/musl/Makefile.inc
+endif
 ifeq ($(ADK_TARGET_LIB_UCLIBC),y)
 include ${TOPDIR}/toolchain/uClibc/Makefile.inc
 endif
@@ -30,7 +33,9 @@ INSTALL_STYLE:=		manual
 do-install:
 ifeq ($(ADK_NATIVE),)
 	${INSTALL_DIR} ${IDIR_LIBTHREAD_DB}/lib
+ifeq ($(ADK_TARGET_LIB_MUSL),)
 	${CP} ${STAGING_TARGET_DIR}/lib/libthread_db*.so* ${IDIR_LIBTHREAD_DB}/lib
 endif
+endif
 
 include ${TOPDIR}/mk/pkg-bottom.mk

+ 1 - 0
package/musl/Config.in.manual

@@ -4,6 +4,7 @@ config ADK_PACKAGE_MUSL
 	default y if ADK_TARGET_LIB_MUSL && !ADK_TOOLCHAIN_ONLY
 	default n
 	depends on ADK_TARGET_LIB_MUSL
+	select ADK_PACKAGE_LIBGCC
 	help
 	  Embedded C library.
 

+ 8 - 0
target/config/Config.in

@@ -564,6 +564,9 @@ config ADK_musl
 config ADK_libc
 	boolean
 
+config ADK_TARGET_LIB_STATIC_LIBGCC
+	boolean
+
 config ADK_TARGET_LIBC
 	string
 	default "uclibc"  if ADK_uclibc
@@ -581,6 +584,7 @@ config ADK_TARGET_LIB_UCLIBC
 	prompt "uClibc embedded C library"
 	boolean
 	select ADK_uclibc
+	select ADK_TARGET_LIB_STATIC_LIBGCC
 	depends on \
 		   !ADK_LINUX_SPARC64 && \
 		   !ADK_LINUX_PPC64 && \
@@ -593,6 +597,7 @@ config ADK_TARGET_LIB_EGLIBC
 	prompt "Embedded GNU C library"
 	boolean
 	select ADK_eglibc
+	select ADK_TARGET_LIB_STATIC_LIBGCC
 	depends on \
 		ADK_LINUX_ARM || \
 		ADK_LINUX_ARMEB || \
@@ -613,6 +618,7 @@ config ADK_TARGET_LIB_GLIBC
 	prompt "GNU C library"
 	boolean
 	select ADK_glibc
+	select ADK_TARGET_LIB_STATIC_LIBGCC
 	depends on \
 		ADK_LINUX_ARM || \
 		ADK_LINUX_ARMEB || \
@@ -648,6 +654,7 @@ config ADK_TARGET_LIB_LIBC
 	prompt "Native C library"
 	boolean
 	select ADK_libc
+	select ADK_TARGET_LIB_STATIC_LIBGCC
 	depends on ADK_LINUX_NATIVE
 
 endchoice
@@ -659,6 +666,7 @@ config ADK_TARGET_SUFFIX
 	default "gnu" if (ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_EGLIBC) && !ADK_EABI
 	default "uclibcgnueabi" if ADK_TARGET_LIB_UCLIBC && ADK_EABI
 	default "uclibc" if ADK_TARGET_LIB_UCLIBC && !ADK_EABI
+	default "muslgnueabihf" if ADK_TARGET_LIB_MUSL && ADK_EABIHF
 	default "muslgnueabi" if ADK_TARGET_LIB_MUSL && ADK_EABI
 	default "musl" if ADK_TARGET_LIB_MUSL && !ADK_EABI
 	default "gnu"

+ 2 - 2
toolchain/gdb/Makefile.inc

@@ -2,8 +2,8 @@
 # material, please see the LICENCE file in the top-level directory.
 
 PKG_NAME:=	gdb
-PKG_VERSION:=	7.5
-PKG_MD5SUM:=	24a6779a9fe0260667710de1b082ef61
+PKG_VERSION:=	7.6
+PKG_MD5SUM:=	fda57170e4d11cdde74259ca575412a8
 PKG_RELEASE:=	1
 PKG_SITES:=	${MASTER_SITE_GNU:=gdb/}
 DISTFILES:=	$(PKG_NAME)-$(PKG_VERSION).tar.bz2