!21 libwebsockets: add secure compile options

From: @lifeng2221dd1
Reviewed-by: @duguhaotian
Signed-off-by: @duguhaotian
This commit is contained in:
openeuler-ci-bot 2021-03-16 09:46:53 +08:00 committed by Gitee
commit 7352eb58f1
2 changed files with 36 additions and 3 deletions

View File

@ -0,0 +1,26 @@
From 8fe3775c701ddf68fdbc7e3cc8d403bc350a8b1b Mon Sep 17 00:00:00 2001
From: Li Feng <lifeng2221dd1@zoho.com.cn>
Date: Tue, 16 Mar 2021 09:30:01 +0800
Subject: [PATCH] add fs secure compile options
Signed-off-by: Li Feng <lifeng2221dd1@zoho.com.cn>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 822a041..afcc3cc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -353,7 +353,7 @@ set(LWS_LIBRARY_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/")
-set(CMAKE_C_FLAGS "-Wl,-z,now ${CMAKE_C_FLAGS}")
+set(CMAKE_C_FLAGS "-Wl,-z,now -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -Wall -rdynamic ${CMAKE_C_FLAGS}")
message(STATUS "CMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'")
--
2.25.1

View File

@ -1,13 +1,14 @@
Name: libwebsockets
Version: 4.0.20
Release: 4
Release: 5
Summary: A lightweight C library for Websockets
License: LGPLv2 and Public Domain and BSD and MIT and zlib
URL: https://libwebsockets.org
Source0: https://github.com/warmcat/libwebsockets/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch9000: 0001-add-secure-compile-option-in-Makefile.patch
Patch9001: 0002-cmake-remove-unused-headfile-directory.patch
Patch9000: 0001-add-secure-compile-option-in-Makefile.patch
Patch9001: 0002-cmake-remove-unused-headfile-directory.patch
Patch9002: 0003-add-fs-secure-compile-options.patch
BuildRequires: cmake openssl-devel zlib-devel libev-devel git
@ -97,6 +98,12 @@ find %{buildroot} -name '*_static.pc' -exec rm -f {} ';'
%doc changelog README.md READMEs/
%changelog
* Tue 16 Mar 2021 lifeng <lifeng68@huawei.com> - 4.0.20-5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: add secure compile options
* Fri 19 Feb 2021 lifeng <lifeng68@huawei.com> - 4.0.20-4
- Type:bugfix
- ID:NA