--- intel2gas-1.3.3.orig/Makefile.in +++ intel2gas-1.3.3/Makefile.in @@ -1,7 +1,7 @@ # intel2gas 1.3.3 (c)1999 Mikko Tiihonen (mikko.tiihonen@hut.fi) # Makefile by brn (c.nentwich@cs.ucl.ac.uk) -CXX = g++ +CXX = @CXX@ # CXXFLAGS = -O6 -mpentium -malign-jumps=2 -malign-functions=2 -malign-loops=2 # Just kidding :) @@ -21,7 +21,7 @@ @echo "Building intel2gas.. This might take a while!" intel2gas: $(OFILES) - $(CXX) $(OFILES) -o $@ + $(CXX) $(LDFLAGS) $(OFILES) -o $@ @echo "Then again... it might not." # I hope this is allowed @@ -45,7 +45,7 @@ cp -a $$datadir/* $(data_prefix)/$$datadir; \ done install -m 755 -d $(prefix)/bin - install -s -m 755 intel2gas $(prefix)/bin + install $(INSTALL_OPTS) -m 755 intel2gas $(prefix)/bin uninstall: for datadir in $(DATADIRS); do \ --- intel2gas-1.3.3.orig/configure +++ intel2gas-1.3.3/configure @@ -524,7 +524,7 @@ -for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl +for ac_prog in $CCC "${host}-c++" "${host}-g++" "${host}-gcc" "${host}-CC" "${host}-cxx" "${host}-cc++" "${host}-cl" c++ g++ gcc CC cxx cc++ cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 --- intel2gas-1.3.3.orig/debian/changelog +++ intel2gas-1.3.3/debian/changelog @@ -0,0 +1,134 @@ +intel2gas (1.3.3-20) unstable; urgency=high + + * adjust control for dpkg rootless (closes: #1089347) + + -- Alexander Zangerl Sun, 08 Dec 2024 11:20:20 +1000 + +intel2gas (1.3.3-19) unstable; urgency=medium + + * adjust build a bit more for cross compilation (closes: #1033053) + + -- Alexander Zangerl Tue, 21 Mar 2023 17:12:44 +1000 + +intel2gas (1.3.3-18) unstable; urgency=medium + + * adjust build for cross compilation (closes: #1032653) + + -- Alexander Zangerl Thu, 16 Mar 2023 10:46:41 +1000 + +intel2gas (1.3.3-17) unstable; urgency=low + + * lifted standards version + * watch file removed, ditto homepage field - upstream website has gone away + + -- Alexander Zangerl Sun, 14 Jan 2018 12:57:34 +1000 + +intel2gas (1.3.3-16) unstable; urgency=low + + * lifted standards version, adjusted build rules for reproducible build + + -- Alexander Zangerl Thu, 05 Feb 2015 22:42:59 +1000 + +intel2gas (1.3.3-15) unstable; urgency=low + + * lifted standards version + * added hardening build flags + + -- Alexander Zangerl Tue, 24 Sep 2013 13:13:09 +1000 + +intel2gas (1.3.3-14) unstable; urgency=low + + * lifted standards version + * applied patches by Erik Miller for 64-bit registers + and Kai Henningsen for some three-operand instructions + (LP: #87784) + + -- Alexander Zangerl Thu, 03 Nov 2011 11:38:53 +1000 + +intel2gas (1.3.3-13) unstable; urgency=low + + * placate g++ which dislikes converting const char * to char * + (closes: #560478) + * cleaned up rules, lifted standards version + + -- Alexander Zangerl Sat, 12 Dec 2009 13:48:32 +1000 + +intel2gas (1.3.3-12) unstable; urgency=low + + * another bashism removed (closes: #478406) + + -- Alexander Zangerl Tue, 29 Apr 2008 11:46:47 +1000 + +intel2gas (1.3.3-11) unstable; urgency=low + + * removed bashism from rules so that building + with a posix-only shell works (closes: #459087) + + -- Alexander Zangerl Sun, 6 Jan 2008 16:04:51 +1000 + +intel2gas (1.3.3-10) unstable; urgency=low + + * fixed handling of nostrip and noopt build options (closes: #437209) + + -- Alexander Zangerl Sat, 11 Aug 2007 11:47:23 +1000 + +intel2gas (1.3.3-9) unstable; urgency=low + + * lifted standards version + + -- Alexander Zangerl Tue, 10 Apr 2007 18:33:34 +1000 + +intel2gas (1.3.3-8) unstable; urgency=low + + * fixed bashism in uid-0 check (closes: #381531) + + -- Alexander Zangerl Mon, 7 Aug 2006 21:58:56 +1000 + +intel2gas (1.3.3-7) unstable; urgency=low + + * rebuild with gcc4.0 (closes: #321181) + * lifted standards version, updated watch file + + -- Alexander Zangerl Sat, 6 Aug 2005 19:07:29 +1000 + +intel2gas (1.3.3-6) unstable; urgency=low + + * disabled a horrible useless piece of code that + made gcc on amd64 barf (closes: #286434) + + -- Alexander Zangerl Thu, 23 Dec 2004 19:38:47 +1000 + +intel2gas (1.3.3-5) unstable; urgency=low + + * standards version lifted + * rebuilt with gcc3.3 (closes: #221371) + * added homepage + + -- Alexander Zangerl Thu, 11 Dec 2003 12:04:15 +1000 + +intel2gas (1.3.3-4) unstable; urgency=low + + * standards version lifted. + + -- Alexander Zangerl Sun, 9 Mar 2003 11:13:43 +1000 + +intel2gas (1.3.3-3) unstable; urgency=low + + * removed /usr/doc transition stuff + + -- Alexander Zangerl Fri, 3 Jan 2003 15:54:49 +1000 + +intel2gas (1.3.3-2) unstable; urgency=low + + * fixed permission problem inherited from upstream release + * initial upload. closes: bug#106135 + + -- Alexander Zangerl Wed, 30 Jan 2002 23:52:27 +1000 + +intel2gas (1.3.3-1) unstable; urgency=low + + * Initial release. + + -- Alexander Zangerl Thu, 6 Dec 2001 22:31:30 +1000 + + --- intel2gas-1.3.3.orig/debian/control +++ intel2gas-1.3.3/debian/control @@ -0,0 +1,16 @@ +Source: intel2gas +Section: devel +Priority: optional +Maintainer: Alexander Zangerl +Standards-Version: 4.1.3.0 +Rules-Requires-Root: binary-targets + +Package: intel2gas +Architecture: any +Depends: ${shlibs:Depends} +Description: converter from NASM assembly language to GAS + Intel2GAS is a converter that will convert assembler source files + written for NASM to files that can be assembled using the + GNU Assembler (GAS), on the i386 platform. It provides support for basic + MMX instructions as well. + --- intel2gas-1.3.3.orig/debian/copyright +++ intel2gas-1.3.3/debian/copyright @@ -0,0 +1,18 @@ +This package was debianized by Alexander Zangerl on +Thu, 6 Dec 2001 22:31:30 +1000. + +It was downloaded from http://www.niksula.cs.hut.fi/~mtiihone/intel2gas/ + +The upstream author is Mikko Tiihonen + +"Copyright 1999 Mikko Tiihonen (mikko.tiihonen@hut.fi) + +This program converts assembler source from Intel (NASM), to AT&T (gas) +syntax. It is FREE SOFTWARE under the terms of the GNU General Public +License (GPL), enclosed in the file 'COPYING'." + +A copy of the GPL is available in /usr/share/common-licenses/GPL. + + + + --- intel2gas-1.3.3.orig/debian/intel2gas.man +++ intel2gas-1.3.3/debian/intel2gas.man @@ -0,0 +1,63 @@ +.TH INTEL2GAS 1 +.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection +.\" other parms are allowed: see man(7), man(1) +.SH NAME +intel2gas \- convert between NASM assembly and GAS assembly language +.SH SYNOPSIS +.B intel2gas +.I "[-higmtcIdV] [-o outfile] [infile]" +.br +.SH "DESCRIPTION" +This manual page documents briefly the +.BR intel2gas +command. +This manual page was written for the Debian GNU/Linux distribution +because the original program does not have a manual page. +.PP +.B intel2gas +is a small text parser that can convert assembler source written in NASM +syntax to gas syntax. And nowadays more often also the other way. +.SH OPTIONS +.TP +.B \-h +Show summary of options. +.TP +.B \-i +convert from intel to at&t format (default) +.TP +.B \-g +convert from at&t to intel format +.TP +.B \-m +convert from masm to at&t format +.TP +.B \-t +convert from tasm to at&t format +.TP +.B \-c +understand C style comments +.TP +.B \-I +convert inline assembler (intel to at&t only) +.TP +.B \-d +output all % chars as %% +.TP +.B \-V +show version +.SH ENVIRONMENT +.TP +.B I2G_DATA +should indicate the location of the syntax files if they are not installed +in the default location. The value should be a path to the directory with +the subdirectories g2i, i2g and m2g. +.SH FILES +.TP +.B /usr/share/intel2gas/{g2i,i2g,m2g}/* +syntaxfiles for the translation. +.SH "SEE ALSO" +There is some other documentation available in the files README, INSTALL and DATAFILES which reside in /usr/share/doc/intel2gas. +.SH AUTHORS +The author of the program is Mikko Tiihonen . +This manual page was written by Alexander Zangerl , +for the Debian GNU/Linux system (but may be used by others). --- intel2gas-1.3.3.orig/debian/rules +++ intel2gas-1.3.3/debian/rules @@ -0,0 +1,76 @@ +#!/usr/bin/make -f +DOCDIR=debian/tmp/usr/share/doc/intel2gas + +include /usr/share/dpkg/architecture.mk +include /usr/share/dpkg/buildtools.mk + +CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) +CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) +CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) +LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) +CFLAGS += -O0 +CXXFLAGS += -O0 +else +CFLAGS += -O2 +CXXFLAGS += -O2 +endif + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_OPTS += -s +endif +INSTALL_OPTS += --strip-program=$(STRIP) + +BUILD_DATE := $(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p') + +build-arch: build +build-indep: build + +build: + if [ ! -f debian/rules ]; then echo "wrong dir!"; exit 1; fi + ./configure --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) + $(MAKE) CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" INSTALL_OPTS="$(INSTALL_OPTS)" + touch build + +clean: + if [ ! -f debian/rules ]; then echo "wrong dir!"; exit 1; fi + -rm -f build + [ ! -f Makefile ] || $(MAKE) distclean + -rm -rf debian/tmp debian/files* debian/substvars + +binary-indep: build + if [ ! -f debian/rules ]; then echo "wrong dir!"; exit 1; fi + if [ $$(id -u) != 0 ]; then echo "not root!"; exit 1; fi + +binary-arch: build + if [ ! -f debian/rules ]; then echo "wrong dir!"; exit 1; fi + if [ ! `id -ru` = 0 ]; then echo "not root!"; exit 1; fi + -rm -rf debian/tmp + install -d -m 755 -o root -g root debian/tmp debian/tmp/DEBIAN \ + $(DOCDIR) debian/tmp/usr/share/man/man1 + $(MAKE) install prefix=debian/tmp/usr INSTALL_OPTS="$(INSTALL_OPTS)" +# fix weird permissions inherited from upstream... + chmod -R 0644 debian/tmp/usr/share/intel2gas/*/* + install -p -o root -g root -m 644 debian/copyright README BUGS \ + DATAFILES TODO THANKS $(DOCDIR) + install -p -o root -g root -m 644 debian/changelog \ + $(DOCDIR)/changelog.Debian + install -p -o root -g root -m 644 ChangeLog $(DOCDIR)/changelog +# there is no proper manpage for intel2gas...i'll do a minimal one + install -p -o root -g root -m 644 debian/intel2gas.man debian/tmp/usr/share/man/man1/intel2gas.1 + gzip -9n debian/tmp/usr/share/man/man1/intel2gas.1 +# fixme: changelog and changelog.debian?? +# those two are bigger than 4k... + gzip -9n $(DOCDIR)/DATAFILES $(DOCDIR)/README $(DOCDIR)/changelog* + dpkg-shlibdeps intel2gas + dpkg-gencontrol -isp + + find debian/tmp -depth -newermt '$(BUILD_DATE)' -print0 | \ + xargs -0r touch --no-dereference --date='$(BUILD_DATE)' + + dpkg --build debian/tmp .. + +binary: binary-indep binary-arch + +.PHONY: binary binary-arch binary-indep clean --- intel2gas-1.3.3.orig/debian/source/format +++ intel2gas-1.3.3/debian/source/format @@ -0,0 +1 @@ +1.0 --- intel2gas-1.3.3.orig/g2i/reg.20.list +++ intel2gas-1.3.3/g2i/reg.20.list @@ -0,0 +1,15 @@ +# All 64 bit registers, that force the instruction to be expanded with 'q' +# The r-1 and r-2 are stored so previous 'register width' values in parse +# line can be accessed +@r-2= +@r-1= +@r=q +- +rax +rbx +rcx +rdx +rsi +rdi +rsp +rbp --- intel2gas-1.3.3.orig/i2g/reg.20.list +++ intel2gas-1.3.3/i2g/reg.20.list @@ -0,0 +1,15 @@ +# All 64 bit registers, that force the instruction to be expanded with 'q' +# The r-1 and r-2 are stored so previous 'register width' values in parse +# line can be accessed +@r-2= +@r-1= +@r=q +- +rax +rbx +rcx +rdx +rsi +rdi +rsp +rbp --- intel2gas-1.3.3.orig/intel2gas.cc +++ intel2gas-1.3.3/intel2gas.cc @@ -57,10 +57,17 @@ int counter = 0; char* prev = 0; while (l) { + +/* az: this is bloody ugly...i've got no idea what + proper purpose this could serve. no other code fragment + does anything special with the memory associated with a list's name. + disabled because of bug#286434 + if (int(l->name) > 0x10000000) { printf("Error %d, prev=%s\n", counter, prev); break; } +*/ if (!strcasecmp(name,l->name)) return l; counter++; @@ -446,7 +453,7 @@ { match.at = NULL; for (int c=0; c <@> 
] , 1 + <@>
] , 1 <@>
- <@> , 1 @@ -151,6 +151,18 @@ <@>$ - +# three op instructions + <@>, , + <@>$,%,% +- + <@>, , + <@>%,%,% +- + <@> [
] , , + <@>$,%,
+- + + # normal instructions <@>
] <@>
@@ -306,6 +318,14 @@ - +# some used prefixes +LOCK <@> +lock <@> +- +A16 <@> +addr16 <@> +- + # Some special directives BITS SKIPLINE --- intel2gas-1.3.3.orig/strhandle.cc +++ intel2gas-1.3.3/strhandle.cc @@ -24,7 +24,7 @@ /* Like str_cutat, but the beginning of str is copied to buffer at left */ char *str_splitat(char const * const str, char *left, char cut) { - char *pos = strchr(str,cut); + char *pos = (char *)strchr(str,cut); if (!pos) { strcpy(left,str); return NULL;