Commit 191d0518 authored by Ulf Samuelsson's avatar Ulf Samuelsson
Browse files

Add AVR32 support for uclibc-0-9-29

parent 022b1041
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ choice
		bool "uClibc 0.9.28.3"

	config BR2_UCLIBC_VERSION_0_9_29
		depends !BR2_avr32
		bool "uClibc 0.9.29"

	config BR2_UCLIBC_VERSION_SNAPSHOT
+3579 −0

File added.

Preview size limit exceeded, changes collapsed.

+28 −0
Original line number Diff line number Diff line
From: Haavard Skinnemoen <hskinnemoen@atmel.com>
Date: Wed, 19 Sep 2007 10:03:36 +0200
Subject: [Avr-gnu-toolchain] [uClibc PATCH] Fix inverted logic in
	__compare_and_swap in linuxthreads.old

If the old value equals the value in memory, the result should be
TRUE, not FALSE.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
---
 .../linuxthreads.old/sysdeps/avr32/pt-machine.h    |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libpthread/linuxthreads.old/sysdeps/avr32/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/avr32/pt-machine.h
index 2e8a33b..eccf329 100644
--- a/libpthread/linuxthreads.old/sysdeps/avr32/pt-machine.h
+++ b/libpthread/linuxthreads.old/sysdeps/avr32/pt-machine.h
@@ -67,7 +67,7 @@ __compare_and_swap(long int *p, long int oldval, long int newval)
 		: "m"(*p), [new] "r"(newval), [old] "r"(oldval)
 		: "cc", "memory");
 
-	return result;
+	return result == 0;
 }
 
 #endif /* pt-machine.h */
-- 
1.5.3.1
+46 −0
Original line number Diff line number Diff line
From 91cb4bb00e4d9463c0d41015152daa4b39acf762 Mon Sep 17 00:00:00 2001
From: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Date: Tue, 18 Sep 2007 10:15:05 +0200
Subject: [PATCH] Fix resolve when identical IPv4 and IPv6 hosts are defined in /etc/hosts

This patch will fix a problem when the same host is defined with both IPv4 and
IPv6 entries in /etc/hosts. Previous only the first of these host would work,
as uClibc would read the /etc/hosts file from top to bottom, failing if the
first hit did not match the IP type.

Now uClibc will continue reading, even if the first correct entry name, but wrong IP
type fails. Thus, allowing a second correct entry name with correct IP type
will result in a name resolve.

Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
---
 libc/inet/resolv.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index f4e6cac..9cdc3fe 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -1643,7 +1643,7 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type,
 			*result=result_buf;
 			ret=NETDB_SUCCESS;
 #ifdef __UCLIBC_HAS_IPV6__
-        } else if (type == AF_INET6 && inet_pton(AF_INET6, alias[0], in6) > 0) {
+		} else if (type == AF_INET6 && inet_pton(AF_INET6, alias[0], in6) > 0) {
 			DPRINTF("Found INET6\n");
 			addr_list6[0] = in6;
 			addr_list6[1] = 0;
@@ -1658,8 +1658,8 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type,
 		} else {
 			DPRINTF("Error\n");
 			ret=TRY_AGAIN;
-			break; /* bad ip address */
-        }
+			continue; /* bad ip address, keep searching */
+		}
 
 		if (action!=GETHOSTENT) {
 			fclose(fp);
-- 
1.5.2.5
+68 −0
Original line number Diff line number Diff line
From: Haavard Skinnemoen <hskinnemoen@atmel.com>
Date: Wed, 19 Sep 2007 10:03:35 +0200
Subject: [Avr-gnu-toolchain] [uClibc PATCH] Load GOT pointer at the
	beginning of .init and .fini

I don't know why this seems to have worked before, but the .init and
.fini sections typically consist of a bunch of mcalls using r6 as the
base pointer. This can cause "interesting" behaviour when r6 hasn't
been initialized to point to the GOT.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
---
 libc/sysdeps/linux/avr32/crti.S |   15 ++++++++++++---
 libc/sysdeps/linux/avr32/crtn.S |    4 ++--
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/libc/sysdeps/linux/avr32/crti.S b/libc/sysdeps/linux/avr32/crti.S
index 3e132d0..660f47c 100644
--- a/libc/sysdeps/linux/avr32/crti.S
+++ b/libc/sysdeps/linux/avr32/crti.S
@@ -4,14 +4,23 @@
 	.global	_init
 	.type	_init, @function
 _init:
-	/* Use a four-byte instruction to avoid NOPs */
-	stm	--sp, r0-r7,lr
+	stm	--sp, r6, lr
+	lddpc	r6, 2f
+1:	rsub	r6, pc
+	rjmp	3f
 	.align	2
+2:	.long	1b - _GLOBAL_OFFSET_TABLE_
+3:
 
 	.section .fini
 	.align	2
 	.global	_fini
 	.type	_fini, @function
 _fini:
-	stm	--sp, r0-r7,lr
+	stm	--sp, r6, lr
+	lddpc	r6, 2f
+1:	rsub	r6, pc
+	rjmp	3f
 	.align	2
+2:	.long	1b - _GLOBAL_OFFSET_TABLE_
+3:
diff --git a/libc/sysdeps/linux/avr32/crtn.S b/libc/sysdeps/linux/avr32/crtn.S
index 577adcc..f7d1040 100644
--- a/libc/sysdeps/linux/avr32/crtn.S
+++ b/libc/sysdeps/linux/avr32/crtn.S
@@ -3,12 +3,12 @@
 	.align	2
 	.global	_init
 	.type	_init, @function
-	ldm	sp++, r0-r7,pc
+	ldm	sp++, r6, pc
 	.size	_init, . - _init
 
 	.section .fini
 	.align	2
 	.global _fini
 	.type	_fini, @function
-	ldm	sp++, r0-r7,pc
+	ldm	sp++, r6, pc
 	.size	_fini, . - _fini
-- 
1.5.3.1