aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanfe <danfe@FreeBSD.org>2007-07-02 16:37:31 +0800
committerdanfe <danfe@FreeBSD.org>2007-07-02 16:37:31 +0800
commit97db48f032dddc3c40ce6f1683fc38f8a4247c81 (patch)
tree7d76a20d394790106de276b0bb145260f2d23978
parentd95e092b9907238b28b077f07a950337a55f266f (diff)
downloadfreebsd-ports-graphics-97db48f032dddc3c40ce6f1683fc38f8a4247c81.tar.gz
freebsd-ports-graphics-97db48f032dddc3c40ce6f1683fc38f8a4247c81.tar.zst
freebsd-ports-graphics-97db48f032dddc3c40ce6f1683fc38f8a4247c81.zip
- Fix the build with GCC 4.2 [1]
- Clean up Makefile - Reformat pkg-descr slightly, kill attribution Reported by: pointyhat (logs) [1]
-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 8d2ff1a558d..a9e0bc20103 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 e3bb6caeb2d..b87ec116ac8 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 d0fa050e1ee..7765a4d481d 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.