dev86: update to 0.16.18 and make it build on x86_64 FINALLY!

This commit is contained in:
Juan RP 2010-12-22 13:45:38 +01:00
parent 9ed593871e
commit 01d0b9ae52
7 changed files with 120 additions and 37 deletions

View File

@ -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 */

View File

@ -0,0 +1,26 @@
--- orig/makefile.in 2010-12-22 12:56:31.610881756 +0100
+++ new/makefile.in 2010-12-22 12:57:12.344232346 +0100
@@ -89,10 +89,10 @@ EXE=
#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
@@ -123,10 +123,6 @@ INCLDIR= %INCLDIR%
ASLDDIR= %ASLDDIR%
MANDIR= %MANDIR%
-#ifdef GNUMAKE
-export ELKSSRC
-#endif
-
DISTBIN= $(DIST)$(BINDIR)
DISTLIB= $(DIST)$(LIBDIR)
DISTASLD=$(DIST)$(ASLDDIR)

View File

@ -0,0 +1,11 @@
--- dev86-0.16.17/makefile.in.nostrip 2007-01-30 14:28:38.000000000 +0100
+++ dev86-0.16.17/makefile.in 2007-01-30 14:40:56.000000000 +0100
@@ -78,7 +78,7 @@
# Install files with the userid of the currently running process.
INDAT=-m 644
-INEXE=-m 755 -s
+INEXE=-m 755
INSCR=-m 755
#ifdef __CYGWIN__

View File

@ -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, ':');

View File

@ -1,20 +0,0 @@
--- 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

View File

@ -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) )

View File

@ -1,36 +1,34 @@
# Template file for 'dev86'
pkgname=dev86
version=0.16.17
version=0.16.18
patch_args="-Np1"
distfiles="http://www.debath.co.uk/dev86/Dev86src-$version.tar.gz"
build_style=gnu_makefile
make_build_args="PREFIX=/usr DIST=$XBPS_DESTDIR/$pkgname-$version"
make_install_target="DIST=$XBPS_DESTDIR/$pkgname-$version install-all"
build_style=custom-install
short_desc="8086 cross development compiler, assembler and linker"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=52ed4980c0e4b68d2624aadb0ceb0339cb3fd8dd7c2175419d4f77a451846cbe
checksum=049852a83898d3ee0ba97b88e526897ec6eaf0a051f4af1e9e073b1151178ff1
long_desc="
This package provides a cross development C compiler, assembler and linker
environment for the production of 8086 executables (Optionally MSDOS COM)."
nostrip=yes
disable_parallel_build=yes
Add_dependency run glibc
Add_dependency build bin86
Add_dependency full bin86
pre_build()
do_build()
{
if [ "${xbps_machine}" = "x86_64" ]; then
sed -i -e 's,alt-libs elksemu,alt-libs,' \
-e 's,install-lib install-emu,install-lib,' \
${wrksrc}/makefile.in
fi
for f in libc/bcc libc/misc libc/msdos libc/string libc/syscall \
libc/bios; do
sed -i -e "s|\$(CCFLAGS) ||g" ${wrksrc}/${f}/Makefile
done
make DIST=${DESTDIR}
}
post_install()
do_install()
{
install -d ${DESTDIR}/usr/share
mv ${DESTDIR}/usr/man ${DESTDIR}/usr/share
make DIST=${DESTDIR} MANDIR=/usr/share/man \
install install-man
# Remove stuff supplied by bin86
rm -f ${DESTDIR}/usr/bin/{as,ld,nm,objdump,size}86
rm -f ${DESTDIR}/usr/share/man/man1/{as,ld}86.1