Compare commits

...

3 Commits

Author SHA1 Message Date
eabdullin c9472737b2 Import from AlmaLinux stable repository 2024-05-31 17:44:31 +00:00
CentOS Sources 513bbc03af import intel-cmt-cat-4.0.0-0.el8 2021-09-09 19:08:48 +00:00
CentOS Sources 3d0537a735 import intel-cmt-cat-2.0.0-3.el8 2021-09-09 19:08:45 +00:00
6 changed files with 144 additions and 127 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/v2.0.0.tar.gz
SOURCES/intel-cmt-cat-23.11.tar.gz

View File

@ -1 +0,0 @@
ace5783bf51f746ad3e2b79a31a5cb99c5689ab6 SOURCES/v2.0.0.tar.gz

View File

@ -0,0 +1,64 @@
Description: Hard code in hardening options
Forwarded: not-needed
Author: Colin Ian King <colin.i.king@gmail.com>
Index: intel-cmt-cat-23.11/lib/Makefile
===================================================================
--- intel-cmt-cat-23.11.orig/lib/Makefile 2023-11-01 14:00:13.000000000 +0100
+++ intel-cmt-cat-23.11/lib/Makefile 2024-02-21 08:55:18.864718246 +0100
@@ -37,8 +37,8 @@
VERSION = 5.0.0
SO_VERSION = 5
SHARED ?= y
-LDFLAGS = -L. -lpthread -z noexecstack -z relro -z now
-CFLAGS = -pthread -I./ -D_GNU_SOURCE \
+LDFLAGS += -L. -lpthread -z noexecstack -z relro -z now
+CFLAGS += -pthread -I./ -D_GNU_SOURCE \
-W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wold-style-definition -Wpointer-arith \
-Wcast-qual -Wundef -Wwrite-strings \
Index: intel-cmt-cat-23.11/pqos/Makefile
===================================================================
--- intel-cmt-cat-23.11.orig/pqos/Makefile 2023-11-01 14:00:13.000000000 +0100
+++ intel-cmt-cat-23.11/pqos/Makefile 2024-02-21 08:55:18.865718244 +0100
@@ -36,9 +36,9 @@
OBJDIR = obj
LIBDIR ?= ../lib
-LDFLAGS = -L$(LIBDIR) -pie -z noexecstack -z relro -z now
+LDFLAGS += -L$(LIBDIR) -pie -z noexecstack -z relro -z now
LDLIBS = -lpqos -lpthread
-CFLAGS = -I$(LIBDIR) \
+CFLAGS += -I$(LIBDIR) \
-W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wold-style-definition -Wpointer-arith \
-Wcast-qual -Wundef -Wwrite-strings \
Index: intel-cmt-cat-23.11/rdtset/Makefile
===================================================================
--- intel-cmt-cat-23.11.orig/rdtset/Makefile 2023-11-01 14:00:13.000000000 +0100
+++ intel-cmt-cat-23.11/rdtset/Makefile 2024-02-21 08:55:18.866718241 +0100
@@ -35,9 +35,9 @@
###############################################################################
LIBDIR ?= ../lib
-LDFLAGS = -L$(LIBDIR) -pie -z noexecstack -z relro -z now
+LDFLAGS += -L$(LIBDIR) -pie -z noexecstack -z relro -z now
LDLIBS = -lpqos -lpthread
-CFLAGS = -I$(LIBDIR) \
+CFLAGS += -I$(LIBDIR) \
-W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wold-style-definition -Wpointer-arith \
-Wcast-qual -Wundef -Wwrite-strings \
Index: intel-cmt-cat-23.11/tools/membw/Makefile
===================================================================
--- intel-cmt-cat-23.11.orig/tools/membw/Makefile 2023-11-01 14:00:13.000000000 +0100
+++ intel-cmt-cat-23.11/tools/membw/Makefile 2024-02-21 08:55:18.866718241 +0100
@@ -42,7 +42,7 @@
BIN_DIR = $(PREFIX)/bin
MAN_DIR = $(PREFIX)/man/man8
-CFLAGS=-W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
+CFLAGS += -W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wold-style-definition -Wpointer-arith \
-Wcast-qual -Wundef -Wwrite-strings \
-Wformat -Wformat-security -fstack-protector -fPIE \

