From f24e9fd957e164944f789078cce012f759d1607a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Wed, 29 Feb 2012 13:20:37 +0000 Subject: [PATCH] - rel 6 - build on x8664 - don't build elks on x664 (does not build) - fix various bugs (from FC) Changed files: bcc.spec -> 1.37 dev86-64bit.patch -> 1.1 dev86-long.patch -> 1.1 dev86-noelks.patch -> 1.1 dev86-nostrip.patch -> 1.1 dev86-print-overflow.patch -> 1.1 --- bcc.spec | 30 +++++++++++++++++++++++++----- dev86-64bit.patch | 20 ++++++++++++++++++++ dev86-long.patch | 17 +++++++++++++++++ dev86-noelks.patch | 15 +++++++++++++++ dev86-nostrip.patch | 11 +++++++++++ dev86-print-overflow.patch | 27 +++++++++++++++++++++++++++ 6 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 dev86-64bit.patch create mode 100644 dev86-long.patch create mode 100644 dev86-noelks.patch create mode 100644 dev86-nostrip.patch create mode 100644 dev86-print-overflow.patch diff --git a/bcc.spec b/bcc.spec index 1cd1914..c4a6172 100644 --- a/bcc.spec +++ b/bcc.spec @@ -2,7 +2,7 @@ Summary: Bruce's C compiler Summary(pl.UTF-8): Kompilator C Bruce'a Name: bcc Version: 0.16.17 -Release: 5 +Release: 6 License: GPL Group: Development/Languages Source0: http://homepage.ntlworld.com/robert.debath/dev86/Dev86src-%{version}.tar.gz @@ -12,9 +12,13 @@ Patch1: Dev86src-opt.patch Patch2: dev86-0.16.17-fortify.patch Patch3: dev86-pic.patch Patch4: dev86-0.16.17-make382.patch +Patch5: dev86-64bit.patch +Patch6: dev86-noelks.patch +Patch7: dev86-long.patch +Patch8: dev86-nostrip.patch +Patch9: dev86-print-overflow.patch URL: http://homepage.ntlworld.com/robert.debath/ Requires: bin86 -ExclusiveArch: %{ix86} BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) # don't try to strip Linux-8086 objects @@ -40,6 +44,13 @@ są odwzorowywane do jednego z innych typów całkowitych. %patch2 -p1 %patch3 -p0 %patch4 -p0 +%ifarch %{x8664} +%patch5 -p1 +%patch6 -p1 +%endif +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 mv -f bootblocks/README README.bootblocks mv -f copt/README README.copt @@ -59,7 +70,10 @@ quit rm -rf $RPM_BUILD_ROOT %{__make} -j1 install-all \ - DIST=$RPM_BUILD_ROOT + DIST=$RPM_BUILD_ROOT \ + LIBDIR=%{_libdir}/bcc \ + INCLDIR=%{_libdir}/bcc \ + LOCALPREFIX=%{_prefix} # FFU (dis88/Makefile is not ready) # MANDIR=%{_mandir} @@ -70,13 +84,17 @@ ln -sf objdump86 $RPM_BUILD_ROOT%{_bindir}/nm86 ln -sf objdump86 $RPM_BUILD_ROOT%{_bindir}/size86 # these are separated in bin86 package -rm -f $RPM_BUILD_ROOT%{_bindir}/{as86,ld86} -rm -f $RPM_BUILD_ROOT/usr/man/man1/{as,ld}86.1* +%{__rm} $RPM_BUILD_ROOT%{_bindir}/{as86,ld86} +%{__rm} $RPM_BUILD_ROOT/usr/man/man1/{as,ld}86.1* # move man pages where they belong install -d $RPM_BUILD_ROOT%{_mandir} mv -f $RPM_BUILD_ROOT/usr/man/* $RPM_BUILD_ROOT%{_mandir} +%ifnarch %{x8664} %{!?debug:strip -R .comment -R .note $RPM_BUILD_ROOT%{_bindir}/{ar86,bcc,elksemu,objdump86}} +%else +%{!?debug:strip -R .comment -R .note $RPM_BUILD_ROOT%{_bindir}/{ar86,bcc,objdump86}} +%endif %{!?debug:strip -R .comment -R .note $RPM_BUILD_ROOT%{_libdir}/bcc/{bcc*,copt,unproto}} %clean @@ -88,7 +106,9 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/ar86 %attr(755,root,root) %{_bindir}/bcc %attr(755,root,root) %{_bindir}/dis86 +%ifnarch %{x8664} %attr(755,root,root) %{_bindir}/elksemu +%endif %attr(755,root,root) %{_bindir}/makeboot %attr(755,root,root) %{_bindir}/nm86 %attr(755,root,root) %{_bindir}/objdump86 diff --git a/dev86-64bit.patch b/dev86-64bit.patch new file mode 100644 index 0000000..01fa549 --- /dev/null +++ b/dev86-64bit.patch @@ -0,0 +1,20 @@ +--- dev86-0.16.17/bcc/bcc.c.fix 2005-01-03 23:41:55.000000000 +0100 ++++ dev86-0.16.17/bcc/bcc.c 2006-12-27 16:32:57.000000000 +0100 +@@ -226,12 +226,12 @@ + + } else { + /* Relative paths to normal PREFIX directory */ +- default_include = build_libpath("-I", "/lib/bcc/include", ""); +- default_libdir = build_libpath("-L", "/lib/bcc", libdir_suffix); +- optim_rules = build_libpath("-d", "/lib/bcc", libdir_suffix); ++ default_include = build_libpath("-I", "/lib64/bcc/include", ""); ++ default_libdir = build_libpath("-L", "/lib64/bcc", libdir_suffix); ++ optim_rules = build_libpath("-d", "/lib64/bcc", libdir_suffix); + +- build_prefix("/lib/bcc", libdir_suffix, ""); +- build_prefix("/lib/bcc", "", ""); ++ build_prefix("/lib64/bcc", libdir_suffix, ""); ++ build_prefix("/lib64/bcc", "", ""); + } + + build_prefix("/bin", "", ""); diff --git a/dev86-long.patch b/dev86-long.patch new file mode 100644 index 0000000..34cde19 --- /dev/null +++ b/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 ++typedef int32_t Long; + #endif ++#define __OUT_OK 1 + + struct exec { /* a.out header */ + unsigned char a_magic[2]; /* magic number */ diff --git a/dev86-noelks.patch b/dev86-noelks.patch new file mode 100644 index 0000000..9fd46e9 --- /dev/null +++ b/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/dev86-nostrip.patch b/dev86-nostrip.patch new file mode 100644 index 0000000..b26169a --- /dev/null +++ b/dev86-nostrip.patch @@ -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__ diff --git a/dev86-print-overflow.patch b/dev86-print-overflow.patch new file mode 100644 index 0000000..c75e18c --- /dev/null +++ b/dev86-print-overflow.patch @@ -0,0 +1,27 @@ +From: Lubomir Rintel + +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) ) -- 2.43.0