From 5cee7b3a876cf5d8d8167541ba9542da881c12590175e4246c80cf812010c6e6 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Fri, 2 Aug 2024 04:06:06 +0000 Subject: [PATCH] Accepting request 1191053 from home:msmeissn:branches:benchmark - libmicro-gcc14.patch: fix build with gcc14 OBS-URL: https://build.opensuse.org/request/show/1191053 OBS-URL: https://build.opensuse.org/package/show/benchmark/libmicro?expand=0&rev=20 --- .gitattributes | 23 +++++++++ .gitignore | 1 + _service | 13 +++++ find_binary.patch | 48 ++++++++++++++++++ fix-link.diff | 13 +++++ libmicro-0.4.2+hg.20120726.tar.xz | 3 ++ libmicro-gcc14.patch | 12 +++++ libmicro-implicit-fortify-decl.patch | 36 +++++++++++++ libmicro.changes | 75 ++++++++++++++++++++++++++++ libmicro.spec | 62 +++++++++++++++++++++++ removed_undefined_warning.patch | 13 +++++ 11 files changed, 299 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _service create mode 100644 find_binary.patch create mode 100644 fix-link.diff create mode 100644 libmicro-0.4.2+hg.20120726.tar.xz create mode 100644 libmicro-gcc14.patch create mode 100644 libmicro-implicit-fortify-decl.patch create mode 100644 libmicro.changes create mode 100644 libmicro.spec create mode 100644 removed_undefined_warning.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..69c9231 --- /dev/null +++ b/_service @@ -0,0 +1,13 @@ + + + https://hg.java.net/hg/libmicro~hg-repo + hg + libmicro + 0.4.2+hg.20120726 + + + *.tar + xz + + + diff --git a/find_binary.patch b/find_binary.patch new file mode 100644 index 0000000..b54c6b1 --- /dev/null +++ b/find_binary.patch @@ -0,0 +1,48 @@ +Index: bench.sh +=================================================================== +--- bench.sh.orig ++++ bench.sh +@@ -30,8 +30,9 @@ + # Use is subject to license terms. + # + ++BIN="/usr/lib/libMicro/bin" + bench_version=0.4.2 +-libmicro_version=`bin/tattle -V` ++libmicro_version=`$BIN/tattle -V` + + case $libmicro_version in + $bench_version) +@@ -96,14 +97,14 @@ printf "!CPU_NAME: %30s\n" "$p_type" + printf "!IP_address: %30s\n" `getent hosts $hostname | awk '{print $1}'` + printf "!Run_by: %30s\n" $LOGNAME + printf "!Date: %30s\n" "`date '+%D %R'`" +-printf "!Compiler: %30s\n" `bin/tattle -c` +-printf "!Compiler Ver.:%30s\n" "`bin/tattle -v`" +-printf "!sizeof(long): %30s\n" `bin/tattle -s` +-printf "!extra_CFLAGS: %30s\n" "`bin/tattle -f`" +-printf "!TimerRes: %30s\n" "`bin/tattle -r`" ++printf "!Compiler: %30s\n" `$BIN/tattle -c` ++printf "!Compiler Ver.:%30s\n" "`$BIN/tattle -v`" ++printf "!sizeof(long): %30s\n" `$BIN/tattle -s` ++printf "!extra_CFLAGS: %30s\n" "`$BIN/tattle -f`" ++printf "!TimerRes: %30s\n" "`$BIN/tattle -r`" + + mkdir -p $TMPROOT/bin +-cp bin-$ARCH/exec_bin $TMPROOT/bin/$A ++cp $BIN/exec_bin $TMPROOT/bin/$A + + while read A B + do +@@ -125,9 +126,9 @@ do + + if [ ! -f $TMPROOT/bin/$A ] + then +- cp bin-$ARCH/$A $TMPROOT/bin/$A ++ cp $BIN/$A $TMPROOT/bin/$A + fi +- (cd $TMPROOT && eval "bin/$A $B") ++ (cd $TMPROOT && eval "$BIN/$A $B") + done <<. + # + # Obligatory null system call: use very short time diff --git a/fix-link.diff b/fix-link.diff new file mode 100644 index 0000000..0ee1e34 --- /dev/null +++ b/fix-link.diff @@ -0,0 +1,13 @@ +Index: Makefile.com +=================================================================== +--- Makefile.com.orig ++++ Makefile.com +@@ -107,7 +107,7 @@ tattle: ../tattle.c libmicro.a + echo "char compiler_version[] = \""`$(COMPILER_VERSION_CMD)`"\";" > tattle.h + echo "char CC[] = \""$(CC)"\";" >> tattle.h + echo "char extra_compiler_flags[] = \""$(extra_CFLAGS)"\";" >> tattle.h +- $(CC) -o tattle $(CFLAGS) -I. ../tattle.c libmicro.a -lrt -lm ++ $(CC) -o tattle $(CFLAGS) -I. ../tattle.c libmicro.a -lrt -lm -lpthread + + $(ELIDED_BENCHMARKS): ../elided.c + $(CC) -o $(@) ../elided.c diff --git a/libmicro-0.4.2+hg.20120726.tar.xz b/libmicro-0.4.2+hg.20120726.tar.xz new file mode 100644 index 0000000..a9619bb --- /dev/null +++ b/libmicro-0.4.2+hg.20120726.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:340c2c0c7c5a6dfeb89e5f1627fc993aa8f2ebd56b4a6a42a178e38ffe5e9204 +size 41396 diff --git a/libmicro-gcc14.patch b/libmicro-gcc14.patch new file mode 100644 index 0000000..b6193b2 --- /dev/null +++ b/libmicro-gcc14.patch @@ -0,0 +1,12 @@ +Index: libmicro-0.4.2+hg.20120726/cascade_flock.c +=================================================================== +--- libmicro-0.4.2+hg.20120726.orig/cascade_flock.c ++++ libmicro-0.4.2+hg.20120726/cascade_flock.c +@@ -46,6 +46,7 @@ + #include + #include + #include ++#include + + #include "libmicro.h" + diff --git a/libmicro-implicit-fortify-decl.patch b/libmicro-implicit-fortify-decl.patch new file mode 100644 index 0000000..ab2ed5a --- /dev/null +++ b/libmicro-implicit-fortify-decl.patch @@ -0,0 +1,36 @@ +Index: mmap.c +=================================================================== +--- mmap.c.orig ++++ mmap.c +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + + #include "libmicro.h" + +Index: mprotect.c +=================================================================== +--- mprotect.c.orig ++++ mprotect.c +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #include "libmicro.h" + +Index: munmap.c +=================================================================== +--- munmap.c.orig ++++ munmap.c +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #include "libmicro.h" + diff --git a/libmicro.changes b/libmicro.changes new file mode 100644 index 0000000..7f6be8b --- /dev/null +++ b/libmicro.changes @@ -0,0 +1,75 @@ +------------------------------------------------------------------- +Thu Aug 1 19:27:50 UTC 2024 - Marcus Meissner + +- libmicro-gcc14.patch: fix build with gcc14 + +------------------------------------------------------------------- +Thu Dec 19 15:15:30 UTC 2019 - Martin Pluskal + +- Do not ship .o files - boo#1159556 + +------------------------------------------------------------------- +Fri Dec 6 07:52:02 UTC 2019 - Martin Pluskal + +- Modernise spec file + +------------------------------------------------------------------- +Sat Jul 2 16:33:07 UTC 2016 - mpluskal@suse.com + +- Update to latest mercurial snapshot (4.2.2+hg.20120726) + * lots of small changes +- Build with optflags +- Refresh patches +- Add libmicro-implicit-fortify-decl.patch + +------------------------------------------------------------------- +Sat Feb 14 17:04:27 UTC 2015 - mpluskal@suse.com + +- Update url +- Remove ctcs glue +- Install bench.sh and multiview.sh to /usr/bin +- Don't install object files and headers + +------------------------------------------------------------------- +Mon Mar 26 15:11:31 UTC 2012 - cfarrell@suse.com + +- license update: CDDL-1.0 + SPDX format + +------------------------------------------------------------------- +Wed Sep 14 07:49:59 UTC 2011 - coolo@suse.com + +- do not build ctcs for 12.0+ + +------------------------------------------------------------------- +Sat Sep 10 07:56:02 UTC 2011 - coolo@suse.com + +- fix build with newer ld + +------------------------------------------------------------------- +Fri Jun 19 10:35:46 CEST 2009 - coolo@novell.com + +- disable as-needed for this package as it fails to build with it + +------------------------------------------------------------------- +Fri Jul 4 10:16:05 CEST 2008 - pkirsch@suse.de + +- added libmicro-ctcs-glue package, now the tcf is packaged and + can be run from the SUT without the need of NIS + +------------------------------------------------------------------- +Wed May 28 10:33:53 CEST 2008 - pkirsch@suse.de + +- removed warning for bnc#394556, + thanks to David Binderman + +------------------------------------------------------------------- +Mon Mar 17 13:29:16 CET 2008 - yxu@suse.de + +- retrieve the essential test executing file: bench.sh +- clarify the path for binary in bench.sh + +------------------------------------------------------------------- +Fri Jul 13 08:56:32 CET 2007 - pkirsch@suse.de +- initial package + diff --git a/libmicro.spec b/libmicro.spec new file mode 100644 index 0000000..a045f9f --- /dev/null +++ b/libmicro.spec @@ -0,0 +1,62 @@ +# +# spec file for package libmicro +# +# Copyright (c) 2024 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: libmicro +Version: 0.4.2+hg.20120726 +Release: 0 +Summary: LibMicro is a portable set of microbenchmarks +License: CDDL-1.0 +Group: System/Benchmark +URL: https://java.net/projects/libmicro +Source0: %{name}-%{version}.tar.xz +Patch0: find_binary.patch +Patch1: removed_undefined_warning.patch +Patch2: fix-link.diff +Patch3: libmicro-implicit-fortify-decl.patch +Patch4: libmicro-gcc14.patch + +%description +LibMicro is a portable set of microbenchmarks that many Solaris +engineers used during Solaris 10 development to measure the +performance of various system and library calls. + +%prep +%autosetup + +%build +%make_build CFLAGS="%{optflags}" + +%install +rm bin-*/*.a +rm bin-*/*.h +rm bin-*/*.o +mkdir -p %{buildroot}%{_bindir} +mkdir -p %{buildroot}%{_libexecdir}/libMicro/bin +cp bin/* %{buildroot}%{_libexecdir}/libMicro/bin +cp bin-*/* %{buildroot}%{_libexecdir}/libMicro/bin +install -m 755 bench.sh %{buildroot}%{_bindir} +install -m 755 multiview.sh %{buildroot}%{_bindir} + +%files +%license OPENSOLARIS.LICENSE +%doc README +%{_libexecdir}/libMicro +%{_bindir}/bench.sh +%{_bindir}/multiview.sh + +%changelog diff --git a/removed_undefined_warning.patch b/removed_undefined_warning.patch new file mode 100644 index 0000000..9f04332 --- /dev/null +++ b/removed_undefined_warning.patch @@ -0,0 +1,13 @@ +Index: malloc.c +=================================================================== +--- malloc.c.orig ++++ malloc.c +@@ -77,7 +77,7 @@ benchmark_optswitch(int opt, char *optar + break; + case 's': + opts[optscnt] = sizetoint(optarg); +- optscnt = ++optscnt & (31); ++ optscnt = (optscnt + 1) & (31); + break; + default: + return (-1);