View File

@ -1,28 +0,0 @@
From 072dc9ab42bff067bd9dc0f256c3abd7b1cc7341 Mon Sep 17 00:00:00 2001
From: Jiri Olsa <jolsa@kernel.org>
Date: Thu, 4 Oct 2018 14:27:47 +0200
Subject: [PATCH 1/2] make: Adding LDFLAGS to the libpqos build command
So it's taken into account.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
lib/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Makefile b/lib/Makefile
index fe07dfb81da6..a2dba5939931 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -104,7 +104,7 @@ all: $(LIBNAME)
$(LIBNAME): $(OBJS)
ifeq ($(SHARED),y)
- $(CC) -shared -Wl,-soname,$(LIB).so.$(SO_VERSION) -o $(LIBNAME) $^ -lc
+ $(CC) $(LDFLAGS) -shared -Wl,-soname,$(LIB).so.$(SO_VERSION) -o $(LIBNAME) $^ -lc
ln -f -s $(LIBNAME) $(LIB).so.$(SO_VERSION)
ln -f -s $(LIB).so.$(SO_VERSION) $(LIB).so
else
--
2.17.1

View File

@ -1,62 +0,0 @@
From 0f1020bc83b3d047a6226326d79798e1c7f4e0ee Mon Sep 17 00:00:00 2001
From: Jiri Olsa <jolsa@kernel.org>
Date: Thu, 4 Oct 2018 14:25:16 +0200
Subject: [PATCH 2/2] make: Add support to add flags to LDFLAGS via
EXTRA_LDFLAGS
We need to pass extra flags to LDFLAGS, so adding
the EXTRA_LDFLAGS to allow that. It mirrors the
EXTRA_CFLAGS variable usage.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
lib/Makefile | 3 +++
pqos/Makefile | 3 +++
rdtset/Makefile | 3 +++
3 files changed, 9 insertions(+)
diff --git a/lib/Makefile b/lib/Makefile
index a2dba5939931..8dfa308cc45e 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -48,6 +48,9 @@ CFLAGS = -pthread -I./ -D_GNU_SOURCE \
ifneq ($(EXTRA_CFLAGS),)
CFLAGS += $(EXTRA_CFLAGS)
endif
+ifneq ($(EXTRA_LDFLAGS),)
+LDFLAGS += $(EXTRA_LDFLAGS)
+endif
DOXY_DIRS = doc_api doc_lib
diff --git a/pqos/Makefile b/pqos/Makefile
index dc5cc1a1744e..0f1a26f5a0f7 100644
--- a/pqos/Makefile
+++ b/pqos/Makefile
@@ -47,6 +47,9 @@ CFLAGS = -I$(LIBDIR) \
ifneq ($(EXTRA_CFLAGS),)
CFLAGS += $(EXTRA_CFLAGS)
endif
+ifneq ($(EXTRA_LDFLAGS),)
+LDFLAGS += $(EXTRA_LDFLAGS)
+endif
# ICC and GCC options
ifeq ($(CC),icc)
diff --git a/rdtset/Makefile b/rdtset/Makefile
index d1f283093c4f..2e9939af8b20 100644
--- a/rdtset/Makefile
+++ b/rdtset/Makefile
@@ -48,6 +48,9 @@ CFLAGS = -I$(LIBDIR) \
ifneq ($(EXTRA_CFLAGS),)
CFLAGS += $(EXTRA_CFLAGS)
endif
+ifneq ($(EXTRA_LDFLAGS),)
+LDFLAGS += $(EXTRA_LDFLAGS)
+endif
# ICC and GCC options
ifeq ($(CC),icc)
--
2.17.1

