libkcapi/libkcapi-fix-lto.patch
Marcus Meissner 71b7889ac7 Accepting request 908535 from home:gladiac:branches:security:tls
- Update to version 1.3.1
  * fix: fix -Wconversion warnings (by Ondrej Mosnacek)
  * fix: fix bad data types in _kcapi_common_send_meta (by Ondrej Mosnacek)
  * fix: Version symbols to maintain ABI compatibility (by Simo Sorce)
  * fix: disable io_getevents on systems that do not support it (by Khem Raj)
  * fix: remove prctl PR_SET_DUMPABLE to allow library to be debugged - as the
    library does not store any sensitive data in data structures it owns, such
    security precautions may not be necessary considering the benefit of
    allowing regular debugging
  * fix: ensure that sendmsg is always used as fallback when vmsplice cannot be
    used
  * enhancement: add kcapi_set_maxsplicesize and kcapi_get_maxsplicesize
  * enhancement: the variable types are changed from int32_t to ssize_t and
    from uint32_t to size_t to match common POSIX and Linux APIs
- Added libkcapi-fix-lto.patch

OBS-URL: https://build.opensuse.org/request/show/908535
OBS-URL: https://build.opensuse.org/package/show/security/libkcapi?expand=0&rev=37
2021-08-09 08:52:30 +00:00

48 lines
1.7 KiB
Diff

From 71d80bcffca26373149121e026d612146b4695d5 Mon Sep 17 00:00:00 2001
From: Simo Sorce <simo@redhat.com>
Date: Wed, 14 Jul 2021 10:52:01 -0400
Subject: [PATCH] Use GCCs __symver__ attribute
This is needed to allow LTO builds, as the __asm__ directives do not give
enough context to the compiler and the build fails when the -flto flag is
passed in.
Unfotunately __symver__ is avilbel only startig from GCC 10, so we need
more macro juggling.
Signed-off-by: Simo Sorce <simo@redhat.com>
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
lib/internal.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lib/internal.h b/lib/internal.h
index 29fdb7b..64dad24 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -350,6 +350,16 @@ static inline int io_getevents(__attribute__((unused)) aio_context_t ctx,
#if __GNUC__ >= 4
# define DSO_PUBLIC __attribute__ ((visibility ("default")))
+#if __GNUC__ >= 10
+# define IMPL_SYMVER(name, version) \
+ __attribute__ ((visibility ("default"))) \
+ __attribute__((__symver__("kcapi_" #name "@@LIBKCAPI_" version)))
+
+# define ORIG_SYMVER(name, version) \
+ __attribute__ ((visibility ("default"))) \
+ __attribute__((__symver__("kcapi_" #name "@LIBKCAPI_" version)))
+
+#else
# define IMPL_SYMVER(name, version) \
__asm__(".global impl_" #name ";"\
".symver impl_" #name ",kcapi_" #name "@@LIBKCAPI_" version);\
@@ -359,6 +369,7 @@ static inline int io_getevents(__attribute__((unused)) aio_context_t ctx,
__asm__(".global orig_" #name ";"\
".symver orig_" #name ",kcapi_" #name "@LIBKCAPI_" version);\
__attribute__ ((visibility ("default")))
+#endif
#else
# error "Compiler version too old"