Update libatomic patch and makefile

git-svn-id: svn://svn.openwrt.org/openwrt/packages@9803 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2007-12-19 08:36:59 +00:00
parent 0dea9a8b97
commit b0917e4937
2 changed files with 63 additions and 76 deletions

View File

@ -49,16 +49,17 @@ define Build/Compile
endef endef
define Build/InstallDev define Build/InstallDev
mkdir -p $(1)/usr/include/atomicops/ mkdir -p $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/include/atomic_ops{,_malloc,_stack}.h $(1)/usr/include/atomicops/ $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
mkdir -p $(1)/usr/lib mkdir -p $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libatomic_ops*.a $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libatomic_ops*.a $(1)/usr/lib/
endef endef
define Build/UninstallDev define Build/UninstallDev
rm -rf \ rm -rf \
$(STAGING_DIR)/usr/include/libatomicops \ $(STAGING_DIR)/usr/include/atomic_ops{,_malloc,_stack}.h \
$(STAGING_DIR)/usr/lib/libatomic_ops*.a $(STAGING_DIR)/usr/include/atomic_ops \
$(STAGING_DIR)/usr/lib/libatomic_ops{,_gpl}.a
endef endef
$(eval $(call BuildPackage,libatomicops)) $(eval $(call BuildPackage,libatomicops))

View File

