diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-12-17 01:08:19 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-12-17 01:08:19 +0000 |
commit | 9b05da29e3e9f264cbcd3d78623e5571ef959026 (patch) | |
tree | e44f62273e6b87f4b17aae75cf19cdb34ee1eab3 /dev-lang/nasm | |
parent | version bump (diff) | |
download | historical-9b05da29e3e9f264cbcd3d78623e5571ef959026.tar.gz historical-9b05da29e3e9f264cbcd3d78623e5571ef959026.tar.bz2 historical-9b05da29e3e9f264cbcd3d78623e5571ef959026.zip |
Add support for ELF visibility markings.
Package-Manager: portage-2.0.53
Diffstat (limited to 'dev-lang/nasm')
-rw-r--r-- | dev-lang/nasm/ChangeLog | 10 | ||||
-rw-r--r-- | dev-lang/nasm/Manifest | 11 | ||||
-rw-r--r-- | dev-lang/nasm/files/digest-nasm-0.98.39-r2 | 1 | ||||
-rw-r--r-- | dev-lang/nasm/files/nasm-0.98.39-elf-visibility.patch | 106 | ||||
-rw-r--r-- | dev-lang/nasm/nasm-0.98.39-r2.ebuild | 66 |
5 files changed, 188 insertions, 6 deletions
diff --git a/dev-lang/nasm/ChangeLog b/dev-lang/nasm/ChangeLog index c320a0097af8..bcb4adb40b32 100644 --- a/dev-lang/nasm/ChangeLog +++ b/dev-lang/nasm/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-lang/nasm -# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/nasm/ChangeLog,v 1.37 2005/05/17 22:56:40 mr_bones_ Exp $ +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/nasm/ChangeLog,v 1.38 2005/12/17 01:08:18 vapier Exp $ + +*nasm-0.98.39-r2 (17 Dec 2005) + + 17 Dec 2005; Mike Frysinger <vapier@gentoo.org> + +files/nasm-0.98.39-elf-visibility.patch, +nasm-0.98.39-r2.ebuild: + Add support for ELF visibility markings. *nasm-0.98.39-r1 (17 May 2005) diff --git a/dev-lang/nasm/Manifest b/dev-lang/nasm/Manifest index 28a7ac4ea450..4c5ea99b1975 100644 --- a/dev-lang/nasm/Manifest +++ b/dev-lang/nasm/Manifest @@ -1,14 +1,17 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -MD5 25059d6a70ecffe93252996d18650d45 ChangeLog 5360 +MD5 9a65245dbc1043b4515ce4509d393a21 ChangeLog 5552 MD5 98c253856c4823fdfe9095d900744ff6 files/digest-nasm-0.98.39-r1 65 +MD5 98c253856c4823fdfe9095d900744ff6 files/digest-nasm-0.98.39-r2 65 +MD5 36f21b0b4be51fba4321ed1bdc9a9ba9 files/nasm-0.98.39-elf-visibility.patch 4261 MD5 8524fffd916a234a0fa40149506746ee metadata.xml 738 MD5 3300e0a51446776ab370d1c2f855d883 nasm-0.98.39-r1.ebuild 1472 +MD5 a7049de2fd13f498b77cbdd25e3973f3 nasm-0.98.39-r2.ebuild 1529 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) -iD8DBQFDi9CugIKl8Uu19MoRAm/EAJwIYD1M6sUt2tEaMac0ObYwQhfMUACdGCQD -KeJnvaj9vftdRsxomm2PcRM= -=cKcU +iD8DBQFDo2Ug2+ySkm8kpY0RAmzoAJ9liYEUKE+E/edrv0x2OuIq5gBiIACcCS7e +r5wR1uSIA42cyJtytnqUbJc= +=x6M1 -----END PGP SIGNATURE----- diff --git a/dev-lang/nasm/files/digest-nasm-0.98.39-r2 b/dev-lang/nasm/files/digest-nasm-0.98.39-r2 new file mode 100644 index 000000000000..6e9a89fbc65a --- /dev/null +++ b/dev-lang/nasm/files/digest-nasm-0.98.39-r2 @@ -0,0 +1 @@ +MD5 2032ad44c7359f7a9a166a40a633e772 nasm-0.98.39.tar.bz2 543976 diff --git a/dev-lang/nasm/files/nasm-0.98.39-elf-visibility.patch b/dev-lang/nasm/files/nasm-0.98.39-elf-visibility.patch new file mode 100644 index 000000000000..9065f9f193db --- /dev/null +++ b/dev-lang/nasm/files/nasm-0.98.39-elf-visibility.patch @@ -0,0 +1,106 @@ +Add support for declaring elf visibility attributes. Used to +help cleanup TEXTRELs in misc libraries (like libsdl). + +Syntax to declare function foo hidden: +GLOBAL foo:function:hidden + +Patch by Mike Frysinger <vapier@gentoo.org> + +http://sourceforge.net/mailarchive/forum.php?thread_id=9230919&forum_id=4978 + +--- nasm/output/outelf.c ++++ nasm/output/outelf.c +@@ -50,6 +50,7 @@ struct Symbol { + long strpos; /* string table position of name */ + long section; /* section ID of the symbol */ + int type; /* symbol type */ ++ int other; /* symbol visibility */ + long value; /* address, or COMMON variable align */ + long size; /* size of symbol */ + long globnum; /* symbol table offset if global */ +@@ -113,9 +114,15 @@ extern struct ofmt of_elf; + + #define SYM_SECTION 0x04 + #define SYM_GLOBAL 0x10 ++#define SYM_NOTYPE 0x00 + #define SYM_DATA 0x01 + #define SYM_FUNCTION 0x02 + ++#define STV_DEFAULT 0 ++#define STV_INTERNAL 1 ++#define STV_HIDDEN 2 ++#define STV_PROTECTED 3 ++ + #define GLOBAL_TEMP_BASE 16 /* bigger than any constant sym id */ + + #define SEG_ALIGN 16 /* alignment of sections in file */ +@@ -493,6 +500,7 @@ static void elf_deflabel(char *name, lon + + sym->strpos = pos; + sym->type = is_global ? SYM_GLOBAL : 0; ++ sym->other = STV_DEFAULT; + sym->size = 0; + if (segment == NO_SEG) + sym->section = SHN_ABS; +@@ -571,16 +579,40 @@ static void elf_deflabel(char *name, lon + sects[sym->section - 1]->gsyms = sym; + + if (special) { +- int n = strcspn(special, " "); ++ char *visibility = NULL; ++ int n; ++ n = strcspn(special, ":"); ++ if (special[n]) { ++ visibility = special + n + 1; ++ } else ++ n = strcspn(special, " "); + + if (!nasm_strnicmp(special, "function", n)) + sym->type |= SYM_FUNCTION; + else if (!nasm_strnicmp(special, "data", n) || + !nasm_strnicmp(special, "object", n)) + sym->type |= SYM_DATA; ++ else if (!nasm_strnicmp(special, "notype", n)) ++ sym->type |= SYM_NOTYPE; + else + error(ERR_NONFATAL, "unrecognised symbol type `%.*s'", + n, special); ++ if (visibility) { ++ n = strcspn(visibility, " "); ++ if (!nasm_strnicmp(visibility, "default", n)) ++ sym->other = STV_DEFAULT; ++ else if (!nasm_strnicmp(visibility, "internal", n)) ++ sym->other = STV_INTERNAL; ++ else if (!nasm_strnicmp(visibility, "hidden", n)) ++ sym->other = STV_HIDDEN; ++ else if (!nasm_strnicmp(visibility, "protected", n)) ++ sym->other = STV_PROTECTED; ++ else ++ error(ERR_NONFATAL, "unrecognised symbol type `%.*s'", ++ n, visibility); ++ n = strcspn(special, " "); ++ } ++ + if (special[n]) { + struct tokenval tokval; + expr *e; +@@ -1120,7 +1152,8 @@ static struct SAA *elf_build_symtab(long + WRITELONG(p, sym->strpos); + WRITELONG(p, sym->value); + WRITELONG(p, sym->size); +- WRITESHORT(p, sym->type); /* local non-typed thing */ ++ WRITECHAR(p, sym->type); /* local non-typed thing */ ++ WRITECHAR(p, sym->other); + WRITESHORT(p, sym->section); + saa_wbytes(s, entry, 16L); + *len += 16; +@@ -1138,7 +1171,8 @@ static struct SAA *elf_build_symtab(long + WRITELONG(p, sym->strpos); + WRITELONG(p, sym->value); + WRITELONG(p, sym->size); +- WRITESHORT(p, sym->type); /* global non-typed thing */ ++ WRITECHAR(p, sym->type); /* global non-typed thing */ ++ WRITECHAR(p, sym->other); + WRITESHORT(p, sym->section); + saa_wbytes(s, entry, 16L); + *len += 16; diff --git a/dev-lang/nasm/nasm-0.98.39-r2.ebuild b/dev-lang/nasm/nasm-0.98.39-r2.ebuild new file mode 100644 index 000000000000..fd7486bc4e93 --- /dev/null +++ b/dev-lang/nasm/nasm-0.98.39-r2.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/nasm/nasm-0.98.39-r2.ebuild,v 1.1 2005/12/17 01:08:18 vapier Exp $ + +inherit eutils toolchain-funcs + +DESCRIPTION="groovy little assembler" +HOMEPAGE="http://nasm.sourceforge.net/" +SRC_URI="mirror://sourceforge/nasm/${P}.tar.bz2" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86" +IUSE="doc build" + +DEPEND="!build? ( dev-lang/perl ) + doc? ( virtual/ghostscript sys-apps/texinfo )" +RDEPEND="" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-elf-visibility.patch + if [ "$(gcc-major-version)" -eq "2" ] ; then + sed -i \ + -e 's:-std=c99::g' \ + configure \ + || die "sed failed" + fi + #security fix for bug #92991 + sed -i \ + -e '/vsprintf/c\ vsnprintf(buffer, sizeof(buffer), format, ap); + ' output/outieee.c \ + || die "sed failed" +} + +src_compile() { + econf || die + + if use build; then + emake nasm || die "emake failed" + else + emake all || die "emake failed" + emake rdf || die "emake failed" + if use doc ; then + emake doc || die "emake failed" + fi + fi +} + +src_install() { + if use build; then + dobin nasm || die "dobin failed" + else + dobin nasm ndisasm rdoff/{ldrdf,rdf2bin,rdf2ihx,rdfdump,rdflib,rdx} \ + || die "dobin failed" + dosym /usr/bin/rdf2bin /usr/bin/rdf2com + doman nasm.1 ndisasm.1 + dodoc AUTHORS CHANGES ChangeLog INSTALL README TODO + if use doc; then + doinfo doc/info/* + dohtml doc/html/* + dodoc doc/nasmdoc.* + fi + fi +} |