diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/dev86/APKBUILD | 81 | ||||
-rw-r--r-- | main/dev86/dev86-long.patch | 17 | ||||
-rw-r--r-- | main/dev86/dev86-noelks.patch | 15 | ||||
-rw-r--r-- | main/dev86/dev86-overflow.patch | 24 | ||||
-rw-r--r-- | main/dev86/dev86-pic.patch | 20 | ||||
-rw-r--r-- | main/dev86/dev86-print-overflow.patch | 27 |
6 files changed, 184 insertions, 0 deletions
diff --git a/main/dev86/APKBUILD b/main/dev86/APKBUILD new file mode 100644 index 0000000000..84a08e4246 --- /dev/null +++ b/main/dev86/APKBUILD @@ -0,0 +1,81 @@ +# Contributor: Natanael Copa <ncopa@alpinelinux.org> +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=dev86 +pkgver=0.16.18 +pkgrel=0 +pkgdesc="A real mode 80x86 assembler and linker" +url="http://www.debath.co.uk/dev86/" +arch="all" +license="GPL+ and GPLv2+ and LGPLv2+" +depends= +makedepends="bash coreutils" +install="" +subpackages="$pkgname-doc" +source="http://www.debath.co.uk/dev86/Dev86src-$pkgver.tar.gz + dev86-noelks.patch + dev86-pic.patch + dev86-overflow.patch + dev86-print-overflow.patch + dev86-long.patch + " + +_builddir="$srcdir"/dev86-$pkgver +prepare() { + local i + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done + # use our CFLAGS + sed -i -e "s/-O2 -g/${CFLAGS}/" makefile.in +# if [ "$CARCH" = x86_64 ]; then + sed -i \ + -e 's,alt-libs elksemu,alt-libs,' \ + -e 's,install-lib install-emu,install-lib,' \ + makefile.in || return 1 +# fi + sed -i \ + -e "s:-O2 -g:${CFLAGS}:" \ + -e '/INEXE=/s:-s::' \ + makefile.in || return 1 + # no stripping + sed -i -e '/INSTALL_OPTS=/s:-s::' bin86/Makefile + sed -i -e '/install -m 755 -s/s:-s::' dis88/Makefile + +} + +build() { + cd "$_builddir" + export CPPFLAGS="" + export SHELL=/bin/bash + msg "building bcc86 unproto copt as86 ld86" + make -j1 bcc86 unproto copt as86 ld86 CFLAGS="$CFLAGS" CC="${CC:-gcc}" \ + || return 1 + msg "building cpp" + make -C cpp CFLAGS="$CFLAGS" CC="${CC:-gcc}" || return 1 + msg "building ar" + make -C ar CFLAGS="$CFLAGS" CC="${CC:-gcc}" || return 1 + msg "building ld" + make -C ld CFLAGS="$CFLAGS" CC="${CC:-gcc}" || return 1 + msg "building the rest..." + make -j1 DIST="$pkgdir" CC="${CC:-gcc}" || return 1 +} + +package() { + cd "$_builddir" + make DIST="$pkgdir" \ + MANDIR=/usr/share/man \ + LIBDIR=/usr/lib/bcc \ + INCLDIR=/usr/lib/bcc \ + LOCALPREFIX=/usr \ + install install-man +} + +md5sums="f2e06b547397383b2b2650b9c4fd9bab Dev86src-0.16.18.tar.gz +eba7081bc5dbd72b7b9b902275251499 dev86-noelks.patch +d508a2a8ededa9e34dbd9105dfd66290 dev86-pic.patch +8f462d57fe4d5c9393331ba917db0258 dev86-overflow.patch +7ce097efcb8c043727b4b3bf6c396c75 dev86-print-overflow.patch +cad5918764234a9ab0492147a336d437 dev86-long.patch" diff --git a/main/dev86/dev86-long.patch b/main/dev86/dev86-long.patch new file mode 100644 index 0000000000..34cde195bc --- /dev/null +++ b/main/dev86/dev86-long.patch @@ -0,0 +1,17 @@ +diff -up dev86-0.16.17/ld/x86_aout.h.long dev86-0.16.17/ld/x86_aout.h +--- dev86-0.16.17/ld/x86_aout.h.long 2003-01-28 23:17:14.000000000 +0100 ++++ dev86-0.16.17/ld/x86_aout.h 2009-02-19 11:37:10.000000000 +0100 +@@ -11,10 +11,11 @@ + /* If the host isn't an x86 all bets are off, use chars. */ + #if defined(i386) || defined(__BCC__) || defined(MSDOS) + typedef long Long; +-#define __OUT_OK 1 + #else +-typedef char Long[4]; ++#include <stdint.h> ++typedef int32_t Long; + #endif ++#define __OUT_OK 1 + + struct exec { /* a.out header */ + unsigned char a_magic[2]; /* magic number */ diff --git a/main/dev86/dev86-noelks.patch b/main/dev86/dev86-noelks.patch new file mode 100644 index 0000000000..9fd46e9577 --- /dev/null +++ b/main/dev86/dev86-noelks.patch @@ -0,0 +1,15 @@ +--- dev86-0.16.17/makefile.in.noelks 2006-01-25 17:03:02.000000000 -0500 ++++ dev86-0.16.17/makefile.in 2006-01-25 17:03:19.000000000 -0500 +@@ -89,10 +89,10 @@ + + #ifdef GNUMAKE + all: check_config bcc86 cpp unproto copt as86 ar86 ld86 objdump86 \ +- library lib-bsd alt-libs elksemu ++ library lib-bsd alt-libs + + install: check_config install-bcc install-man \ +- install-lib install-emu ++ install-lib + + install-all: install install-other + diff --git a/main/dev86/dev86-overflow.patch b/main/dev86/dev86-overflow.patch new file mode 100644 index 0000000000..7b2e5666f1 --- /dev/null +++ b/main/dev86/dev86-overflow.patch @@ -0,0 +1,24 @@ +diff -up dev86-0.16.17/bcc/bcc.c.overflow dev86-0.16.17/bcc/bcc.c +--- dev86-0.16.17/bcc/bcc.c.overflow 2005-01-03 23:41:55.000000000 +0100 ++++ dev86-0.16.17/bcc/bcc.c 2009-02-19 10:49:32.000000000 +0100 +@@ -16,6 +16,7 @@ + * -M0 A framework for the -B option. + */ + #include <stdio.h> ++#include <limits.h> + #ifdef __STDC__ + #include <stdlib.h> + #ifndef MSDOS +@@ -1308,11 +1309,7 @@ void reset_prefix_path() + + for(d=s=ptr; d && *s; s=d) + { +-#ifdef MAXPATHLEN +- char buf[MAXPATHLEN]; +-#else +- char buf[1024]; +-#endif ++ char buf[PATH_MAX]; + + free(temp); + d=strchr(s, ':'); diff --git a/main/dev86/dev86-pic.patch b/main/dev86/dev86-pic.patch new file mode 100644 index 0000000000..41076f3dae --- /dev/null +++ b/main/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 diff --git a/main/dev86/dev86-print-overflow.patch b/main/dev86/dev86-print-overflow.patch new file mode 100644 index 0000000000..c75e18c9bb --- /dev/null +++ b/main/dev86/dev86-print-overflow.patch @@ -0,0 +1,27 @@ +From: Lubomir Rintel <lkundrak@v3.sk> + +There are off-by-one errors when filling the ar headers, the trailing nul +would overflow the target buffer. + +diff -urp dev86-0.16.17/ld/mkar.c dev86-0.16.17.fixed/ld/mkar.c +--- dev86-0.16.17/ld/mkar.c 2004-06-20 09:23:27.000000000 +0200 ++++ dev86-0.16.17.fixed/ld/mkar.c 2010-03-29 23:34:30.351426404 +0200 +@@ -51,12 +51,12 @@ char buf[128]; + memset(&arbuf, ' ', sizeof(arbuf)); + strcpy(buf, ptr); strcat(buf, "/ "); + strncpy(arbuf.ar_name, buf, sizeof(arbuf.ar_name)); +- +- sprintf(arbuf.ar_date, "%-12ld", (long)st.st_mtime); +- sprintf(arbuf.ar_uid, "%-6d", (int)(st.st_uid%1000000L)); +- sprintf(arbuf.ar_gid, "%-6d", (int)(st.st_gid%1000000L)); +- sprintf(arbuf.ar_mode, "%-8lo", (long)st.st_mode); +- sprintf(arbuf.ar_size, "%-10ld", (long)st.st_size); ++ ++ snprintf(arbuf.ar_date, 12, "%-12ld", (long)st.st_mtime); ++ snprintf(arbuf.ar_uid, 6, "%-6d", (int)(st.st_uid%1000000L)); ++ snprintf(arbuf.ar_gid, 6, "%-6d", (int)(st.st_gid%1000000L)); ++ snprintf(arbuf.ar_mode, 8, "%-8lo", (long)st.st_mode); ++ snprintf(arbuf.ar_size, 10, "%-10ld", (long)st.st_size); + memcpy(arbuf.ar_fmag, ARFMAG, sizeof(arbuf.ar_fmag)); + + if( fwrite(&arbuf, 1, sizeof(arbuf), fd) != sizeof(arbuf) ) |