View File

@ -1,4 +1,4 @@
# Copyright (c) 2016-2018, Intel Corporation
# Copyright (c) 2016-2020, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@ -24,7 +24,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%global githubname intel-cmt-cat
%global githubver 2.0.0
%global githubver 23.11
%if %{defined githubsubver}
%global githubfull %{githubname}-%{githubver}.%{githubsubver}
@ -38,21 +38,20 @@
Summary: Provides command line interface to CMT, MBM, CAT, CDP and MBA technologies
Name: %{githubname}
Release: 2%{?dist}
Release: 1%{?dist}
Version: %{githubver}
License: BSD
Group: Development/Tools
License: BSD-3-Clause
ExclusiveArch: x86_64 i686 i586
%if %{defined githubsubver}
Source: https://github.com/01org/%{githubname}/archive/v%{githubver}.%{githubsubver}.tar.gz
Source: https://github.com/intel/%{githubname}/archive/%{githubname}-%{githubver}.%{githubsubver}.tar.gz
%else
Source: https://github.com/01org/%{githubname}/archive/v%{githubver}.tar.gz
Source: https://github.com/intel/%{githubname}/archive/%{githubname}-%{githubver}.tar.gz
%endif
URL: https://github.com/01org/%{githubname}
BuildRequires: gcc, make
Patch1: 0001-make-Adding-LDFLAGS-to-the-libpqos-build-command.patch
Patch2: 0002-make-Add-support-to-add-flags-to-LDFLAGS-via-EXTRA_L.patch
Patch0001: 0001-allow-debian-flags-to-be-added.patch
URL: https://github.com/intel/%{githubname}
BuildRequires: gcc, make
%description
This software package provides basic support for
@ -72,7 +71,6 @@ it requires root privileges.
Summary: Library and sample code to use CMT, MBM, CAT, CDP and MBA technologies
License: BSD
Requires: intel-cmt-cat == %{version}
Group: Development/Tools
ExclusiveArch: x86_64 i686 i586
%description -n intel-cmt-cat-devel
@ -83,21 +81,23 @@ and Code Data Prioratization (CDP).
The package includes library, header file and sample code.
For additional information please refer to:
https://github.com/01org/%{githubname}
https://github.com/intel/%{githubname}
%prep
%autosetup -n %{githubfull} -p1
%autosetup -p1 -n %{githubfull}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%ldconfig_scriptlets
%build
make %{?_smp_mflags} EXTRA_CFLAGS="${RPM_OPT_FLAGS}" EXTRA_LDFLAGS="%{__global_ldflags}"
# RHEL 9's baseline is HSW/HSX, which has neither AVX-512 nor CLWB
make %{?_smp_mflags} HAS_AVX512=0 HAS_CLWB=0
%install
# Not doing make install as it strips the symbols.
# Using files from the build directory.
# pqos-* and rdtest are in %{_sbin} in Fedora now, but they are in %{_bin}
# in RHEL 9 originally, so, preserving it
install -d %{buildroot}/%{_bindir}
install -s %{_builddir}/%{githubfull}/pqos/pqos %{buildroot}/%{_bindir}
install %{_builddir}/%{githubfull}/pqos/pqos-os %{buildroot}/%{_bindir}
@ -106,8 +106,8 @@ sed -i "1s/.*/\#!\/usr\/bin\/bash/" %{buildroot}/%{_bindir}/pqos-*
install -d %{buildroot}/%{_mandir}/man8
install -m 0644 %{_builddir}/%{githubfull}/pqos/pqos.8 %{buildroot}/%{_mandir}/man8
ln -sf %{_mandir}/man8/pqos.8 %{buildroot}/%{_mandir}/man8/pqos-os.8
ln -sf %{_mandir}/man8/pqos.8 %{buildroot}/%{_mandir}/man8/pqos-msr.8
ln -sf pqos.8 %{buildroot}/%{_mandir}/man8/pqos-os.8
ln -sf pqos.8 %{buildroot}/%{_mandir}/man8/pqos-msr.8
install -d %{buildroot}/%{_bindir}
install -s %{_builddir}/%{githubfull}/rdtset/rdtset %{buildroot}/%{_bindir}
@ -115,14 +115,22 @@ install -s %{_builddir}/%{githubfull}/rdtset/rdtset %{buildroot}/%{_bindir}
install -d %{buildroot}/%{_mandir}/man8
install -m 0644 %{_builddir}/%{githubfull}/rdtset/rdtset.8 %{buildroot}/%{_mandir}/man8
install -d %{buildroot}/%{_licensedir}/%{name}-%{version}
install -m 0644 %{_builddir}/%{githubfull}/LICENSE %{buildroot}/%{_licensedir}/%{name}-%{version}
# membw is istalled in %{_bindir} in Fedora, but the man page
# is in the section 8
install -d %{buildroot}/%{_bindir}
install -s %{_builddir}/%{githubfull}/tools/membw/membw %{buildroot}/%{_bindir}
install -d %{buildroot}/%{_mandir}/man8
install -m 0644 %{_builddir}/%{githubfull}/tools/membw/membw.8 %{buildroot}/%{_mandir}/man8
install -d %{buildroot}/%{_licensedir}/%{name}
install -m 0644 %{_builddir}/%{githubfull}/LICENSE %{buildroot}/%{_licensedir}/%{name}
# Install the library
install -d %{buildroot}/%{_libdir}
install -s %{_builddir}/%{githubfull}/lib/libpqos.so.* %{buildroot}/%{_libdir}
cp -a %{_builddir}/%{githubfull}/lib/libpqos.so %{buildroot}/%{_libdir}
cp -a %{_builddir}/%{githubfull}/lib/libpqos.so.2 %{buildroot}/%{_libdir}
cp -a %{_builddir}/%{githubfull}/lib/libpqos.so.5 %{buildroot}/%{_libdir}
# Install the header file
install -d %{buildroot}/%{_includedir}
@ -134,16 +142,29 @@ install -m 0644 %{_builddir}/%{githubfull}/LICENSE %{buildroot}/%{_usrsrc}/%{git
install -d %{buildroot}/%{_usrsrc}/%{githubfull}/c
install -d %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CAT/Makefile %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CAT/reset_app.c %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CAT/allocation_app.c %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CAT/association_app.c %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT
install -d %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT_MBA
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CAT_MBA/Makefile %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT_MBA
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CAT_MBA/README %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT_MBA
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CAT_MBA/reset_app.c %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT_MBA
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CAT_MBA/allocation_app_l2cat.c %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT_MBA
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CAT_MBA/allocation_app_l3cat.c %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT_MBA
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CAT_MBA/allocation_app_mba.c %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT_MBA
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CAT_MBA/association_app.c %{buildroot}/%{_usrsrc}/%{githubfull}/c/CAT_MBA
install -d %{buildroot}/%{_usrsrc}/%{githubfull}/c/CMT_MBM
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CMT_MBM/Makefile %{buildroot}/%{_usrsrc}/%{githubfull}/c/CMT_MBM
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CMT_MBM/README %{buildroot}/%{_usrsrc}/%{githubfull}/c/CMT_MBM
install -m 0644 %{_builddir}/%{githubfull}/examples/c/CMT_MBM/monitor_app.c %{buildroot}/%{_usrsrc}/%{githubfull}/c/CMT_MBM
install -d %{buildroot}/%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK
install -m 0644 %{_builddir}/%{githubfull}/examples/c/PSEUDO_LOCK/Makefile %{buildroot}/%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK
install -m 0644 %{_builddir}/%{githubfull}/examples/c/PSEUDO_LOCK/README %{buildroot}/%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK
install -m 0644 %{_builddir}/%{githubfull}/examples/c/PSEUDO_LOCK/dlock.c %{buildroot}/%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK
install -m 0644 %{_builddir}/%{githubfull}/examples/c/PSEUDO_LOCK/dlock.h %{buildroot}/%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK
install -m 0644 %{_builddir}/%{githubfull}/examples/c/PSEUDO_LOCK/pseudo_lock.c %{buildroot}/%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK
install -m 0644 %{_builddir}/%{githubfull}/examples/c/PSEUDO_LOCK/tsc.c %{buildroot}/%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK
install -m 0644 %{_builddir}/%{githubfull}/examples/c/PSEUDO_LOCK/tsc.h %{buildroot}/%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK
%files
%{_bindir}/pqos
%{_bindir}/pqos-os
@ -153,25 +174,48 @@ install -m 0644 %{_builddir}/%{githubfull}/examples/c/CMT_MBM/monitor_app.c %{bu
%{_mandir}/man8/pqos-msr.8.gz
%{_bindir}/rdtset
%{_mandir}/man8/rdtset.8.gz
%{_bindir}/membw
%{_mandir}/man8/membw.8.gz
%{_libdir}/libpqos.so.*
%{!?_licensedir:%global license %%doc}
%license %{_licensedir}/%{name}-%{version}/LICENSE
%doc ChangeLog README
%license %{_licensedir}/%{name}/LICENSE
%doc ChangeLog README.md
%files -n intel-cmt-cat-devel
%{_libdir}/libpqos.so
%{_libdir}/libpqos.so.2
%{_libdir}/libpqos.so.5
%{_includedir}/pqos.h
%{_usrsrc}/%{githubfull}/c/CAT/Makefile
%{_usrsrc}/%{githubfull}/c/CAT/reset_app.c
%{_usrsrc}/%{githubfull}/c/CAT/association_app.c
%{_usrsrc}/%{githubfull}/c/CAT/allocation_app.c
%{_usrsrc}/%{githubfull}/c/CAT_MBA/Makefile
%{_usrsrc}/%{githubfull}/c/CAT_MBA/README
%{_usrsrc}/%{githubfull}/c/CAT_MBA/reset_app.c
%{_usrsrc}/%{githubfull}/c/CAT_MBA/association_app.c
%{_usrsrc}/%{githubfull}/c/CAT_MBA/allocation_app_l2cat.c
%{_usrsrc}/%{githubfull}/c/CAT_MBA/allocation_app_l3cat.c
%{_usrsrc}/%{githubfull}/c/CAT_MBA/allocation_app_mba.c
%{_usrsrc}/%{githubfull}/c/CMT_MBM/Makefile
%{_usrsrc}/%{githubfull}/c/CMT_MBM/README
%{_usrsrc}/%{githubfull}/c/CMT_MBM/monitor_app.c
%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK/Makefile
%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK/README
%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK/dlock.c
%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK/dlock.h
%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK/pseudo_lock.c
%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK/tsc.c
%{_usrsrc}/%{githubfull}/c/PSEUDO_LOCK/tsc.h
%doc %{_usrsrc}/%{githubfull}/LICENSE
%changelog
* Mon Feb 12 2024 Eugene Syromiatnikov <esyr@redhat.com> - 23.11-1
- Rebase to 23.11 (RHEL-25780)
* Mon Oct 12 2020 Jiri Olsa <jolsa@redhat.com> - 4.0.0-0
- New release 4.0.0
* Thu Jun 11 2020 Martin Cermak <mcermak@redhat.com> - 2.0.0-3
- NVR bump and rebuild because of CI gating.
Related: #1682388
* Mon Oct 08 2018 Jiri Olsa <jolsa@redhat.com> - 2.0.0-2
- New release 2.0.0-2
- passing distro CFLAGS/LDFLAGS