From 35cab5da415d99e17245e7cde6c263f9e05eb7a1 Mon Sep 17 00:00:00 2001 From: trungnt2910 <57174311+trungnt2910@users.noreply.github.com> Date: Sat, 25 Jan 2020 20:45:28 +0700 Subject: [PATCH] nasm: bump version to 2.14.02 (#4631) patch Makefile to replace -I with -iquote --- ...asm-2.12.02.recipe => nasm-2.14.02.recipe} | 40 +++++++++++------ dev-lang/nasm/patches/nasm-2.12.02.patchset | 43 ------------------ dev-lang/nasm/patches/nasm-2.14.02.patchset | 44 +++++++++++++++++++ 3 files changed, 71 insertions(+), 56 deletions(-) rename dev-lang/nasm/{nasm-2.12.02.recipe => nasm-2.14.02.recipe} (52%) delete mode 100644 dev-lang/nasm/patches/nasm-2.12.02.patchset create mode 100644 dev-lang/nasm/patches/nasm-2.14.02.patchset diff --git a/dev-lang/nasm/nasm-2.12.02.recipe b/dev-lang/nasm/nasm-2.14.02.recipe similarity index 52% rename from dev-lang/nasm/nasm-2.12.02.recipe rename to dev-lang/nasm/nasm-2.14.02.recipe index 9ca458c97..a7bc60dfb 100644 --- a/dev-lang/nasm/nasm-2.12.02.recipe +++ b/dev-lang/nasm/nasm-2.14.02.recipe @@ -1,37 +1,46 @@ -SUMMARY="The Nasm assembler" +SUMMARY="The NASM assembler" DESCRIPTION="The Netwide Assembler, NASM, is an 80x86 and x86-64 assembler \ -designed for portability and modularity. It supports a range of object file +designed for portability and modularity. It supports a range of object file \ formats, including Linux and *BSD a.out, ELF, COFF, Mach-O, Microsoft 16-bit \ OBJ, Win32 and Win64. It will also output plain binary files. Its syntax is \ designed to be simple and easy to understand, similar to Intel's but less \ complex. It supports all currently known x86 architectural extensions, and \ has strong support for macros." HOMEPAGE="https://www.nasm.us/" -COPYRIGHT="1996-2016 NASM Authors" +COPYRIGHT="1996-2018 The NASM Authors" LICENSE="BSD (2-clause)" REVISION="1" SOURCE_URI="https://www.nasm.us/pub/nasm/releasebuilds/$portVersion/nasm-$portVersion.tar.bz2" -CHECKSUM_SHA256="00b0891c678c065446ca59bcee64719d0096d54d6886e6e472aeee2e170ae324" +CHECKSUM_SHA256="34fd26c70a277a9fdd54cb5ecf389badedaf48047b269d1008fbc819b24e80bc" PATCHES="nasm-$portVersion.patchset" -ARCHITECTURES="x86_gcc2 x86 x86_64" +ARCHITECTURES="!x86_gcc2 ?x86 x86_64" +SECONDARY_ARCHITECTURES="x86" + +commandBinDir=$binDir +commandSuffix=$secondaryArchSuffix +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandSuffix= + commandBinDir=$prefix/bin +fi PROVIDES=" - nasm = $portVersion compat >= 1 - cmd:nasm = $portVersion compat >= 1 - cmd:ndisasm = $portVersion compat >= 1 + nasm$secondaryArchSuffix = $portVersion compat >= 1 + cmd:nasm$commandSuffix = $portVersion compat >= 1 + cmd:ndisasm$commandSuffix = $portVersion compat >= 1 " REQUIRES=" - haiku + haiku$secondaryArchSuffix " BUILD_REQUIRES=" - haiku_devel + haiku${secondaryArchSuffix}_devel " BUILD_PREREQUIRES=" cmd:awk - cmd:gcc - cmd:ld + cmd:find + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix cmd:make cmd:sed " @@ -40,9 +49,14 @@ TEST_REQUIRES=" cmd:perl " +defineDebugInfoPackage nasm$secondaryArchSuffix \ + $commandBinDir/nasm \ + $commandBinDir/ndisasm + BUILD() { - runConfigure ./configure + runConfigure --omit-dirs "binDir" ./configure \ + --bindir="$commandBinDir" make $jobArgs PERL=true } diff --git a/dev-lang/nasm/patches/nasm-2.12.02.patchset b/dev-lang/nasm/patches/nasm-2.12.02.patchset deleted file mode 100644 index d966363da..000000000 --- a/dev-lang/nasm/patches/nasm-2.12.02.patchset +++ /dev/null @@ -1,43 +0,0 @@ -From 4b8582300df1cd8107869ad5d4fca95132eac30b Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Thu, 10 Mar 2016 18:18:16 +0000 -Subject: gcc2 build fix - - -diff --git a/output/codeview.c b/output/codeview.c -index 3526bd4..e9b0b91 100644 ---- a/output/codeview.c -+++ b/output/codeview.c -@@ -447,16 +447,18 @@ static void register_reloc(struct coff_Section *const sect, - r->type = type; - - r->symbol = 0; -- for (int i = 0; i < coff_nsects; i++) { -+{ int i; -+ for (i = 0; i < coff_nsects; i++) { - sec = coff_sects[i]; - if (!strcmp(sym, sec->name)) { - return; - } - r->symbol += 2; - } -- -+} - saa_rewind(coff_syms); -- for (uint32_t i = 0; i < coff_nsyms; i++) { -+{ uint32_t i; -+ for (i = 0; i < coff_nsyms; i++) { - struct coff_Symbol *s = saa_rstruct(coff_syms); - r->symbol++; - if (s->strpos == -1 && !strcmp(sym, s->name)) { -@@ -474,6 +476,7 @@ static void register_reloc(struct coff_Section *const sect, - return; - } - } -+} - nasm_panic(0, "codeview: relocation for unregistered symbol: %s", sym); - } - --- -2.19.0 - diff --git a/dev-lang/nasm/patches/nasm-2.14.02.patchset b/dev-lang/nasm/patches/nasm-2.14.02.patchset new file mode 100644 index 000000000..d9c8199a7 --- /dev/null +++ b/dev-lang/nasm/patches/nasm-2.14.02.patchset @@ -0,0 +1,44 @@ +From 8636b3a4a54d00d4a45d61bdaffb31dfd0283142 Mon Sep 17 00:00:00 2001 +From: Leorize +Date: Thu, 23 Jan 2020 12:13:55 -0600 +Subject: Makefile.in: use iquote for include paths +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The -I flag used causes gcc to pick headers from NASM instead of system +headers for system includes. Since NASM have headers with names +overlapping with the ones in the C standard library (ie. float.h). This +breaks compilation on certain systems (ie. Haiku). + +This commit swap out the -I flags for -iquote, to only prioritise NASM +include paths for quoted includes. + +Signed-off-by: Hiếu Lê + +diff --git a/Makefile.in b/Makefile.in +index 32ef3d9..330a7e7 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -22,12 +22,12 @@ CC = @CC@ + CFLAGS = @CFLAGS@ + CPPFLAGS = @CPPFLAGS@ + BUILD_CFLAGS = $(CPPFLAGS) $(CFLAGS) @DEFS@ +-INTERNAL_CFLAGS = -I$(srcdir) -I$(objdir) \ +- -I$(srcdir)/include -I$(objdir)/include \ +- -I$(srcdir)/x86 -I$(objdir)/x86 \ +- -I$(srcdir)/asm -I$(objdir)/asm \ +- -I$(srcdir)/disasm -I$(objdir)/disasm \ +- -I$(srcdir)/output -I$(objdir)/output ++INTERNAL_CFLAGS = -iquote$(srcdir) -iquote$(objdir) \ ++ -iquote$(srcdir)/include -iquote$(objdir)/include \ ++ -iquote$(srcdir)/x86 -iquote$(objdir)/x86 \ ++ -iquote$(srcdir)/asm -iquote$(objdir)/asm \ ++ -iquote$(srcdir)/disasm -iquote$(objdir)/disasm \ ++ -iquote$(srcdir)/output -iquote$(objdir)/output + ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS) + LDFLAGS = @LDFLAGS@ + LIBS = @LIBS@ +-- +2.24.1 +