summaryrefslogtreecommitdiff
path: root/multilib/dev86
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-12-03 23:14:41 +0000
committerroot <root@rshg054.dnsready.net>2011-12-03 23:14:41 +0000
commit851376cd7720e1f9b35e0a7c26bfd66399f0c4d3 (patch)
treef8579d1c934aa5c28308372bedc321628555a424 /multilib/dev86
parent8eed59114cbcf729b65f87d3f73530f6c8363d20 (diff)
Sat Dec 3 23:14:41 UTC 2011
Diffstat (limited to 'multilib/dev86')
-rw-r--r--multilib/dev86/PKGBUILD48
-rw-r--r--multilib/dev86/dev86-0.16.17-fortify.patch43
-rw-r--r--multilib/dev86/dev86-pic.patch20
3 files changed, 111 insertions, 0 deletions
diff --git a/multilib/dev86/PKGBUILD b/multilib/dev86/PKGBUILD
new file mode 100644
index 000000000..634592a08
--- /dev/null
+++ b/multilib/dev86/PKGBUILD
@@ -0,0 +1,48 @@
+# $Id: PKGBUILD 59310 2011-11-23 10:19:34Z spupykin $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: Alessio 'mOLOk' Bolognino <themolok@gmail.com>
+# Contributor: Suat SARIALP <muhendis.suat@gmail.com>
+
+pkgname=dev86
+pkgver=0.16.18
+pkgrel=2
+pkgdesc="Simple C compiler to generate 8086 code"
+arch=('i686' 'x86_64')
+url="http://www.debath.co.uk/dev86/"
+license=(GPL)
+[ "${CARCH}" == "x86_64" ] && depends=('lib32-glibc')
+makedepends=('bin86')
+options=('!libtool' '!strip' '!makeflags')
+source=(http://www.debath.co.uk/dev86/Dev86src-$pkgver.tar.gz
+ dev86-pic.patch
+ dev86-0.16.17-fortify.patch)
+md5sums=('f2e06b547397383b2b2650b9c4fd9bab'
+ '1b750c5561a4bde5f83f65e5827feb73'
+ '07238f9203c6528ea1e34198e771ea12')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ patch -Np0 -i $srcdir/dev86-pic.patch
+ patch -Np1 -i $srcdir/dev86-0.16.17-fortify.patch
+ if [ "${CARCH}" = "x86_64" ]; then
+ # x86_64 fix
+ sed -i.orig -e 's,alt-libs elksemu,alt-libs,' \
+ -e 's,install-lib install-emu,install-lib,' \
+ $srcdir/$pkgname-$pkgver/makefile.in
+ sed -i -e "s/-O2 -g/-O2 -g -m32/" makefile.in
+ sed -i 's|^LDFLAGS.*=$|LDFLAGS=-m32|' makefile.in
+ fi
+
+ unset CFLAGS
+ unset LDFLAGS
+ unset CPPFLAGS
+ unset CXXFLAGS
+
+ make PREFIX=/usr DIST="$pkgdir"
+ make install-all DIST="$pkgdir"
+ mkdir -p $pkgdir/usr/share
+ mv $pkgdir/usr/man $pkgdir/usr/share
+ # remove all the stuff supplied by bin86
+ rm $pkgdir/usr/bin/{as,ld,nm,objdump,size}86
+ rm $pkgdir/usr/share/man/man1/{as,ld}86.1
+}
diff --git a/multilib/dev86/dev86-0.16.17-fortify.patch b/multilib/dev86/dev86-0.16.17-fortify.patch
new file mode 100644
index 000000000..715d0c4ca
--- /dev/null
+++ b/multilib/dev86/dev86-0.16.17-fortify.patch
@@ -0,0 +1,43 @@
+--- dev86-0.16.17/bcc/bcc.c
++++ dev86-0.16.17/bcc/bcc.c
+@@ -19,6 +19,7 @@
+ #ifdef __STDC__
+ #include <stdlib.h>
+ #ifndef MSDOS
++#include <limits.h>
+ #include <unistd.h>
+ #endif
+ #else
+@@ -596,12 +597,17 @@
+ }
+ }
+
+-void
+-command_reset()
+-{
+ #ifndef MAXPATHLEN
++#ifdef PATH_MAX
++#define MAXPATHLEN PATH_MAX
++#else
+ #define MAXPATHLEN 1024
+ #endif
++#endif
++
++void
++command_reset()
++{
+ char buf[MAXPATHLEN];
+ char ** prefix;
+ char * saved_cmd;
+@@ -1308,11 +1314,7 @@
+
+ for(d=s=ptr; d && *s; s=d)
+ {
+-#ifdef MAXPATHLEN
+ char buf[MAXPATHLEN];
+-#else
+- char buf[1024];
+-#endif
+
+ free(temp);
+ d=strchr(s, ':');
diff --git a/multilib/dev86/dev86-pic.patch b/multilib/dev86/dev86-pic.patch
new file mode 100644
index 000000000..439c2648b
--- /dev/null
+++ b/multilib/dev86/dev86-pic.patch
@@ -0,0 +1,20 @@
+--- elksemu/elks.c.orig 2005-11-04 01:35:37.000000000 +0100
++++ elksemu/elks.c 2005-11-04 01:45:28.000000000 +0100
+@@ -129,8 +129,17 @@
+ static inline int vm86_mine(struct vm86_struct* v86)
+ {
+ int __res;
++#ifndef __PIC__
+ __asm__ __volatile__("int $0x80\n"
+ :"=a" (__res):"a" ((int)OLD_SYS_vm86), "b" ((int)v86));
++#else
++ __asm__ __volatile__(
++ "movl %%ebx,%%ecx\n\t"
++ "movl %2,%%ebx\n\t"
++ "int $0x80\n\t"
++ "movl %%ecx,%%ebx\n\t"
++ :"=a" (__res):"a" ((int)OLD_SYS_vm86), "r" ((int)v86) : "ecx");
++#endif
+ return __res;
+ }
+ #endif