From 660e3f3c872476dd42e629947609996fceadab1f Mon Sep 17 00:00:00 2001 From: jxy_git Date: Tue, 20 Jun 2023 14:43:34 +0800 Subject: [PATCH] sync 22.03-LTS-SP1 to 22.03-LTS-SP2 (cherry picked from commit c0fe20bae68725b5f95f6910267778b93e1d4de7) --- add-parameters-to-solve-the-strip.patch | 35 +++++++++++++++++++++++++ cadvisor.spec | 13 +++++++-- 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100755 add-parameters-to-solve-the-strip.patch diff --git a/add-parameters-to-solve-the-strip.patch b/add-parameters-to-solve-the-strip.patch new file mode 100755 index 0000000..cdbda07 --- /dev/null +++ b/add-parameters-to-solve-the-strip.patch @@ -0,0 +1,35 @@ +From 0bd8cba374f1c735f48945fb14f165f087d49bd1 Mon Sep 17 00:00:00 2001 +From: jxy_git +Date: Tue, 7 Mar 2023 16:54:00 +0800 +Subject: [PATCH] add parameters to solve the strip + +--- + build/build.sh | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/build/build.sh b/build/build.sh +index b8cae39..79cec50 100755 +--- a/build/build.sh ++++ b/build/build.sh +@@ -37,12 +37,12 @@ if [ "${go_version:0:3}" = "1.4" ]; then + fi + + ldflags=" +- -X ${repo_path}/version.Version${ldseparator}${version} +- -X ${repo_path}/version.Revision${ldseparator}${revision} +- -X ${repo_path}/version.Branch${ldseparator}${branch} +- -X ${repo_path}/version.BuildUser${ldseparator}${BUILD_USER} +- -X ${repo_path}/version.BuildDate${ldseparator}${BUILD_DATE} +- -X ${repo_path}/version.GoVersion${ldseparator}${go_version}" ++ -w -s -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now -pie' -X ${repo_path}/version.Version${ldseparator}${version} ++ -w -s -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now -pie' -X ${repo_path}/version.Revision${ldseparator}${revision} ++ -w -s -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now -pie' -X ${repo_path}/version.Branch${ldseparator}${branch} ++ -w -s -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now -pie' -X ${repo_path}/version.BuildUser${ldseparator}${BUILD_USER} ++ -w -s -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now -pie' -X ${repo_path}/version.BuildDate${ldseparator}${BUILD_DATE} ++ -w -s -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now -pie' -X ${repo_path}/version.GoVersion${ldseparator}${go_version}" + + echo ">> building cadvisor" + +-- +2.39.1 + diff --git a/cadvisor.spec b/cadvisor.spec index 848cf97..f26b148 100644 --- a/cadvisor.spec +++ b/cadvisor.spec @@ -2,7 +2,7 @@ Name: cadvisor Version: 0.37.0 -Release: 2 +Release: 4 Summary: Analyzes resource usage and performance characteristics of running containers. License: ASL 2.0 URL: https://github.com/google/cadvisor @@ -10,6 +10,7 @@ URL: https://github.com/google/cadvisor Source0: https://github.com/google/cadvisor/archive/v%{version}.tar.gz Source1: vendor.tar.gz Patch0: use_preinstalled_go-bindata.patch +Patch1: add-parameters-to-solve-the-strip.patch BuildRequires: golang >= 1.13 @@ -29,9 +30,11 @@ and network statistics. This data is exported by container and machine-wide. %prep %setup -q -T -n %{name}-%{version} -b 0 -b 1 %patch0 -p1 +%patch1 -p1 %build -GOFLAGS=-mod=vendor make build +export GOFLAGS="-mod=vendor -buildmode=pie" +make build %install install -D -m 755 cadvisor %{buildroot}%{_bindir}/cadvisor @@ -43,6 +46,12 @@ install -D -m 755 cadvisor %{buildroot}%{_bindir}/cadvisor %changelog +* Wed Mar 08 2023 jiangxinyu - 0.37.0-4 +- Add strip and pie + +* Thu Dec 08 2022 fushanqing - 0.37.0-3 +- Enable debuginfo for fix strip + * Fri Jul 22 2022 wo_cow - 0.37.0-2 - Fix build err: nothing provides go-bindata -- Gitee