dev-libs/s2n: Fix USE="test" and remove -Werror

USE="test" was broken, because building of a shared library does not
work at the moment.
Fixed by removing hidden default visibility.
See: https://github.com/awslabs/s2n/issues/2401

-Werror is not recommended for releases and should always be disabled
when encountered in build-logs, because there are numerous cases
where this breaks without purpose.

Closes: https://bugs.gentoo.org/759796
Closes: https://bugs.gentoo.org/759799
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
Closes: https://github.com/gentoo/gentoo/pull/18651
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
This commit is contained in:
Sven Eden
2020-12-14 17:37:48 +01:00
committed by Joonas Niilola
parent 80060a9a59
commit 8bb288997a
2 changed files with 35 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
--- a/CMakeLists.txt 2020-12-14 17:24:27.577239622 +0100
+++ b/CMakeLists.txt 2020-12-14 17:24:50.036240917 +0100
@@ -193,7 +193,7 @@
set(CMAKE_C_FLAGS_DEBUGOPT "")
-target_compile_options(${PROJECT_NAME} PRIVATE -pedantic -std=gnu99 -Wall -Werror -Wimplicit -Wunused -Wcomment -Wchar-subscripts
+target_compile_options(${PROJECT_NAME} PRIVATE -pedantic -std=gnu99 -Wall -Wimplicit -Wunused -Wcomment -Wchar-subscripts
-Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings -Wno-deprecated-declarations -Wno-unknown-pragmas -Wformat-security
-Wno-missing-braces -fvisibility=hidden -DS2N_EXPORTS)
--- a/s2n.mk 2020-12-14 17:24:35.546240082 +0100
+++ b/s2n.mk 2020-12-14 17:25:05.604241814 +0100
@@ -42,7 +42,7 @@
DEFAULT_CFLAGS = -std=c99 -Wcast-qual
endif
-DEFAULT_CFLAGS += -pedantic -Wall -Werror -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized \
+DEFAULT_CFLAGS += -pedantic -Wall -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized \
-Wshadow -Wcast-align -Wwrite-strings -fPIC -Wno-missing-braces\
-D_POSIX_C_SOURCE=200809L -O2 -I$(LIBCRYPTO_ROOT)/include/ \
-I$(S2N_ROOT)/api/ -I$(S2N_ROOT) -Wno-deprecated-declarations -Wno-unknown-pragmas -Wformat-security \

View File

@@ -22,8 +22,12 @@ RDEPEND="
"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${P}-remove_Werror.patch
)
src_prepare() {
default
cmake_src_prepare
# Fix
# QA Notice: The following files contain writable and executable sections (...)
@@ -31,7 +35,14 @@ src_prepare() {
-e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \
-i "${S}"/pq-crypto/sike_r2/fp_x64_asm.S || die "sed failed"
cmake_src_prepare
# Fix shared library building, needed for USE="test"
# See: https://github.com/awslabs/s2n/issues/2401
if use test; then
sed -i -e 's, -fvisibility=hidden,,' "${S}"/CMakeLists.txt || die "sed failed"
# Remove s2n_self_talk_nonblocking_test, it is broken.
# See: https://github.com/awslabs/s2n/issues/2051#issuecomment-744543724
rm "${S}"/tests/unit/s2n_self_talk_nonblocking_test.c
fi
}
src_configure() {