aboutsummaryrefslogtreecommitdiff
path: root/devel/libcoro
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2007-07-02 08:37:31 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2007-07-02 08:37:31 +0000
commit7f1b560b27b156a25d45d8724e78383513847543 (patch)
treecc669b7460bb0d3d5428df07e0a0d3b4cef90d96 /devel/libcoro
parent2104d78f03a72908cfc078f5fb2382298ad8bafa (diff)
downloadports-7f1b560b27b156a25d45d8724e78383513847543.tar.gz
ports-7f1b560b27b156a25d45d8724e78383513847543.zip
- Fix the build with GCC 4.2 [1]
- Clean up Makefile - Reformat pkg-descr slightly, kill attribution Reported by: pointyhat (logs) [1]
Notes
Notes: svn path=/head/; revision=194614
Diffstat (limited to 'devel/libcoro')
-rw-r--r--devel/libcoro/Makefile26
-rw-r--r--devel/libcoro/files/patch-aa42
-rw-r--r--devel/libcoro/pkg-descr9
3 files changed, 54 insertions, 23 deletions
diff --git a/devel/libcoro/Makefile b/devel/libcoro/Makefile
index 8d2ff1a558db..a9e0bc201038 100644
--- a/devel/libcoro/Makefile
+++ b/devel/libcoro/Makefile
@@ -5,29 +5,29 @@
# $FreeBSD$
#
-PORTNAME= libcoro
-PORTVERSION= 1.0.3
-CATEGORIES= devel
-MASTER_SITES= ${MASTER_SITE_LOCAL}
+PORTNAME= libcoro
+PORTVERSION= 1.0.3
+CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= kbyanc
-DISTNAME= coro-${PORTVERSION}
+DISTNAME= coro-${PORTVERSION}
-MAINTAINER= ports@FreeBSD.org
-COMMENT= C library that implements coroutines
+MAINTAINER= ports@FreeBSD.org
+COMMENT= C library that implements coroutines
-ONLY_FOR_ARCHS= i386
+ONLY_FOR_ARCHS= i386
-HAS_CONFIGURE= yes
-CONFIGURE_ARGS= --arch arch/x86-freebsd
+HAS_CONFIGURE= yes
+CONFIGURE_ARGS= --arch arch/x86-freebsd
NOPRECIOUSMAKEVARS= yes
-MAN2= coro.2
+MAN2= coro.2
-PLIST_FILES= lib/libcoro.a include/coro.h
+PLIST_FILES= lib/libcoro.a include/coro.h
post-extract:
${CP} -r ${WRKSRC}/arch/x86-linux ${WRKSRC}/arch/x86-freebsd
- ${SED} -e '43,43s/$$/ __attribute__((noreturn,regparm(1)))/' \
+ @${SED} -e '43,43s/$$/ __attribute__((noreturn,regparm(1)))/' \
${WRKSRC}/arch/x86-linux/coro.c > ${WRKSRC}/arch/x86-freebsd/coro.c
.include <bsd.port.mk>
diff --git a/devel/libcoro/files/patch-aa b/devel/libcoro/files/patch-aa
index e3bb6caeb2d3..b87ec116ac8d 100644
--- a/devel/libcoro/files/patch-aa
+++ b/devel/libcoro/files/patch-aa
@@ -1,7 +1,15 @@
-diff -u arch/x86-freebsd/coro.c arch/x86-freebsd/coro.c
--- arch/x86-freebsd/coro.c Fri Jun 23 00:15:18 2000
+++ arch/x86-freebsd/coro.c Fri Jun 23 00:16:38 2000
-@@ -63,7 +63,7 @@
+@@ -53,6 +53,8 @@
+ co_create(void *func, void *stack, int size)
+ {
+ struct coroutine *co;
++ intptr_t _co;
++ void **sp;
+ int to_free = 0;
+
+ if (size < 128)
+@@ -63,14 +65,15 @@
size += 4096-1;
size &= ~(4096-1);
stack = mmap(0, size, PROT_READ|PROT_WRITE,
@@ -10,5 +18,31 @@ diff -u arch/x86-freebsd/coro.c arch/x86-freebsd/coro.c
if (stack == (void*)-1)
return 0;
-Only in arch/x86-freebsd: coro.o
-Only in arch/x86-freebsd: libcoro.a
+ to_free = size;
+ }
+ co = stack + size;
+- (unsigned long)co &= ~3;
++ _co = (intptr_t)co & ~3;
++ co = (struct coroutine *)_co;
+ co -= 1;
+
+ co->sp = co;
+@@ -80,11 +83,13 @@
+ co->func = func;
+ co->to_free = to_free;
+
+- *--(void **)co->sp = wrap; // return addr (here: start addr)
+- *--(void **)co->sp = 0; // ebp
+- *--(void **)co->sp = 0; // ebx
+- *--(void **)co->sp = 0; // esi
+- *--(void **)co->sp = 0; // edi
++ sp = (void **)co->sp;
++
++ *--sp = wrap; // return addr (here: start addr)
++ *--sp = 0; // ebp
++ *--sp = 0; // ebx
++ *--sp = 0; // esi
++ *--sp = 0; // edi
+ return co;
+ }
+
diff --git a/devel/libcoro/pkg-descr b/devel/libcoro/pkg-descr
index d0fa050e1ee7..7765a4d481df 100644
--- a/devel/libcoro/pkg-descr
+++ b/devel/libcoro/pkg-descr
@@ -8,9 +8,6 @@ Excerpt from The Art of Computer Programming by D. E. Knuth:
coro is a C library that implements the low level handling of coroutines.
Despite it's simplicity, there is no portable way to implement them. The goal
-of this library is to build a standard API for coroutines and implement it for
-as many architectures as possible. Currently only the i386 architecture is
-supported.
-
- -Kelly
- kbyanc@posi.net
+of this library is to build a standard API for coroutines and implement it
+for as many architectures as possible. Currently only the i386 architecture
+is supported.