rm attribute visibility before struct,fix spec,support clang

This commit is contained in:
yuncang123 2024-09-03 10:35:09 +08:00
parent b2b90f41c3
commit 24876de49d
2 changed files with 86 additions and 2 deletions

View File

@ -0,0 +1,76 @@
From 42b0b52d0cb8b857a3d3dae7271c06b435cbebb5 Mon Sep 17 00:00:00 2001
From: yuncang123 <1050706328@qq.com>
Date: Sat, 24 Aug 2024 02:13:48 +0800
Subject: [PATCH] delete __EXPORT__ in front of struct
---
src/runtime/lcrcontainer.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/runtime/lcrcontainer.h b/src/runtime/lcrcontainer.h
index d4cef39..4eedec9 100644
--- a/src/runtime/lcrcontainer.h
+++ b/src/runtime/lcrcontainer.h
@@ -40,13 +40,13 @@ extern "C" {
/* define console log config */
-__EXPORT__ struct lcr_console_config {
+struct lcr_console_config {
char *log_path;
unsigned int log_rotate;
char *log_file_size;
};
-__EXPORT__ struct blkio_stats {
+struct blkio_stats {
uint64_t read;
uint64_t write;
uint64_t total;
@@ -55,7 +55,7 @@ __EXPORT__ struct blkio_stats {
/*
* Store lcr container state
*/
-__EXPORT__ struct lcr_container_state {
+struct lcr_container_state {
/* Name of container */
char *name;
/* State of container */
@@ -92,14 +92,14 @@ typedef enum {
lcr_msg_exit_code,
} lcr_msg_type_t;
-__EXPORT__ struct lcr_msg {
+struct lcr_msg {
lcr_msg_type_t type;
char name[NAME_MAX + 1];
int value;
int pid;
};
-__EXPORT__ struct lcr_cgroup_resources {
+struct lcr_cgroup_resources {
uint64_t blkio_weight;
uint64_t cpu_shares;
uint64_t cpu_period;
@@ -150,7 +150,7 @@ __EXPORT__ bool lcr_create(const char *name, const char *lcrpath, void *oci_conf
* gid : user in which group
* additional_gids : Add additional groups to join
*/
-__EXPORT__ struct lcr_start_request {
+struct lcr_start_request {
const char *name;
const char *lcrpath;
@@ -237,7 +237,7 @@ __EXPORT__ void lcr_free_console_config(struct lcr_console_config *config);
__EXPORT__ int lcr_log_init(const char *name, const char *file, const char *priority,
const char *prefix, int quiet, const char *lcrpath);
-__EXPORT__ struct lcr_exec_request {
+struct lcr_exec_request {
const char *name;
const char *lcrpath;
--
2.43.0

View File

@ -1,5 +1,5 @@
%global _version 2.1.4
%global _release 8
%global _release 9
%global _inner_name isula_libutils
%global enable_lxc 1
@ -27,6 +27,7 @@ Patch0011: 0011-remove-lcr-created-spec-only-if-create-failed.patch
Patch0012: 0012-Fix-info-inproper-data-type-for-timestamp.patch
Patch0013: 0013-fix-bug-for-potential-config-seccomp-ocihook-write-e.patch
Patch0014: 0014-add-codecheck-fix.patch
Patch0015: 0015-backport-rm-attribute-visibility-before-struct.patch
%define lxcver_lower 4.0.3-2022102400
%define lxcver_upper 5.0.3
@ -80,6 +81,7 @@ mkdir -p build
cd build
%if "%toolchain" == "clang"
%global cmake_opts -DCMAKE_C_FLAGS="${CFLAGS}"
CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
%endif
%if 0%{?enable_lxc}
@ -147,7 +149,13 @@ rm -rf %{buildroot}
%{_includedir}/lcr/utils_compile.h
%changelog
* Tue June 11 2024 jikai<jikai11@huawei.com> - 2.1.4-8
* Tue Sep 3 2024 yuanchao<1050706328@qq.com> - 2.1.4-9
- Type:enhancement
- CVE:NA
- SUG:NA
- DESC:backport(rm attribute 'visibility' before struct),fix changelog,fix `clang: error: argument unused during compilation: '-fstack-clash-protection' [-Werror,-Wunused-command-line-argument]`,support clang build
* Tue Jun 11 2024 jikai<jikai11@huawei.com> - 2.1.4-8
- Type:enhancement
- CVE:NA
- SUG:NA