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
This commit is contained in:
Martin Pluskal
2024-08-02 04:06:06 +00:00
committed by Git OBS Bridge
commit 5cee7b3a87
11 changed files with 299 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

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

13
_service Normal file
View File

@@ -0,0 +1,13 @@
<services>
<service mode="disabled" name="tar_scm">
<param name="url">https://hg.java.net/hg/libmicro~hg-repo</param>
<param name="scm">hg</param>
<param name="filename">libmicro</param>
<param name="versionformat">0.4.2+hg.20120726</param>
</service>
<service mode="disabled" name="recompress">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service mode="disabled" name="set_version"/>
</services>

48
find_binary.patch Normal file
View File

@@ -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

13
fix-link.diff Normal file
View File

@@ -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

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:340c2c0c7c5a6dfeb89e5f1627fc993aa8f2ebd56b4a6a42a178e38ffe5e9204
size 41396

12
libmicro-gcc14.patch Normal file
View File

@@ -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 <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
+#include <sys/file.h>
#include "libmicro.h"

View File

@@ -0,0 +1,36 @@
Index: mmap.c
===================================================================
--- mmap.c.orig
+++ mmap.c
@@ -32,6 +32,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <strings.h>
+#include <string.h>
#include "libmicro.h"
Index: mprotect.c
===================================================================
--- mprotect.c.orig
+++ mprotect.c
@@ -34,6 +34,7 @@
#include <sys/mman.h>
#include <fcntl.h>
#include <strings.h>
+#include <string.h>
#include "libmicro.h"
Index: munmap.c
===================================================================
--- munmap.c.orig
+++ munmap.c
@@ -34,6 +34,7 @@
#include <sys/mman.h>
#include <fcntl.h>
#include <strings.h>
+#include <string.h>
#include "libmicro.h"

75
libmicro.changes Normal file
View File

@@ -0,0 +1,75 @@
-------------------------------------------------------------------
Thu Aug 1 19:27:50 UTC 2024 - Marcus Meissner <meissner@suse.com>
- libmicro-gcc14.patch: fix build with gcc14
-------------------------------------------------------------------
Thu Dec 19 15:15:30 UTC 2019 - Martin Pluskal <mpluskal@suse.com>
- Do not ship .o files - boo#1159556
-------------------------------------------------------------------
Fri Dec 6 07:52:02 UTC 2019 - Martin Pluskal <mpluskal@suse.com>
- 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

62
libmicro.spec Normal file
View File

@@ -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

View File

@@ -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);