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
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
%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
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}
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
%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
--- /dev/null
+--- 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", "", "");
--- /dev/null
+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 */
--- /dev/null
+--- 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
+
--- /dev/null
+--- 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__
--- /dev/null
+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) )