diff --git a/.gitignore b/.gitignore index e69de29..29e2564 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/64tass-1.50.486.zip diff --git a/64tass-1.50.486-ptrcast.patch b/64tass-1.50.486-ptrcast.patch new file mode 100644 index 0000000..6295aaa --- /dev/null +++ b/64tass-1.50.486-ptrcast.patch @@ -0,0 +1,12 @@ +diff -up 64tass-1.50.486/obj.c.ptrcast 64tass-1.50.486/obj.c +--- 64tass-1.50.486/obj.c.ptrcast 2013-06-11 17:02:49.075972646 -0600 ++++ 64tass-1.50.486/obj.c 2013-06-11 17:03:25.127641322 -0600 +@@ -129,7 +129,7 @@ static int invalid_hash(const struct val + } + + static int gap_hash(const struct value_s *UNUSED(v1), struct value_s *UNUSED(v), linepos_t UNUSED(epoint)) { +- return (unsigned int)GAP_OBJ & ((~(unsigned int)0) >> 1); ++ return (intptr_t)GAP_OBJ & ((~(intptr_t)0) >> 1); + } + + static void invalid_convert(struct value_s *v1, struct value_s *v, obj_t UNUSED(t), linepos_t epoint, linepos_t UNUSED(epoint2)) { diff --git a/64tass-1.50.486-sizet.patch b/64tass-1.50.486-sizet.patch new file mode 100644 index 0000000..e9f556d --- /dev/null +++ b/64tass-1.50.486-sizet.patch @@ -0,0 +1,57 @@ +diff -up 64tass-1.50.486/misc.c.sizet 64tass-1.50.486/misc.c +--- 64tass-1.50.486/misc.c.sizet 2013-06-11 17:00:35.876501904 -0600 ++++ 64tass-1.50.486/misc.c 2013-06-11 17:02:16.489368315 -0600 +@@ -241,28 +241,28 @@ static void labelprint2(const struct avl + case D_BYTE: + fputs(" byte", flab); + if (l->value->u.code.size > 1) { +- fprintf(flab, " %x", l->value->u.code.size); ++ fprintf(flab, " %zx", l->value->u.code.size); + } + break; + case D_INT: + case D_WORD: + fputs(" word", flab); + if (l->value->u.code.size > 2) { +- fprintf(flab, " %x", l->value->u.code.size); ++ fprintf(flab, " %zx", l->value->u.code.size); + } + break; + case D_LINT: + case D_LONG: + fputs(" long", flab); + if (l->value->u.code.size > 3) { +- fprintf(flab, " %x", l->value->u.code.size); ++ fprintf(flab, " %zx", l->value->u.code.size); + } + break; + case D_DINT: + case D_DWORD: + fputs(" dword", flab); + if (l->value->u.code.size > 4) { +- fprintf(flab, " %x", l->value->u.code.size); ++ fprintf(flab, " %zx", l->value->u.code.size); + } + break; + case D_NONE: +diff -up 64tass-1.50.486/section.c.sizet 64tass-1.50.486/section.c +--- 64tass-1.50.486/section.c.sizet 2013-06-11 17:00:30.438400433 -0600 ++++ 64tass-1.50.486/section.c 2013-06-11 17:01:27.084451753 -0600 +@@ -151,7 +151,7 @@ void sectionprint(void) { + l = &root_section; + if (l->size) { + sprintf(temp, "$%04" PRIaddress, l->start); +- sprintf(temp2, "$%04" PRIaddress, l->start + l->size - 1); ++ sprintf(temp2, "$%04zx", l->start + l->size - 1); + printf("Section: %7s-%-7s\n", temp, temp2); + } + memprint(&l->mem); +@@ -160,7 +160,7 @@ void sectionprint(void) { + if (l->defpass == pass) { + if (l->size) { + sprintf(temp, "$%04" PRIaddress, l->start); +- sprintf(temp2, "$%04" PRIaddress, l->start + l->size - 1); ++ sprintf(temp2, "$%04zx", l->start + l->size - 1); + printf("Section: %7s-%-7s ", temp, temp2); + } else { + printf("Section: "); diff --git a/64tass.spec b/64tass.spec new file mode 100644 index 0000000..edc2f61 --- /dev/null +++ b/64tass.spec @@ -0,0 +1,61 @@ +Name: 64tass +Version: 1.50.486 +Release: 1%{?dist} +Summary: 6502 assembler +Group: Development/Languages +License: GPLv2+ +URL: http://tass64.sourceforge.net/ +BuildRequires: w3m + +# The following would meet the Fedora Packaging Guidelines for Source URLs +# for SourceForge, but it doesn't actually work! Despite the "/source/" in +# the path, it actually gets the *binary* release ZIP archives. This may have +# something to do with the fact that the source and binary release ZIP +# archives have the same name. I've requested that upstream start putting +# "-source" or "-src" in the names of the source archives, which hopefully +# would fix this problem. +# https://sourceforge.net/p/tass64/bugs/13/ +#Source0: http://downloads.sourceforge.net/tass64/source/%{name}-%{version}.zip + +Source0: http://sourceforge.net/projects/tass64/files/source/%{name}-%{version}.zip + +# Fix problem with printf conversions of size_t. Reported upstream with +# proposed patch: +# https://sourceforge.net/p/tass64/bugs/14/ +Patch0: 64tass-1.50.486-sizet.patch + +# Fix problem with cast of pointer to int. Reported upstream with +# proposed patch: +# https://sourceforge.net/p/tass64/bugs/15/ +Patch1: 64tass-1.50.486-ptrcast.patch + +%description +64tass is a multi-pass optimizing macro assembler for the 65xx series of +processors. It supports the 6502, 65C02, R65C02, W65C02, 65CE02, 65816, +DTV, and 65EL02, using a syntax similar to that of Omicron TASS and TASM. + +%prep +%setup -q +%patch -P 0 -p1 -b .sizet +%patch -P 1 -p1 -b .ptrcast +rm README # will be built + +%build +make %{?_smp_mflags} CFLAGS="%{optflags}" + +%install + +# install binaries +install -d %{buildroot}%{_bindir}/ +install -m 755 64tass %{buildroot}%{_bindir}/ + +%files +%{_bindir}/64tass +%doc README README.html +%doc LICENSE-GPL-2.0 +%doc LICENSE-LGPL-2.0 LICENSE-LGPL-2.1 +%doc LICENSE-my_getopt + +%changelog +* Tue Jun 11 2013 Eric Smith 1.50.486-1 +- Initial version diff --git a/sources b/sources index e69de29..337dfaf 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +3f2e6a68123d0d8b786cc5f19d115003 64tass-1.50.486.zip