Sync from SUSE:SLFO:Main yasm revision 9c7f31f68fb6bd175b1e6e0f976b468f

This commit is contained in:
Adrian Schröter 2024-05-04 02:19:56 +02:00
commit 8966e5f61c
8 changed files with 517 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

BIN
yasm-1.3.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,29 @@
From: kalebskeithley <kaleb@redhat.com>
Date: Thu, 21 May 2020 09:12:36 -0400
Subject: [PATCH] Update elf-objfmt.c
tl;dnr: add support for note.gnu.property note sections.
ceph has a few optimized crc32 routines hand written in assembly in yasm format. (Nobody appears to have the stomach for rewriting them in another format.) Fedora requires that libraries be CET enabled. IOW all .o comprising a shared library need a note.gnu.properties NOTE section with some magic bits that tell the linker that the .o was compiled with the appropriate options.
I can add such a note section, but without this change yasm will not set the correct section flag and I have to resort to some dd magic to set the correct section type before linking all the .o files into the shlib.
---
modules/objfmts/elf/elf-objfmt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c
index 0c3a1426..c4360c03 100644
--- a/modules/objfmts/elf/elf-objfmt.c
+++ b/modules/objfmts/elf/elf-objfmt.c
@@ -1077,6 +1077,10 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams,
align = 0;
data.type = SHT_PROGBITS;
data.flags = 0;
+ } else if (strcmp(sectname, ".note.gnu.property") == 0) {
+ align = 8;
+ data.type = SHT_NOTE;
+ data.flags = 0;
} else {
/* Default to code */
align = 1;

36
yasm-no-build-date.patch Normal file
View File

@ -0,0 +1,36 @@
Index: yasm-1.3.0/frontends/tasm/tasm.c
===================================================================
--- yasm-1.3.0.orig/frontends/tasm/tasm.c
+++ yasm-1.3.0/frontends/tasm/tasm.c
@@ -228,7 +228,6 @@ static opt_option options[] =
/* version message */
/*@observer@*/ static const char *version_msg[] = {
PACKAGE_STRING,
- "Compiled on " __DATE__ ".",
"Copyright (c) 2001-2010 Peter Johnson and other Yasm developers.",
"Run yasm --license for licensing overview and summary."
};
Index: yasm-1.3.0/frontends/vsyasm/vsyasm.c
===================================================================
--- yasm-1.3.0.orig/frontends/vsyasm/vsyasm.c
+++ yasm-1.3.0/frontends/vsyasm/vsyasm.c
@@ -220,7 +220,6 @@ static opt_option options[] =
/* version message */
/*@observer@*/ static const char *version_msg[] = {
PACKAGE_STRING,
- "Compiled on " __DATE__ ".",
"Copyright (c) 2001-2010 Peter Johnson and other Yasm developers.",
"Run yasm --license for licensing overview and summary."
};
Index: yasm-1.3.0/frontends/yasm/yasm.c
===================================================================
--- yasm-1.3.0.orig/frontends/yasm/yasm.c
+++ yasm-1.3.0/frontends/yasm/yasm.c
@@ -217,7 +217,6 @@ static opt_option options[] =
/* version message */
/*@observer@*/ static const char *version_msg[] = {
PACKAGE_STRING,
- "Compiled on " __DATE__ ".",
"Copyright (c) 2001-2014 Peter Johnson and other Yasm developers.",
"Run yasm --license for licensing overview and summary."
};

View File

@ -0,0 +1,68 @@
Index: Makefile.in
===================================================================
--- Makefile.in.orig
+++ Makefile.in
@@ -4051,7 +4051,7 @@ version.mac: genversion$(EXEEXT)
$(top_builddir)/genversion$(EXEEXT) $@
genversion.$(OBJEXT): modules/preprocs/nasm/genversion.c
- $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f modules/preprocs/nasm/genversion.c || echo '$(srcdir)/'`modules/preprocs/nasm/genversion.c
+ $(CC_FOR_BUILD) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f modules/preprocs/nasm/genversion.c || echo '$(srcdir)/'`modules/preprocs/nasm/genversion.c
#EXTRA_DIST += modules/preprocs/gas/tests/rawpp_test.sh
#EXTRA_DIST += modules/preprocs/gas/tests/longline.asm
@@ -4078,7 +4078,7 @@ module.c: $(top_srcdir)/libyasm/module.i
$(top_builddir)/genmodule$(EXEEXT) $(top_srcdir)/libyasm/module.in Makefile
genmodule.$(OBJEXT): libyasm/genmodule.c
- $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/genmodule.c || echo '$(srcdir)/'`libyasm/genmodule.c
+ $(CC_FOR_BUILD) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/genmodule.c || echo '$(srcdir)/'`libyasm/genmodule.c
@BUILD_MAN_TRUE@yasm.1: frontends/yasm/yasm.xml
@BUILD_MAN_TRUE@ $(XMLTO) -o $(top_builddir) man $(srcdir)/frontends/yasm/yasm.xml
@@ -4110,7 +4110,7 @@ install-exec-hook: python-install
uninstall-hook: python-uninstall
genstring.$(OBJEXT): genstring.c
- $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f genstring.c || echo '$(srcdir)/'`genstring.c
+ $(CC_FOR_BUILD) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f genstring.c || echo '$(srcdir)/'`genstring.c
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
Index: Makefile.am
===================================================================
--- Makefile.am.orig
+++ Makefile.am
@@ -158,5 +158,5 @@ genstring_LDADD = genstring.$(OBJEXT)
genstring_LINK = $(CCLD_FOR_BUILD) -o $@
genstring.$(OBJEXT): genstring.c
- $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f genstring.c || echo '$(srcdir)/'`genstring.c
+ $(CC_FOR_BUILD) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f genstring.c || echo '$(srcdir)/'`genstring.c
Index: libyasm/Makefile.inc
===================================================================
--- libyasm/Makefile.inc.orig
+++ libyasm/Makefile.inc
@@ -41,7 +41,7 @@ genmodule_LDADD = genmodule.$(OBJEXT)
genmodule_LINK = $(CCLD_FOR_BUILD) -o $@
genmodule.$(OBJEXT): libyasm/genmodule.c
- $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/genmodule.c || echo '$(srcdir)/'`libyasm/genmodule.c
+ $(CC_FOR_BUILD) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/genmodule.c || echo '$(srcdir)/'`libyasm/genmodule.c
EXTRA_DIST += libyasm/module.in
Index: modules/preprocs/nasm/Makefile.inc
===================================================================
--- modules/preprocs/nasm/Makefile.inc.orig
+++ modules/preprocs/nasm/Makefile.inc
@@ -31,7 +31,7 @@ genversion_LDADD = genversion.$(OBJEXT)
genversion_LINK = $(CCLD_FOR_BUILD) -o $@
genversion.$(OBJEXT): modules/preprocs/nasm/genversion.c
- $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f modules/preprocs/nasm/genversion.c || echo '$(srcdir)/'`modules/preprocs/nasm/genversion.c
+ $(CC_FOR_BUILD) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f modules/preprocs/nasm/genversion.c || echo '$(srcdir)/'`modules/preprocs/nasm/genversion.c
EXTRA_DIST += modules/preprocs/nasm/tests/Makefile.inc

15
yasm-re2c-nogendate.patch Normal file
View File

@ -0,0 +1,15 @@
--- yasm-1.3.0.orig/tools/re2c/parser.c
+++ yasm-1.3.0/tools/re2c/parser.c
@@ -232,9 +232,9 @@ void parse(FILE *i, FILE *o){
peektok = NONE;
- fputs("/* Generated by re2c 0.9.1-C on ", o);
- fprintf(o, "%-24s", ctime(&now));
- fputs(" */\n", o); oline+=2;
+ //fputs("/* Generated by re2c 0.9.1-C on ", o);
+ //fprintf(o, "%-24s", ctime(&now));
+ //fputs(" */\n", o); oline+=2;
in = Scanner_new(i);

257
yasm.changes Normal file
View File

@ -0,0 +1,257 @@
-------------------------------------------------------------------
Sat Nov 5 17:18:41 UTC 2022 - Larry Finger <Larry.Finger@gmail.com>
- Modify yasm to support .note.gnu.property note section
Patch from https://src.fedoraproject.org/rpms/yasm/pull-request/1#_2.
File "yasm-Update-elf-objfmt.c.patch" added.
-------------------------------------------------------------------
Fri Aug 2 08:22:42 UTC 2019 - Martin Liška <mliska@suse.cz>
- Use FAT LTO objects in order to provide proper static library.
-------------------------------------------------------------------
Thu Mar 15 09:53:41 UTC 2018 - mpluskal@suse.com
- Modernise spec file with spec-cleaner
- Update dependencies
- Dropn not needed postun calls
-------------------------------------------------------------------
Wed Nov 1 13:45:33 UTC 2017 - mpluskal@suse.com
- Switch to python3
-------------------------------------------------------------------
Wed Jan 27 07:55:04 UTC 2016 - mpluskal@suse.com
- Cleanup spec-file with spec cleaner
-------------------------------------------------------------------
Tue Feb 3 11:45:57 UTC 2015 - crrodriguez@opensuse.org
- yasm-re2c-nogendate.patch: Do not add date and time
to files generated with builtin old/different implementation
of re2c. [BNC#915937]
-------------------------------------------------------------------
Fri Oct 17 11:42:03 UTC 2014 - idonmez@suse.com
- Update to version 1.3.0
* See http://yasm.tortall.net/releases/Release1.3.0.html for
complete changelog.
- Refresh yasm-no-build-date.patch
-------------------------------------------------------------------
Fri Apr 5 07:53:51 UTC 2013 - idonmez@suse.com
- Cleanup spec file
- Add Source URL, see https://en.opensuse.org/SourceUrls
- Remove CHANGELOG, NEWS, README as those are empty.
-------------------------------------------------------------------
Wed Dec 19 12:28:41 UTC 2012 - idonmez@suse.com
- Ignore make check errors, 2 win64 tests fail which we don't care
-------------------------------------------------------------------
Wed Sep 26 08:50:54 UTC 2012 - idonmez@suse.com
- BuildRequire python-base to fix build cycle with Mesa
-------------------------------------------------------------------
Sat Aug 11 19:01:36 UTC 2012 - idonmez@suse.com
- Implement %check
- Fix license string
-------------------------------------------------------------------
Mon Aug 6 13:53:00 UTC 2012 - chris@computersalat.de
- update to 1.2.0
* Add AVX2 instructions (rev 11 of Intel AVX reference) (#227).
* Allow 64-bit LFS/LGS/LSS.
* Improve LAR instruction support (#224).
* Default win64 .xdata to nobase, add support for “..imagebase” (#135).
* Fix “TIMES” relocation handling.
* Fix no-suffix push and pop in GAS mode (#212).
* See the bug tracker for a full list of bug fixes.
- rebase no-build-date patch
- add yasm-no-rpm-opt-flags patch
- fix License
* Artistic-1.0, BSD-2-Clause, BSD-3-Clause, GPL-2.0+, LGPL-2.0+
-------------------------------------------------------------------
Sun Oct 24 00:02:36 CEST 2010 - ro@suse.de
- update to 1.1.0
* Fix a number of issues with Win32 SAFESEH support (#139).
* Fix several 32-bit Mach-O (macho32) bugs (#212 and others).
* Add Intel post-32nm instructions (section 7 of AVX spec).
* Add XSAVEOPT, INVEPT, INVVPID, and GETSEC instructions (#211).
* Remove AMD CVT16 instructions.
* Don't emit unnecessary REX.W for pinsrw instruction (#207).
* Update gettext to 0.17 (#206).
- update to 1.0.1
* Fix ELF32 shared object relocations (#202).
* Ignore [warning] directive (#201).
- update to 1.0.0
* Add GAS preprocessor (fixes #79).
* Add Visual Studio 2010 special frontend, vsyasm
* Add support for AMD XOP, FMA4, and CVT16 instructions
(replacing SSE5).
* Add support for %scope and %endscope NASM macros
* Add support for %{x:y} parameter list expansion
in NASM preprocessor
* Fix _GLOBAL_OFFSET_TABLE_
* Add support for ELF64 PC-relative relocations and latest ELF32
relocation types.
* Add support for ELF tlsdesc, tlscall, pltoff, gotplt, gotoff
special symbols.
* NASM preprocessor license has been changed to 2-clause BSD.
* Various bugfixes in TASM syntax support.
* Many other bugfixes
-------------------------------------------------------------------
Mon Aug 30 19:58:40 UTC 2010 - cristian.rodriguez@opensuse.org
- Do not include build dates in the binaries
-------------------------------------------------------------------
Sat Jan 2 04:10:23 UTC 2010 - pth@novell.com
- Update to 0.8.0. Changes from 0.7.2 :
* Add TASM-like basic syntax and frontend.
* Add movbe instruction and CPU feature.
* Don't require 0d/0e/0f/0t prefix on floating point numbers in GAS syntax.
* Legalize effective addresses such as [eax*2+ebx*2-ebx].
* Allow @ signs in identifiers in win32/win64 GAS syntax.
* Update AVX and FMA to latest Intel specifications.
* Update code alignment opcodes for modern processors, make
configurable using CPU directive.
* Fix referencing of local label from line that defines nonlocal label.
* Default memory size to "s" for no-suffix FP conversions in GAS syntax.
* Other bugfixes.
-------------------------------------------------------------------
Wed Feb 11 14:32:57 CET 2009 - dmueller@suse.de
- update to 0.7.2:
* http://www.tortall.net/projects/yasm/wiki/Release0.7.2
-------------------------------------------------------------------
Tue Oct 30 18:20:51 CET 2007 - uli@suse.de
- update -> 0.6.2; new features since 0.4.0:
* AMD SSE4a and SSE5 instruction support.
* AMD LZCNT, POPCNT, EXTRQ, INSERTQ, MOVNTSD, and MOVNTSS instruction
support.
* 16-bit float value (IEEE-754r half precision) support (desirable for
SSE5).
* Added "oword", "do", and "reso" aliases for "dqword", "ddq", "resdq".
* Added easier RIP-relative addressing with rel/abs modifiers and
"default" directive to set default rel/abs mode (see AMD64 for details).
* CPP preprocessor. Contributed by Paul Barker
* GAS local labels (1:, 1f, 1b) support. Noticed by Jung Lee
* GAS .org fill parameter support. Noticed by Jung Lee and Xiaoming Mo
* Command line aliases for -d (-D) and -u (-U) for increased NASM
command line compatibility. Requested by Mike Frysinger
* SSE4.1 and SSE4.2 instruction support. Noticed by arkon@ragestorm.net
* Support for .set directive in GAS parser. Contributed by Sebastian
D'Alessandro
* -E and -s command line options, similar to NASM options of the same
names (redirect errors to file and stdout, respectively). Suggested by:
pingved@gmail.com
* -Wsize-override option, to turn on warnings for duplicated size
overrides such as "dword dword" or "word word". Suggested by:
pingved@gmail.com
* Reconcile generated prefix order with GAS, to suggested Intel ordering
of SEG, ADDR, DATA, LOCKREP (AMD doesn't care).
* Fix test failure in Mach-O object format. Reported by many (e.g.
#105), first by Christophe Malvasio
* end_prolog macro equivalent to end_prologue (for Win64 structured
exception handling). Suggested by Brian Gladman
* Allow RIP-relative cross-section references in bin output.
* Mach-O custom sections: #102
* Brand-new "virtual" multi-pass optimizer that automatically generates
much smaller code for jumps and immediates.
* Support for Mach-O object format used in MacOS X, including both the
32-bit (x86) and 64-bit (AMD64) versions (contributed by Henryk
Richter).
* Support for structured exception handling on Win64.
* Support for RDOFF2 (.rdf) object format.
* Support for STRICT keyword in NASM syntax.
* Rewritten NASM and GAS parsers (now recursive descent rather than
Bison-based).
* Yasm no longer defaults to reading from standard input if no files are
specified; standard input can be specified with "-".
* Support for arithmetic on single-character constants.
* Support for OUTPUT_FORMAT as an alias for YASM_OBJFMT.
* Support for CodeView? 8.0 source debugging (as used by Visual Studio
2005).
* Fixed -I support to properly handle relative paths (now the search
pattern is essentially identical to most C compilers). This change is
backwards incompatible (to both NASM and earlier Yasm versions), but is
much more consistent.
* Standard macros that provide version information: __YASM_MAJOR__,
__YASM_MINOR__, __YASM_SUBMINOR__, __YASM_BUILD__, __YASM_VERSION_ID__
and __YASM_VER__.
* Aliases for AMD64 object formats: "win64" and "elf64" (these
automatically set the machine to "amd64").
* "x64" alias for Win64 object format (for easier use with Visual
Studio).
* DWARF2 source debugging (enable with "-g dwarf2").
* GAS parser good enough to take GCC output for both AMD64 and 32-bit
x86 (including DWARF2 debug information).
* Specifying "amd64" as the machine (or using a 64-bit object format)
automatically sets BITS 64.
-------------------------------------------------------------------
Tue May 29 13:19:48 CEST 2007 - pth@suse.de
- Split off headers and .so symlinks to -devel subpackage.
-------------------------------------------------------------------
Wed Jan 25 21:43:33 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Mon Jul 4 13:30:34 CEST 2005 - sf@suse.de
- fix missing string function declarations
-------------------------------------------------------------------
Wed Apr 27 15:44:35 CEST 2005 - meissner@suse.de
- fixed one stack overflow.
-------------------------------------------------------------------
Sun Mar 20 23:07:57 CET 2005 - olh@suse.de
- fix memory corruption in genmacro while handling empty lines
or lines with whitespaces only
use RPM_OPT_FLAGS, build with icecream
-------------------------------------------------------------------
Thu Feb 10 16:23:36 CET 2005 - sf@suse.de
- update to version 0.4.0
- added man pages
-------------------------------------------------------------------
Fri Nov 12 00:20:37 CET 2004 - ro@suse.de
- fixed file list
-------------------------------------------------------------------
Sat Jan 10 22:08:04 CET 2004 - adrian@suse.de
- add %defattr and %run_dlconfig
-------------------------------------------------------------------
Wed Nov 12 14:23:25 CET 2003 - sf@suse.de
- initial release 0.3.0

86
yasm.spec Normal file
View File

@ -0,0 +1,86 @@
#
# spec file for package yasm
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: yasm
Version: 1.3.0
Release: 0
Summary: A complete rewrite of the NASM assembler
License: Artistic-1.0 AND BSD-2-Clause AND BSD-3-Clause AND GPL-2.0-or-later AND LGPL-2.0-or-later
Group: Development/Languages/Other
URL: http://www.tortall.net/projects/yasm/
Source: http://www.tortall.net/projects/yasm/releases/yasm-%{version}.tar.gz
Patch0: %{name}-no-build-date.patch
Patch1: %{name}-no-rpm-opt-flags.patch
Patch2: yasm-re2c-nogendate.patch
Patch3: yasm-Update-elf-objfmt.c.patch
BuildRequires: python3-devel
BuildRequires: xmlto
%description
YASM is a complete rewrite of the NASM assembler. It is designed from
the ground up to allow for multiple syntaxes to be supported (e.g.,
NASM, TASM, GAS, etc.) in addition to multiple output object formats.
Another primary module of the overall design is an optimizer module.
Actually it supports ix86 and AMD64, next will be PowerPC
%package devel
Summary: YASM development package
Group: Development/Languages/Other
Requires: %{name} = %{version}
%description devel
This package includes everything needed to develop programs that use
libyasm.
%prep
%setup -q
%patch0 -p1
%patch1
%patch2 -p1
%patch3 -p1
%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
%configure \
--enable-python
make %{?_smp_mflags}
%install
%make_install
%check
# 2 win64 test crash but we don't care
make %{?_smp_mflags} check || true
%files
%license COPYING Artistic.txt BSD.txt GNU_GPL-2.0 GNU_LGPL-2.0
%doc ABOUT-NLS AUTHORS
%{_bindir}/vsyasm
%{_bindir}/yasm
%{_bindir}/ytasm
%{_mandir}/man1/yasm.1%{?ext_man}
%{_mandir}/man7/yasm_arch.7%{?ext_man}
%{_mandir}/man7/yasm_dbgfmts.7%{?ext_man}
%{_mandir}/man7/yasm_objfmts.7%{?ext_man}
%{_mandir}/man7/yasm_parsers.7%{?ext_man}
%files devel
%{_includedir}/*
%{_libdir}/libyasm.a
%changelog