@ -1,61 +1,38 @@
From ths@networkno.de Thu Oct 27 15:44:14 2005 diff --git a/src/atomic_ops.h b/src/atomic_ops.h
Received: (at submit) by bugs.debian.org; 27 Oct 2005 22:44:14 +0000 index c23f30b..791b360 100755
Return-path: <ths@networkno.de> --- a/src/atomic_ops.h
Received: from mx02.qsc.de [213.148.130.14] +++ b/src/atomic_ops.h
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian)) @@ -220,6 +220,9 @@
id 1EVGTm-0002nQ-00; Thu, 27 Oct 2005 15:44:14 -0700 # if defined(__cris__) || defined(CRIS)
Received: from port-195-158-169-21.dynamic.qsc.de ([195.158.169.21] helo=hattusa.textio) # include "atomic_ops/sysdeps/gcc/cris.h"
by mx02.qsc.de with esmtp (Exim 3.35 #1) # endif
id 1EVGTH-00020N-00 +# if defined(__mips__)
for submit@bugs.debian.org; Fri, 28 Oct 2005 00:43:43 +0200 +# include "atomic_ops/sysdeps/gcc/mips.h"
Received: from ths by hattusa.textio with local (Exim 4.54) +# endif
id 1EVGTG-000263-9P #endif /* __GNUC__ && !AO_USE_PTHREAD_DEFS */
for submit@bugs.debian.org; Fri, 28 Oct 2005 00:43:42 +0200
Date: Fri, 28 Oct 2005 00:43:42 +0200
To: submit@bugs.debian.org
Subject: [mips/mipsel] FTBFS due to missing arch-specific implementation
Message-ID: <20051027224341.GX5721@hattusa.textio>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.11
From: Thiemo Seufer <ths@networkno.de>
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE
autolearn=no version=2.60-bugs.debian.org_2005_01_02
Package: libatomic-ops #if defined(__INTEL_COMPILER) && !defined(AO_USE_PTHREAD_DEFS)
Version: 1.0-3 diff --git a/src/atomic_ops/sysdeps/Makefile.am b/src/atomic_ops/sysdeps/Makefile.am
Tags: patch index 74122b4..d6737c0 100644
--- a/src/atomic_ops/sysdeps/Makefile.am
Libatomic-ops currently FTBFS on mips/mipsel because there is no +++ b/src/atomic_ops/sysdeps/Makefile.am
arch-specific implementation, and the generic pthread isn't configured. @@ -29,6 +29,7 @@ nobase_sysdep_HEADERS= generic_pthread.h \
The appended patch adds a basic implementation for linux.
Thiemo
--- libatomic-ops-1.0.away/src/atomic_ops/sysdeps/Makefile.am 2005-08-03 02:05:18.000000000 +0200
+++ libatomic-ops-1.0/src/atomic_ops/sysdeps/Makefile.am 2005-10-27 20:59:59.000000000 +0200
@@ -26,7 +26,7 @@ nobase_sysdep_HEADERS= generic_pthread.h
gcc/alpha.h gcc/arm.h gcc/x86.h \
gcc/hppa.h gcc/ia64.h \
gcc/powerpc.h gcc/sparc.h \ gcc/powerpc.h gcc/sparc.h \
- gcc/hppa.h gcc/m68k.h gcc/s390.h \ gcc/hppa.h gcc/m68k.h gcc/s390.h \
+ gcc/hppa.h gcc/m68k.h gcc/mips.h gcc/s390.h \
gcc/ia64.h gcc/x86_64.h gcc/cris.h \ gcc/ia64.h gcc/x86_64.h gcc/cris.h \
+ gcc/mips.h \
\ \
icc/ia64.h \ icc/ia64.h \
--- libatomic-ops-1.0.away/src/atomic_ops/sysdeps/gcc/mips.h 1970-01-01 01:00:00.000000000 +0100 \
+++ libatomic-ops-1.0/src/atomic_ops/sysdeps/gcc/mips.h 2005-10-28 00:11:19.000000000 +0200 diff --git a/src/atomic_ops/sysdeps/gcc/mips.h b/src/atomic_ops/sysdeps/gcc/mips.h
@@ -0,0 +1,65 @@ new file mode 100644
index 0000000..e7f3a5d
--- /dev/null
+++ b/src/atomic_ops/sysdeps/gcc/mips.h
@@ -0,0 +1,89 @@
+/* +/*
+ * Copyright (c) 2005 Thiemo Seufer <ths@networkno.de> + * Copyright (c) 2005 Thiemo Seufer <ths@networkno.de>
+ * Copyright (c) 2007 Zhang Le <r0bertz@gentoo.org>
+ * + *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
@ -78,7 +55,7 @@ Thiemo
+{ +{
+ __asm__ __volatile__( + __asm__ __volatile__(
+ " .set push \n" + " .set push \n"
+ " .set mips2 \n" + " .set mips3 \n"
+ " .set noreorder \n" + " .set noreorder \n"
+ " .set nomacro \n" + " .set nomacro \n"
+ " sync \n" + " sync \n"
@ -96,7 +73,7 @@ Thiemo
+ +
+ __asm__ __volatile__( + __asm__ __volatile__(
+ " .set push \n" + " .set push \n"
+ " .set mips2 \n" + " .set mips3 \n"
+ " .set noreorder \n" + " .set noreorder \n"
+ " .set nomacro \n" + " .set nomacro \n"
+ "1: ll %0, %1 \n" + "1: ll %0, %1 \n"
@ -115,21 +92,30 @@ Thiemo
+ +
+#define AO_HAVE_compare_and_swap +#define AO_HAVE_compare_and_swap
+ +
+AO_INLINE AO_t
+AO_fetch_and_add_full (volatile AO_t *p, AO_t incr)
+{
+ AO_t result, temp;
+ __asm__ __volatile__(
+ " .set push \n"
+ " .set mips3 \n"
+ " .set noreorder \n"
+ " .set nomacro \n"
+ "1: ll %1, %2 \n"
+ " addu %0, %1, %3 \n"
+ " sc %0, %2 \n"
+ " beqz %0, 1b \n"
+ " addu %0, %1, %3 \n"
+ " sync \n"
+ " .set pop \n"
+ : "=&r" (result), "=&r" (temp), "=m" (*p)
+ : "r" (incr), "m" (*p)
+ : "memory");
+ return result;
+}
+
+#define AO_HAVE_fetch_and_add_full
+
+/* +/*
+ * FIXME: We should also implement fetch_and_add and or primitives + * FIXME: fetch_and_add_full implemented, any others?
+ * directly.
+ */ + */
--- libatomic-ops-1.0.away/src/atomic_ops.h 2005-08-03 02:05:18.000000000 +0200
+++ libatomic-ops-1.0/src/atomic_ops.h 2005-10-27 21:01:29.000000000 +0200
@@ -219,6 +219,9 @@
# if defined(__cris__) || defined(CRIS)
# include "atomic_ops/sysdeps/gcc/cris.h"
# endif
+# if defined(__mips__)
+# include "atomic_ops/sysdeps/gcc/mips.h"
+# endif /* __mips__ */
#endif /* __GNUC__ && !AO_USE_PTHREAD_DEFS */
#if defined(__INTEL_COMPILER) && !defined(AO_USE_PTHREAD_DEFS)