From 5f0bee8ac1a608af2442a5ecb713d3b1adc6d90d Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 21 Jun 2020 00:15:07 +0200 Subject: [PATCH 01/43] glibc: Fix build with -fno-common --- .../glibc/patches/glibc-fix-gcc10-build.patch | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 packages/devel/glibc/patches/glibc-fix-gcc10-build.patch diff --git a/packages/devel/glibc/patches/glibc-fix-gcc10-build.patch b/packages/devel/glibc/patches/glibc-fix-gcc10-build.patch new file mode 100644 index 00000000000..0304ebd6b51 --- /dev/null +++ b/packages/devel/glibc/patches/glibc-fix-gcc10-build.patch @@ -0,0 +1,166 @@ +From 49348beafe9ba150c9bd48595b3f372299bddbb0 Mon Sep 17 00:00:00 2001 +From: Joseph Myers +Date: Tue, 17 Mar 2020 22:57:42 +0000 +Subject: [PATCH] Fix build with GCC 10 when long double = double. + +On platforms where long double has the same ABI as double, glibc +defines long double functions as aliases for the corresponding double +functions. The declarations of those functions in are +disabled to avoid problems with aliases having incompatible types, but +GCC 10 now gives errors for incompatible types when the long double +function is known to GCC as a built-in function, not just when there +is an incompatible header declaration. + +This patch fixes those errors by using appropriate +-fno-builtin- options to compile the double functions. The +list of CFLAGS-* settings is an appropriately adapted version of that +in sysdeps/ieee754/ldbl-opt/Makefile used there for building nldbl-*.c +files; in particular, the options are used even if GCC does not +currently have a built-in function of a given function, so that adding +such a built-in function in future will not break the glibc build. +Thus, various of the CFLAGS-* settings are only for future-proofing +and may not currently be needed (and it's possible some could be +irrelevant for other reasons). + +Tested with build-many-glibcs.py for arm-linux-gnueabi (compilers and +glibcs builds), where it fixes the build that previously failed. +--- + math/Makefile | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 122 insertions(+) + +diff --git a/math/Makefile b/math/Makefile +index 84a8b94c74..0a5a40430e 100644 +--- a/math/Makefile ++++ b/math/Makefile +@@ -650,6 +650,128 @@ ifneq ($(long-double-fcts),yes) + # We won't compile the `long double' code at all. Tell the `double' code + # to define aliases for the `FUNCl' names. + math-CPPFLAGS += -DNO_LONG_DOUBLE ++# GCC 10 diagnoses aliases with types conflicting with built-in ++# functions. ++CFLAGS-w_acos.c += -fno-builtin-acosl ++CFLAGS-w_acosh.c += -fno-builtin-acoshl ++CFLAGS-w_asin.c += -fno-builtin-asinl ++CFLAGS-s_asinh.c += -fno-builtin-asinhl ++CFLAGS-s_atan.c += -fno-builtin-atanl ++CFLAGS-w_atan2.c += -fno-builtin-atan2l ++CFLAGS-w_atanh.c += -fno-builtin-atanhl ++CFLAGS-s_cabs.c += -fno-builtin-cabsl ++CFLAGS-s_cacos.c += -fno-builtin-cacosl ++CFLAGS-s_cacosh.c += -fno-builtin-cacoshl ++CFLAGS-s_canonicalize.c += -fno-builtin-canonicalizel ++CFLAGS-s_carg.c += -fno-builtin-cargl ++CFLAGS-s_casin.c += -fno-builtin-casinl ++CFLAGS-s_casinh.c += -fno-builtin-casinhl ++CFLAGS-s_catan.c += -fno-builtin-catanl ++CFLAGS-s_catanh.c += -fno-builtin-catanhl ++CFLAGS-s_cbrt.c += -fno-builtin-cbrtl ++CFLAGS-s_ccos.c += -fno-builtin-ccosl ++CFLAGS-s_ccosh.c += -fno-builtin-ccoshl ++CFLAGS-s_ceil.c += -fno-builtin-ceill ++CFLAGS-s_cexp.c += -fno-builtin-cexpl ++CFLAGS-s_cimag.c += -fno-builtin-cimagl ++CFLAGS-s_clog.c += -fno-builtin-clogl ++CFLAGS-s_clog10.c += -fno-builtin-clog10l ++CFLAGS-s_conj.c += -fno-builtin-conjl ++CFLAGS-s_copysign.c += -fno-builtin-copysignl ++CFLAGS-s_cos.c += -fno-builtin-cosl ++CFLAGS-w_cosh.c += -fno-builtin-coshl ++CFLAGS-s_cpow.c += -fno-builtin-cpowl ++CFLAGS-s_cproj.c += -fno-builtin-cprojl ++CFLAGS-s_creal.c += -fno-builtin-creall ++CFLAGS-s_csin.c += -fno-builtin-csinl ++CFLAGS-s_csinh.c += -fno-builtin-csinhl ++CFLAGS-s_csqrt.c += -fno-builtin-csqrtl ++CFLAGS-s_ctan.c += -fno-builtin-ctanl ++CFLAGS-s_ctanh.c += -fno-builtin-ctanhl ++CFLAGS-s_dadd.c += -fno-builtin-daddl ++CFLAGS-s_ddiv.c += -fno-builtin-ddivl ++CFLAGS-s_dmul.c += -fno-builtin-dmull ++CFLAGS-s_dsub.c += -fno-builtin-dsubl ++CFLAGS-s_erf.c += -fno-builtin-erfl ++CFLAGS-s_erfc.c += -fno-builtin-erfcl ++CFLAGS-e_exp.c += -fno-builtin-expl ++CFLAGS-w_exp10.c += -fno-builtin-exp10l ++CFLAGS-e_exp2.c += -fno-builtin-exp2l ++CFLAGS-s_expm1.c += -fno-builtin-expm1l ++CFLAGS-s_fabs.c += -fno-builtin-fabsl ++CFLAGS-s_fadd.c += -fno-builtin-faddl ++CFLAGS-s_fdim.c += -fno-builtin-fdiml ++CFLAGS-s_fdiv.c += -fno-builtin-fdivl ++CFLAGS-s_finite.c += -fno-builtin-finitel ++CFLAGS-s_floor.c += -fno-builtin-floorl ++CFLAGS-s_fma.c += -fno-builtin-fmal ++CFLAGS-s_fmax.c += -fno-builtin-fmaxl ++CFLAGS-s_fmaxmag.c += -fno-builtin-fmaxmagl ++CFLAGS-s_fmin.c += -fno-builtin-fminl ++CFLAGS-s_fminmag.c += -fno-builtin-fminmagl ++CFLAGS-w_fmod.c += -fno-builtin-fmodl ++CFLAGS-s_fmul.c += -fno-builtin-fmull ++CFLAGS-s_frexp.c += -fno-builtin-frexpl ++CFLAGS-s_fromfp.c += -fno-builtin-fromfpl ++CFLAGS-s_fromfpx.c += -fno-builtin-fromfpxl ++CFLAGS-s_fsub.c += -fno-builtin-fsubl ++CFLAGS-s_gamma.c += -fno-builtin-gammal ++CFLAGS-s_getpayload.c += -fno-builtin-getpayloadl ++CFLAGS-w_hypot.c += -fno-builtin-hypotl ++CFLAGS-w_ilogb.c += -fno-builtin-ilogbl ++CFLAGS-s_isinf.c += -fno-builtin-isinfl ++CFLAGS-s_isnan.c += -fno-builtin-isnanl ++CFLAGS-w_j0.c += -fno-builtin-j0l ++CFLAGS-w_j1.c += -fno-builtin-j1l ++CFLAGS-w_jn.c += -fno-builtin-jnl ++CFLAGS-s_ldexp.c += -fno-builtin-ldexpl ++CFLAGS-w_lgamma.c += -fno-builtin-lgammal ++CFLAGS-w_lgamma_r.c += -fno-builtin-lgammal_r ++CFLAGS-w_llogb.c += -fno-builtin-llogbl ++CFLAGS-s_llrint.c += -fno-builtin-llrintl ++CFLAGS-s_llround.c += -fno-builtin-llroundl ++CFLAGS-e_log.c += -fno-builtin-logl ++CFLAGS-w_log10.c += -fno-builtin-log10l ++CFLAGS-w_log1p.c += -fno-builtin-log1pl ++CFLAGS-e_log2.c += -fno-builtin-log2l ++CFLAGS-s_logb.c += -fno-builtin-logbl ++CFLAGS-s_lrint.c += -fno-builtin-lrintl ++CFLAGS-s_lround.c += -fno-builtin-lroundl ++CFLAGS-s_modf.c += -fno-builtin-modfl ++CFLAGS-s_nan.c += -fno-builtin-nanl ++CFLAGS-s_nearbyint.c += -fno-builtin-nearbyintl ++CFLAGS-s_nextafter.c += -fno-builtin-nextafterl ++CFLAGS-s_nextdown.c += -fno-builtin-nextdownl ++CFLAGS-s_nexttoward.c += -fno-builtin-nexttoward -fno-builtin-nexttowardl ++CFLAGS-s_nexttowardf.c += -fno-builtin-nexttowardf ++CFLAGS-s_nextup.c += -fno-builtin-nextupl ++CFLAGS-e_pow.c += -fno-builtin-powl ++CFLAGS-w_remainder.c += -fno-builtin-remainderl -fno-builtin-dreml ++CFLAGS-s_remquo.c += -fno-builtin-remquol ++CFLAGS-s_rint.c += -fno-builtin-rintl ++CFLAGS-s_round.c += -fno-builtin-roundl ++CFLAGS-s_roundeven.c += -fno-builtin-roundevenl ++CFLAGS-w_scalb.c += -fno-builtin-scalbl ++CFLAGS-w_scalbln.c += -fno-builtin-scalblnl ++CFLAGS-s_scalbn.c += -fno-builtin-scalbnl ++CFLAGS-s_setpayload.c += -fno-builtin-setpayloadl ++CFLAGS-s_setpayloadsig.c += -fno-builtin-setpayloadsigl ++CFLAGS-s_significand.c += -fno-builtin-significandl ++CFLAGS-s_sin.c += -fno-builtin-sinl ++CFLAGS-s_sincos.c += -fno-builtin-sincosl ++CFLAGS-w_sinh.c += -fno-builtin-sinhl ++CFLAGS-w_sqrt.c += -fno-builtin-sqrtl ++CFLAGS-s_tan.c += -fno-builtin-tanl ++CFLAGS-s_tanh.c += -fno-builtin-tanhl ++CFLAGS-w_tgamma.c += -fno-builtin-tgammal ++CFLAGS-s_totalorder.c += -fno-builtin-totalorderl ++CFLAGS-s_totalordermag.c += -fno-builtin-totalordermagl ++CFLAGS-s_trunc.c += -fno-builtin-truncl ++CFLAGS-s_ufromfp.c += -fno-builtin-ufromfpl ++CFLAGS-s_ufromfpx.c += -fno-builtin-ufromfpxl ++CFLAGS-s_y0.c += -fno-builtin-y0l ++CFLAGS-s_y1.c += -fno-builtin-y1l ++CFLAGS-s_yn.c += -fno-builtin-ynl + endif + + # These files quiet sNaNs in a way that is optimized away without +-- +2.18.2 + From 28357ff75991391e3b14b493963be94b6c73a3d4 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 21 Jun 2020 00:15:39 +0200 Subject: [PATCH 02/43] memtester: Fix build with -fno-common --- .../memtester-002-fix_GCC10_FTBFS.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 packages/debug/memtester/patches/memtester-002-fix_GCC10_FTBFS.patch diff --git a/packages/debug/memtester/patches/memtester-002-fix_GCC10_FTBFS.patch b/packages/debug/memtester/patches/memtester-002-fix_GCC10_FTBFS.patch new file mode 100644 index 00000000000..1e87289fb57 --- /dev/null +++ b/packages/debug/memtester/patches/memtester-002-fix_GCC10_FTBFS.patch @@ -0,0 +1,39 @@ +Description: reorganize variables to fix GCC 10 FTBFS + Define variables in source, make types in header. +Author: Laszlo Boszormenyi (GCS) +Bug-Debian: https://bugs.debian.org/957529 +Last-Update: 2020-04-19 + +--- + +--- memtester-4.3.0.orig/tests.c ++++ memtester-4.3.0/tests.c +@@ -27,6 +27,9 @@ char progress[] = "-\\|/"; + #define PROGRESSOFTEN 2500 + #define ONE 0x00000001L + ++mword8_t mword8; ++mword16_t mword16; ++ + /* Function definitions. */ + + int compare_regions(ulv *bufa, ulv *bufb, size_t count) { +--- memtester-4.3.0.orig/types.h ++++ memtester-4.3.0/types.h +@@ -25,12 +25,12 @@ struct test { + int (*fp)(); + }; + +-union { ++typedef union { + unsigned char bytes[UL_LEN/8]; + ul val; +-} mword8; ++} mword8_t; + +-union { ++typedef union { + unsigned short u16s[UL_LEN/16]; + ul val; +-} mword16; ++} mword16_t; From 8db2905d7f4d90f39f72a41fb08d7ff33f07e475 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 21 Jun 2020 00:16:22 +0200 Subject: [PATCH 03/43] libtirpc: Update to 1.2.6 --- packages/network/libtirpc/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/network/libtirpc/package.mk b/packages/network/libtirpc/package.mk index 6d7537d5eef..dd5db5ff336 100644 --- a/packages/network/libtirpc/package.mk +++ b/packages/network/libtirpc/package.mk @@ -3,8 +3,8 @@ # Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv) PKG_NAME="libtirpc" -PKG_VERSION="1.1.4" -PKG_SHA256="2ca529f02292e10c158562295a1ffd95d2ce8af97820e3534fe1b0e3aec7561d" +PKG_VERSION="1.2.6" +PKG_SHA256="4278e9a5181d5af9cd7885322fdecebc444f9a3da87c526e7d47f7a12a37d1cc" PKG_LICENSE="GPL" PKG_SITE="https://sourceforge.net/projects/libtirpc/" PKG_URL="https://downloads.sourceforge.net/project/libtirpc/libtirpc/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.bz2" From 4c0e380f1c788dbf2e64d4781b89694f0fe8e0b1 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 21 Jun 2020 00:17:03 +0200 Subject: [PATCH 04/43] libunwind: Update to 1.4.0 --- packages/debug/libunwind/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/debug/libunwind/package.mk b/packages/debug/libunwind/package.mk index a54f72cb9f1..7faae4cdf28 100644 --- a/packages/debug/libunwind/package.mk +++ b/packages/debug/libunwind/package.mk @@ -2,8 +2,8 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="libunwind" -PKG_VERSION="1.3.1" -PKG_SHA256="43997a3939b6ccdf2f669b50fdb8a4d3205374728c2923ddc2354c65260214f8" +PKG_VERSION="1.4.0" +PKG_SHA256="df59c931bd4d7ebfd83ee481c943edf015138089b8e50abed8d9c57ba9338435" PKG_LICENSE="GPL" PKG_SITE="http://www.nongnu.org/libunwind/" PKG_URL="http://download.savannah.nongnu.org/releases/libunwind/libunwind-${PKG_VERSION}.tar.gz" From 92d067d360cef2251bb373560218ce9854873c73 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 21 Jun 2020 00:17:28 +0200 Subject: [PATCH 05/43] libunwind: Fix build with -fno-common --- ...wind-Fix-compilation-with-fno-common.patch | 445 ++++++++++++++++++ 1 file changed, 445 insertions(+) create mode 100644 packages/debug/libunwind/patches/libunwind-Fix-compilation-with-fno-common.patch diff --git a/packages/debug/libunwind/patches/libunwind-Fix-compilation-with-fno-common.patch b/packages/debug/libunwind/patches/libunwind-Fix-compilation-with-fno-common.patch new file mode 100644 index 00000000000..1acfca9a821 --- /dev/null +++ b/packages/debug/libunwind/patches/libunwind-Fix-compilation-with-fno-common.patch @@ -0,0 +1,445 @@ +From 29e17d8d2ccbca07c423e3089a6d5ae8a1c9cb6e Mon Sep 17 00:00:00 2001 +From: Yichao Yu +Date: Tue, 31 Mar 2020 00:43:32 -0400 +Subject: [PATCH] Fix compilation with -fno-common. + +Making all other archs consistent with IA64 which should not have this problem. +Also move the FIXME to the correct place. + +Also add some minimum comments about this... +--- + src/aarch64/Ginit.c | 15 +++++++-------- + src/arm/Ginit.c | 15 +++++++-------- + src/coredump/_UPT_get_dyn_info_list_addr.c | 5 +++++ + src/hppa/Ginit.c | 15 +++++++-------- + src/ia64/Ginit.c | 1 + + src/mi/Gfind_dynamic_proc_info.c | 1 + + src/mips/Ginit.c | 15 +++++++-------- + src/ppc32/Ginit.c | 11 +++++++---- + src/ppc64/Ginit.c | 11 +++++++---- + src/ptrace/_UPT_get_dyn_info_list_addr.c | 5 +++++ + src/s390x/Ginit.c | 15 +++++++-------- + src/sh/Ginit.c | 15 +++++++-------- + src/tilegx/Ginit.c | 15 +++++++-------- + src/x86/Ginit.c | 15 +++++++-------- + src/x86_64/Ginit.c | 15 +++++++-------- + 15 files changed, 89 insertions(+), 80 deletions(-) + +diff --git a/src/aarch64/Ginit.c b/src/aarch64/Ginit.c +index dec235c..3538976 100644 +--- a/src/aarch64/Ginit.c ++++ b/src/aarch64/Ginit.c +@@ -61,13 +61,6 @@ tdep_uc_addr (unw_tdep_context_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; +- +-/* XXX fix me: there is currently no way to locate the dyn-info list +- by a remote unwinder. On ia64, this is done via a special +- unwind-table entry. Perhaps something similar can be done with +- DWARF2 unwind info. */ +- + static void + put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) + { +@@ -78,7 +71,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +diff --git a/src/arm/Ginit.c b/src/arm/Ginit.c +index 2720d06..0bac0d7 100644 +--- a/src/arm/Ginit.c ++++ b/src/arm/Ginit.c +@@ -57,18 +57,17 @@ tdep_uc_addr (unw_tdep_context_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; +- +-/* XXX fix me: there is currently no way to locate the dyn-info list +- by a remote unwinder. On ia64, this is done via a special +- unwind-table entry. Perhaps something similar can be done with +- DWARF2 unwind info. */ +- + static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +diff --git a/src/coredump/_UPT_get_dyn_info_list_addr.c b/src/coredump/_UPT_get_dyn_info_list_addr.c +index 0d11905..739ed05 100644 +--- a/src/coredump/_UPT_get_dyn_info_list_addr.c ++++ b/src/coredump/_UPT_get_dyn_info_list_addr.c +@@ -74,6 +74,11 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg, + + #else + ++/* XXX fix me: there is currently no way to locate the dyn-info list ++ by a remote unwinder. On ia64, this is done via a special ++ unwind-table entry. Perhaps something similar can be done with ++ DWARF2 unwind info. */ ++ + static inline int + get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg, + int *countp) +diff --git a/src/hppa/Ginit.c b/src/hppa/Ginit.c +index 461e4b9..265455a 100644 +--- a/src/hppa/Ginit.c ++++ b/src/hppa/Ginit.c +@@ -64,13 +64,6 @@ _Uhppa_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; +- +-/* XXX fix me: there is currently no way to locate the dyn-info list +- by a remote unwinder. On ia64, this is done via a special +- unwind-table entry. Perhaps something similar can be done with +- DWARF2 unwind info. */ +- + static void + put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) + { +@@ -81,7 +74,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +diff --git a/src/ia64/Ginit.c b/src/ia64/Ginit.c +index b09a2ad..8601bb3 100644 +--- a/src/ia64/Ginit.c ++++ b/src/ia64/Ginit.c +@@ -68,6 +68,7 @@ get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + if (!_U_dyn_info_list_addr) + return -UNW_ENOINFO; + #endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. + *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } +diff --git a/src/mi/Gfind_dynamic_proc_info.c b/src/mi/Gfind_dynamic_proc_info.c +index 98d3501..2e7c62e 100644 +--- a/src/mi/Gfind_dynamic_proc_info.c ++++ b/src/mi/Gfind_dynamic_proc_info.c +@@ -49,6 +49,7 @@ local_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, + return -UNW_ENOINFO; + #endif + ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. + list = (unw_dyn_info_list_t *) (uintptr_t) _U_dyn_info_list_addr (); + for (di = list->first; di; di = di->next) + if (ip >= di->start_ip && ip < di->end_ip) +diff --git a/src/mips/Ginit.c b/src/mips/Ginit.c +index 3df170c..bf7a8f5 100644 +--- a/src/mips/Ginit.c ++++ b/src/mips/Ginit.c +@@ -69,13 +69,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; +- +-/* XXX fix me: there is currently no way to locate the dyn-info list +- by a remote unwinder. On ia64, this is done via a special +- unwind-table entry. Perhaps something similar can be done with +- DWARF2 unwind info. */ +- + static void + put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) + { +@@ -86,7 +79,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) (intptr_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +diff --git a/src/ppc32/Ginit.c b/src/ppc32/Ginit.c +index ba30244..7b45455 100644 +--- a/src/ppc32/Ginit.c ++++ b/src/ppc32/Ginit.c +@@ -91,9 +91,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; +- +- + static void + put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) + { +@@ -104,7 +101,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +diff --git a/src/ppc64/Ginit.c b/src/ppc64/Ginit.c +index 4c88cd6..7bfb395 100644 +--- a/src/ppc64/Ginit.c ++++ b/src/ppc64/Ginit.c +@@ -95,9 +95,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; +- +- + static void + put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) + { +@@ -108,7 +105,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +diff --git a/src/ptrace/_UPT_get_dyn_info_list_addr.c b/src/ptrace/_UPT_get_dyn_info_list_addr.c +index cc5ed04..16671d4 100644 +--- a/src/ptrace/_UPT_get_dyn_info_list_addr.c ++++ b/src/ptrace/_UPT_get_dyn_info_list_addr.c +@@ -71,6 +71,11 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg, + + #else + ++/* XXX fix me: there is currently no way to locate the dyn-info list ++ by a remote unwinder. On ia64, this is done via a special ++ unwind-table entry. Perhaps something similar can be done with ++ DWARF2 unwind info. */ ++ + static inline int + get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg, + int *countp) +diff --git a/src/s390x/Ginit.c b/src/s390x/Ginit.c +index f0886ac..db01743 100644 +--- a/src/s390x/Ginit.c ++++ b/src/s390x/Ginit.c +@@ -50,8 +50,6 @@ static struct unw_addr_space local_addr_space; + + unw_addr_space_t unw_local_addr_space = &local_addr_space; + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; +- + static inline void * + uc_addr (ucontext_t *uc, int reg) + { +@@ -75,11 +73,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-/* XXX fix me: there is currently no way to locate the dyn-info list +- by a remote unwinder. On ia64, this is done via a special +- unwind-table entry. Perhaps something similar can be done with +- DWARF2 unwind info. */ +- + static void + put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) + { +@@ -90,7 +83,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +diff --git a/src/sh/Ginit.c b/src/sh/Ginit.c +index 52988a7..9fe96d2 100644 +--- a/src/sh/Ginit.c ++++ b/src/sh/Ginit.c +@@ -58,13 +58,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; +- +-/* XXX fix me: there is currently no way to locate the dyn-info list +- by a remote unwinder. On ia64, this is done via a special +- unwind-table entry. Perhaps something similar can be done with +- DWARF2 unwind info. */ +- + static void + put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) + { +@@ -75,7 +68,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +diff --git a/src/tilegx/Ginit.c b/src/tilegx/Ginit.c +index 7564a55..925e641 100644 +--- a/src/tilegx/Ginit.c ++++ b/src/tilegx/Ginit.c +@@ -64,13 +64,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; +- +-/* XXX fix me: there is currently no way to locate the dyn-info list +- by a remote unwinder. On ia64, this is done via a special +- unwind-table entry. Perhaps something similar can be done with +- DWARF2 unwind info. */ +- + static void + put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) + { +@@ -81,7 +74,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) (intptr_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +diff --git a/src/x86/Ginit.c b/src/x86/Ginit.c +index f6b8dc2..3cec74a 100644 +--- a/src/x86/Ginit.c ++++ b/src/x86/Ginit.c +@@ -54,13 +54,6 @@ tdep_uc_addr (ucontext_t *uc, int reg) + + # endif /* UNW_LOCAL_ONLY */ + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; +- +-/* XXX fix me: there is currently no way to locate the dyn-info list +- by a remote unwinder. On ia64, this is done via a special +- unwind-table entry. Perhaps something similar can be done with +- DWARF2 unwind info. */ +- + static void + put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) + { +@@ -71,7 +64,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +diff --git a/src/x86_64/Ginit.c b/src/x86_64/Ginit.c +index a865d33..fd8d418 100644 +--- a/src/x86_64/Ginit.c ++++ b/src/x86_64/Ginit.c +@@ -49,13 +49,6 @@ static struct unw_addr_space local_addr_space; + + unw_addr_space_t unw_local_addr_space = &local_addr_space; + +-HIDDEN unw_dyn_info_list_t _U_dyn_info_list; +- +-/* XXX fix me: there is currently no way to locate the dyn-info list +- by a remote unwinder. On ia64, this is done via a special +- unwind-table entry. Perhaps something similar can be done with +- DWARF2 unwind info. */ +- + static void + put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) + { +@@ -66,7 +59,13 @@ static int + get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) + { +- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++#ifndef UNW_LOCAL_ONLY ++# pragma weak _U_dyn_info_list_addr ++ if (!_U_dyn_info_list_addr) ++ return -UNW_ENOINFO; ++#endif ++ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. ++ *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; + } + +-- +1.9.1 + From ca738c960a7c21dcfac93266f8f700dc88b67104 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 21 Jun 2020 00:18:17 +0200 Subject: [PATCH 06/43] open-iscsi: Fix build with -fno-common --- ...tes-to-support-gcc-fno-common-option.patch | 124 ++++++++++++++++++ .../patches/open-iscsi-06-Fix-attribute.patch | 25 ++++ 2 files changed, 149 insertions(+) create mode 100644 packages/sysutils/open-iscsi/patches/open-iscsi-05-Updates-to-support-gcc-fno-common-option.patch create mode 100644 packages/sysutils/open-iscsi/patches/open-iscsi-06-Fix-attribute.patch diff --git a/packages/sysutils/open-iscsi/patches/open-iscsi-05-Updates-to-support-gcc-fno-common-option.patch b/packages/sysutils/open-iscsi/patches/open-iscsi-05-Updates-to-support-gcc-fno-common-option.patch new file mode 100644 index 00000000000..d1f9c9e91ac --- /dev/null +++ b/packages/sysutils/open-iscsi/patches/open-iscsi-05-Updates-to-support-gcc-fno-common-option.patch @@ -0,0 +1,124 @@ +From a8ce860b4462fbb22634c34a5d30cd0d482acb22 Mon Sep 17 00:00:00 2001 +From: Lee Duncan +Date: Tue, 28 Jan 2020 16:36:56 -0800 +Subject: [PATCH] Updates to support gcc -fno-common option. + +This meant cleaning up the definition of some +global variables, so that they were only defined +in one place and refered to as external elsewhere. +--- + include/iscsi_err.h | 6 ++++-- + iscsiuio/configure | 2 +- + iscsiuio/configure.ac | 2 +- + iscsiuio/src/uip/uip.h | 4 ++-- + usr/iscsi_err.c | 2 ++ + usr/log.c | 1 + + usr/log.h | 2 +- + 7 files changed, 12 insertions(+), 7 deletions(-) + +diff --git a/include/iscsi_err.h b/include/iscsi_err.h +index 125f443a2f25..a08f0fbfcea6 100644 +--- a/include/iscsi_err.h ++++ b/include/iscsi_err.h +@@ -4,7 +4,7 @@ + #ifndef _ISCSI_ERR_ + #define _ISCSI_ERR_ + +-enum { ++enum iscsi_error_list { + ISCSI_SUCCESS = 0, + /* Generic error */ + ISCSI_ERR = 1, +@@ -69,7 +69,9 @@ enum { + + /* Always last. Indicates end of error code space */ + ISCSI_MAX_ERR_VAL, +-} iscsi_err; ++}; ++ ++extern enum iscsi_error_list iscsi_err; + + extern void iscsi_err_print_msg(int err); + extern char *iscsi_err_to_str(int err); +diff --git a/iscsiuio/configure b/iscsiuio/configure +index 2740598f5f87..e799c377b4ab 100755 +--- a/iscsiuio/configure ++++ b/iscsiuio/configure +@@ -22729,7 +22729,7 @@ echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + done + done + ;; +- default ) echo 'char *build_date = "'`date`'";' > src/unix/build_date.c && echo 'char *build_date;'> src/unix/build_date.h ;; ++ default ) echo 'char *build_date = "'`date`'";' > src/unix/build_date.c && echo 'extern char *build_date;'> src/unix/build_date.h ;; + esac + done + _ACEOF +diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac +index e9a5e32399ea..f51687bf56b5 100644 +--- a/iscsiuio/configure.ac ++++ b/iscsiuio/configure.ac +@@ -62,7 +62,7 @@ AC_ARG_ENABLE(debug, + fi]) + AM_CONDITIONAL([DEBUG], [test x$debug = xtrue]) + +-AC_CONFIG_COMMANDS([default],[[ echo 'char *build_date = "'`date`'";' > src/unix/build_date.c && echo 'char *build_date;'> src/unix/build_date.h]],[[]]) ++AC_CONFIG_COMMANDS([default],[[ echo 'char *build_date = "'`date`'";' > src/unix/build_date.c && echo 'extern char *build_date;'> src/unix/build_date.h]],[[]]) + + AC_PREFIX_DEFAULT() + +diff --git a/iscsiuio/src/uip/uip.h b/iscsiuio/src/uip/uip.h +index 0225f6a456f5..d8e2220bf357 100644 +--- a/iscsiuio/src/uip/uip.h ++++ b/iscsiuio/src/uip/uip.h +@@ -70,8 +70,8 @@ struct uip_stack; + typedef u16_t uip_ip4addr_t[2]; + typedef u16_t uip_ip6addr_t[8]; + +-const uip_ip6addr_t all_zeroes_addr6; +-const uip_ip4addr_t all_zeroes_addr4; ++extern const uip_ip6addr_t all_zeroes_addr6; ++extern const uip_ip4addr_t all_zeroes_addr4; + + #define ETH_BUF(buf) ((struct uip_eth_hdr *)buf) + #define VLAN_ETH_BUF(buf) ((struct uip_vlan_eth_hdr *)buf) +diff --git a/usr/iscsi_err.c b/usr/iscsi_err.c +index 4fe1c53adce0..6b6a4124458a 100644 +--- a/usr/iscsi_err.c ++++ b/usr/iscsi_err.c +@@ -21,6 +21,8 @@ + #include "iscsi_err.h" + #include "log.h" + ++enum iscsi_error_list iscsi_err; ++ + static char *iscsi_err_msgs[] = { + /* 0 */ "", + /* 1 */ "unknown error", +diff --git a/usr/log.c b/usr/log.c +index 26c61d847793..f7c542eeb191 100644 +--- a/usr/log.c ++++ b/usr/log.c +@@ -33,6 +33,7 @@ + + char *log_name; + int log_level = 0; ++struct logarea *la = NULL; + + static int log_stop_daemon = 0; + static void (*log_func)(int prio, void *priv, const char *fmt, va_list ap); +diff --git a/usr/log.h b/usr/log.h +index 486a08ea08b2..c548791e73a1 100644 +--- a/usr/log.h ++++ b/usr/log.h +@@ -64,7 +64,7 @@ struct logarea { + union semun semarg; + }; + +-struct logarea *la; ++extern struct logarea *la; + + extern int log_init(char *program_name, int size, + void (*func)(int prio, void *priv, const char *fmt, va_list ap), +-- +2.27.0 + diff --git a/packages/sysutils/open-iscsi/patches/open-iscsi-06-Fix-attribute.patch b/packages/sysutils/open-iscsi/patches/open-iscsi-06-Fix-attribute.patch new file mode 100644 index 00000000000..41d3d3c2c47 --- /dev/null +++ b/packages/sysutils/open-iscsi/patches/open-iscsi-06-Fix-attribute.patch @@ -0,0 +1,25 @@ +From 61936357ef7d796c3f4fe95782309268be9e6a31 Mon Sep 17 00:00:00 2001 +From: Jernej Skrabec +Date: Sat, 20 Jun 2020 19:37:42 +0200 +Subject: [PATCH] Fix attribute + +--- + include/iscsi_if.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/iscsi_if.h b/include/iscsi_if.h +index 20f2bc2961e9..6633bc528555 100644 +--- a/include/iscsi_if.h ++++ b/include/iscsi_if.h +@@ -327,7 +327,7 @@ struct iscsi_iface_param_info { + uint8_t iface_type; /* IPv4 or IPv6 */ + uint8_t param_type; /* iscsi_param_type */ + uint8_t value[0]; /* length sized value follows */ +-} __packed; ++} __attribute__((__packed__)); + + /* + * To keep the struct iscsi_uevent size the same for userspace code +-- +2.27.0 + From b7fa8c627bcb194b98d1f19424af0f7e060514fc Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 21 Jun 2020 00:19:01 +0200 Subject: [PATCH 07/43] linux: fix building perf with -fno-common --- ...-definition-of-traceid_list-global-v.patch | 66 +++++++++++++++++++ ...-definition-of-traceid_list-global-v.patch | 66 +++++++++++++++++++ ...-definition-of-traceid_list-global-v.patch | 66 +++++++++++++++++++ 3 files changed, 198 insertions(+) create mode 100644 packages/linux/patches/amlogic/linux-0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch create mode 100644 packages/linux/patches/default/linux-0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch create mode 100644 packages/linux/patches/raspberrypi/linux-0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch diff --git a/packages/linux/patches/amlogic/linux-0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch b/packages/linux/patches/amlogic/linux-0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch new file mode 100644 index 00000000000..5c3d2df2da7 --- /dev/null +++ b/packages/linux/patches/amlogic/linux-0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch @@ -0,0 +1,66 @@ +From 168200b6d6ea0cb5765943ec5da5b8149701f36a Mon Sep 17 00:00:00 2001 +From: Leo Yan +Date: Tue, 5 May 2020 21:36:42 +0800 +Subject: [PATCH] perf cs-etm: Move definition of 'traceid_list' global + variable from header file + +The variable 'traceid_list' is defined in the header file cs-etm.h, +if multiple C files include cs-etm.h the compiler might complaint for +multiple definition of 'traceid_list'. + +To fix multiple definition error, move the definition of 'traceid_list' +into cs-etm.c. + +Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata") +Reported-by: Thomas Backlund +Signed-off-by: Leo Yan +Reviewed-by: Mathieu Poirier +Reviewed-by: Mike Leach +Tested-by: Mike Leach +Tested-by: Thomas Backlund +Cc: Alexander Shishkin +Cc: Jiri Olsa +Cc: Mark Rutland +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Suzuki Poulouse +Cc: Tor Jeremiassen +Cc: linux-arm-kernel@lists.infradead.org +Link: http://lore.kernel.org/lkml/20200505133642.4756-1-leo.yan@linaro.org +Signed-off-by: Arnaldo Carvalho de Melo +--- + tools/perf/util/cs-etm.c | 3 +++ + tools/perf/util/cs-etm.h | 3 --- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c +index 3c802fde4954..c283223fb31f 100644 +--- a/tools/perf/util/cs-etm.c ++++ b/tools/perf/util/cs-etm.c +@@ -94,6 +94,9 @@ struct cs_etm_queue { + struct cs_etm_traceid_queue **traceid_queues; + }; + ++/* RB tree for quick conversion between traceID and metadata pointers */ ++static struct intlist *traceid_list; ++ + static int cs_etm__update_queues(struct cs_etm_auxtrace *etm); + static int cs_etm__process_queues(struct cs_etm_auxtrace *etm); + static int cs_etm__process_timeless_queues(struct cs_etm_auxtrace *etm, +diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h +index 650ecc2a6349..4ad925d6d799 100644 +--- a/tools/perf/util/cs-etm.h ++++ b/tools/perf/util/cs-etm.h +@@ -114,9 +114,6 @@ enum cs_etm_isa { + CS_ETM_ISA_T32, + }; + +-/* RB tree for quick conversion between traceID and metadata pointers */ +-struct intlist *traceid_list; +- + struct cs_etm_queue; + + struct cs_etm_packet { +-- +2.27.0 + diff --git a/packages/linux/patches/default/linux-0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch b/packages/linux/patches/default/linux-0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch new file mode 100644 index 00000000000..5c3d2df2da7 --- /dev/null +++ b/packages/linux/patches/default/linux-0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch @@ -0,0 +1,66 @@ +From 168200b6d6ea0cb5765943ec5da5b8149701f36a Mon Sep 17 00:00:00 2001 +From: Leo Yan +Date: Tue, 5 May 2020 21:36:42 +0800 +Subject: [PATCH] perf cs-etm: Move definition of 'traceid_list' global + variable from header file + +The variable 'traceid_list' is defined in the header file cs-etm.h, +if multiple C files include cs-etm.h the compiler might complaint for +multiple definition of 'traceid_list'. + +To fix multiple definition error, move the definition of 'traceid_list' +into cs-etm.c. + +Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata") +Reported-by: Thomas Backlund +Signed-off-by: Leo Yan +Reviewed-by: Mathieu Poirier +Reviewed-by: Mike Leach +Tested-by: Mike Leach +Tested-by: Thomas Backlund +Cc: Alexander Shishkin +Cc: Jiri Olsa +Cc: Mark Rutland +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Suzuki Poulouse +Cc: Tor Jeremiassen +Cc: linux-arm-kernel@lists.infradead.org +Link: http://lore.kernel.org/lkml/20200505133642.4756-1-leo.yan@linaro.org +Signed-off-by: Arnaldo Carvalho de Melo +--- + tools/perf/util/cs-etm.c | 3 +++ + tools/perf/util/cs-etm.h | 3 --- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c +index 3c802fde4954..c283223fb31f 100644 +--- a/tools/perf/util/cs-etm.c ++++ b/tools/perf/util/cs-etm.c +@@ -94,6 +94,9 @@ struct cs_etm_queue { + struct cs_etm_traceid_queue **traceid_queues; + }; + ++/* RB tree for quick conversion between traceID and metadata pointers */ ++static struct intlist *traceid_list; ++ + static int cs_etm__update_queues(struct cs_etm_auxtrace *etm); + static int cs_etm__process_queues(struct cs_etm_auxtrace *etm); + static int cs_etm__process_timeless_queues(struct cs_etm_auxtrace *etm, +diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h +index 650ecc2a6349..4ad925d6d799 100644 +--- a/tools/perf/util/cs-etm.h ++++ b/tools/perf/util/cs-etm.h +@@ -114,9 +114,6 @@ enum cs_etm_isa { + CS_ETM_ISA_T32, + }; + +-/* RB tree for quick conversion between traceID and metadata pointers */ +-struct intlist *traceid_list; +- + struct cs_etm_queue; + + struct cs_etm_packet { +-- +2.27.0 + diff --git a/packages/linux/patches/raspberrypi/linux-0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch b/packages/linux/patches/raspberrypi/linux-0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch new file mode 100644 index 00000000000..5c3d2df2da7 --- /dev/null +++ b/packages/linux/patches/raspberrypi/linux-0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch @@ -0,0 +1,66 @@ +From 168200b6d6ea0cb5765943ec5da5b8149701f36a Mon Sep 17 00:00:00 2001 +From: Leo Yan +Date: Tue, 5 May 2020 21:36:42 +0800 +Subject: [PATCH] perf cs-etm: Move definition of 'traceid_list' global + variable from header file + +The variable 'traceid_list' is defined in the header file cs-etm.h, +if multiple C files include cs-etm.h the compiler might complaint for +multiple definition of 'traceid_list'. + +To fix multiple definition error, move the definition of 'traceid_list' +into cs-etm.c. + +Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata") +Reported-by: Thomas Backlund +Signed-off-by: Leo Yan +Reviewed-by: Mathieu Poirier +Reviewed-by: Mike Leach +Tested-by: Mike Leach +Tested-by: Thomas Backlund +Cc: Alexander Shishkin +Cc: Jiri Olsa +Cc: Mark Rutland +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Suzuki Poulouse +Cc: Tor Jeremiassen +Cc: linux-arm-kernel@lists.infradead.org +Link: http://lore.kernel.org/lkml/20200505133642.4756-1-leo.yan@linaro.org +Signed-off-by: Arnaldo Carvalho de Melo +--- + tools/perf/util/cs-etm.c | 3 +++ + tools/perf/util/cs-etm.h | 3 --- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c +index 3c802fde4954..c283223fb31f 100644 +--- a/tools/perf/util/cs-etm.c ++++ b/tools/perf/util/cs-etm.c +@@ -94,6 +94,9 @@ struct cs_etm_queue { + struct cs_etm_traceid_queue **traceid_queues; + }; + ++/* RB tree for quick conversion between traceID and metadata pointers */ ++static struct intlist *traceid_list; ++ + static int cs_etm__update_queues(struct cs_etm_auxtrace *etm); + static int cs_etm__process_queues(struct cs_etm_auxtrace *etm); + static int cs_etm__process_timeless_queues(struct cs_etm_auxtrace *etm, +diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h +index 650ecc2a6349..4ad925d6d799 100644 +--- a/tools/perf/util/cs-etm.h ++++ b/tools/perf/util/cs-etm.h +@@ -114,9 +114,6 @@ enum cs_etm_isa { + CS_ETM_ISA_T32, + }; + +-/* RB tree for quick conversion between traceID and metadata pointers */ +-struct intlist *traceid_list; +- + struct cs_etm_queue; + + struct cs_etm_packet { +-- +2.27.0 + From deffe0177c5d9edc774422316d57b9359c0425f3 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 21 Jun 2020 00:19:49 +0200 Subject: [PATCH 08/43] make: Fix recursive builds --- .../make-01-disable-inheritance-of-fds.patch | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 packages/devel/make/patches/make-01-disable-inheritance-of-fds.patch diff --git a/packages/devel/make/patches/make-01-disable-inheritance-of-fds.patch b/packages/devel/make/patches/make-01-disable-inheritance-of-fds.patch new file mode 100644 index 00000000000..db2c7f8cd0d --- /dev/null +++ b/packages/devel/make/patches/make-01-disable-inheritance-of-fds.patch @@ -0,0 +1,42 @@ +From d79fe162c009788888faaf0317253b6f0cac7092 Mon Sep 17 00:00:00 2001 +From: Kevin Buettner +Date: Thu, 23 Apr 2020 17:05:34 -0400 +Subject: [SV 58232] Disable inheritance of jobserver FDs for recursive make + +A parent make will invoke a sub-make with close-on-exec disabled for +the jobserver pipe FDs. Force close-on-exec to be to be enabled in +the sub-make so the pipe is not always passed to child jobs. + +I have a test case which, when invoked with a suitable -j switch, +will hang if the recipe inherits the jobserver pipe. This test case +was inspired by a real world case in which testing GDB on Fedora +would hang due to some poorly written test GDB cases having been +passed the jobserver file descriptors. + +* src/posixos.c (jobserver_parse_auth): Call fd_noinherit() for +jobserver pipe descriptors. + +Copyright-paperwork-exempt: yes +--- + src/posixos.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/posixos.c b/src/posixos.c +index 525f292..eab175a 100644 +--- a/src/posixos.c ++++ b/src/posixos.c +@@ -145,6 +145,11 @@ jobserver_parse_auth (const char *auth) + /* When using pselect() we want the read to be non-blocking. */ + set_blocking (job_fds[0], 0); + ++ /* By default we don't send the job pipe FDs to our children. ++ See jobserver_pre_child() and jobserver_post_child(). */ ++ fd_noinherit (job_fds[0]); ++ fd_noinherit (job_fds[1]); ++ + return 1; + } + +-- +cgit v1.2.1 + From 728a16be9663647ee8ce25abb587a05293a98911 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 21 Jun 2020 00:24:09 +0200 Subject: [PATCH 09/43] binutils: Backport fixes needed for -flto combined with -fno-common This is needed mostly for libtool configuration tests https://sourceware.org/bugzilla/show_bug.cgi?id=25355 --- .../patches/binutils-backport-from-dev.patch | 2270 +++++++++++++++++ 1 file changed, 2270 insertions(+) create mode 100644 packages/devel/binutils/patches/binutils-backport-from-dev.patch diff --git a/packages/devel/binutils/patches/binutils-backport-from-dev.patch b/packages/devel/binutils/patches/binutils-backport-from-dev.patch new file mode 100644 index 00000000000..ddc1a4761b5 --- /dev/null +++ b/packages/devel/binutils/patches/binutils-backport-from-dev.patch @@ -0,0 +1,2270 @@ +From 804b7fd4fdc545a6ed18aee3d4186574861634ef Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Sun, 16 Feb 2020 11:33:15 +0000 +Subject: [PATCH] Import fixes for using the LTO plugin with nm. + + PR 25355 + +bfd: + 2020-02-13 H.J. Lu + + * plugin.c (try_load_plugin): Make plugin_list_iter an argument + and use it if it isn't NULL. Remove has_plugin_p argument. Add + a build_list_p argument. Don't search plugin_list. Short circuit + when building the plugin list. + (has_plugin): Renamed to has_plugin_list. + (bfd_plugin_set_plugin): Don't set has_plugin. + (bfd_plugin_specified_p): Check plugin_list instead. + (build_plugin_list): New function. + (load_plugin): Call build_plugin_list and use plugin_list. + + 2020-02-11 H.J. Lu + + PR binutils/25355 + * plugin.c (try_claim): Always clean up for LTO wrapper. + (try_load_plugin): Treat each object as independent. Create a + copy for plugin name. + + 2020-02-11 H.J. Lu + + * plugin.c (add_symbols): Clear plugin_data memory. + + 2020-02-10 H.J. Lu + + PR binutils/25355 + * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. + (EXECUTABLE_SUFFIX): Likewise. + * config.in: Regenerated. + * configure: Likewise. + * plugin.c (bfd_plugin_close_and_cleanup): Removed. + (plugin_list_entry): Add all_symbols_read, cleanup_handler, + gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, + real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. + (get_lto_wrapper): New. + (setup_lto_wrapper_env): Likewise. + (current_plugin): Likewise. + (register_all_symbols_read): Likewise. + (register_cleanup): Likewise. + (get_symbols): Likewise. + (add_input_file): Likewise. + (bfd_plugin_close_and_cleanup): Likewise. + (claim_file): Removed. + (register_claim_file): Set current_plugin->claim_file. + (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and + lto_syms in current_plugin. + (try_claim): Use current_plugin->claim_file. Call LTO plugin + all_symbols_read handler. Copy real symbols to plugin_data. + Call LTO plugin cleanup handler. Clean up for LTO wrapper. + (try_load_plugin): Don't reuse the previous plugin for LTO + wrapper. Set up GCC LTO wrapper if possible. Don't set + plugin_list_iter->claim_file. + (bfd_plugin_canonicalize_symtab): Use real LTO symbols if + possible. + * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and + real_syms. + +ld: + 2020-02-10 H.J. Lu + + PR binutils/25355 + * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. + * testsuite/ld-plugin/pr25355.c: New file. + * testsuite/ld-plugin/pr25355.d: Likewise. + * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile + only dump. +--- + bfd/ChangeLog | 60 +++ + bfd/config.in | 6 + + bfd/configure | 10 + + bfd/configure.ac | 6 + + bfd/plugin.c | 606 +++++++++++++++++++++++++++---- + bfd/plugin.h | 3 + + ld/ChangeLog | 12 + + ld/testsuite/ld-plugin/lto.exp | 5 + + ld/testsuite/ld-plugin/pr25355.c | 2 + + ld/testsuite/ld-plugin/pr25355.d | 4 + + ld/testsuite/lib/ld-lib.exp | 1 + + 11 files changed, 638 insertions(+), 77 deletions(-) + create mode 100644 ld/testsuite/ld-plugin/pr25355.c + create mode 100644 ld/testsuite/ld-plugin/pr25355.d + +diff --git a/bfd/config.in b/bfd/config.in +index be572969fc04..e1dc0f0c445b 100644 +--- a/bfd/config.in ++++ b/bfd/config.in +@@ -18,6 +18,9 @@ + language is requested. */ + #undef ENABLE_NLS + ++/* Suffix used for executables, if any. */ ++#undef EXECUTABLE_SUFFIX ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_ALLOCA_H + +@@ -95,6 +98,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_DLFCN_H + ++/* Does the platform use an executable suffix? */ ++#undef HAVE_EXECUTABLE_SUFFIX ++ + /* Define to 1 if you have the `fcntl' function. */ + #undef HAVE_FCNTL + +diff --git a/bfd/configure b/bfd/configure +index bc576b7894ab..7c0708e2f82c 100755 +--- a/bfd/configure ++++ b/bfd/configure +@@ -12813,6 +12813,16 @@ fi + + + ++if test -n "$EXEEXT"; then ++ ++$as_echo "#define HAVE_EXECUTABLE_SUFFIX 1" >>confdefs.h ++ ++fi ++ ++cat >>confdefs.h <<_ACEOF ++#define EXECUTABLE_SUFFIX "${EXEEXT}" ++_ACEOF ++ + + host64=false + target64=false +diff --git a/bfd/configure.ac b/bfd/configure.ac +index c5bfbd5d129c..af4d4b8c1354 100644 +--- a/bfd/configure.ac ++++ b/bfd/configure.ac +@@ -157,6 +157,12 @@ AM_MAINTAINER_MODE + AM_CONDITIONAL(GENINSRC_NEVER, false) + AM_INSTALL_LIBBFD + AC_EXEEXT ++if test -n "$EXEEXT"; then ++ AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1, ++ [Does the platform use an executable suffix?]) ++fi ++AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}", ++ [Suffix used for executables, if any.]) + + host64=false + target64=false +diff --git a/bfd/plugin.c b/bfd/plugin.c +index 537ab603110b..47c3439042c7 100644 +--- a/bfd/plugin.c ++++ b/bfd/plugin.c +@@ -69,7 +69,6 @@ dlerror (void) + + #endif /* !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) */ + +-#define bfd_plugin_close_and_cleanup _bfd_generic_close_and_cleanup + #define bfd_plugin_bfd_free_cached_info _bfd_generic_bfd_free_cached_info + #define bfd_plugin_new_section_hook _bfd_generic_new_section_hook + #define bfd_plugin_get_section_contents _bfd_generic_get_section_contents +@@ -124,13 +123,312 @@ message (int level ATTRIBUTE_UNUSED, + return LDPS_OK; + } + ++struct plugin_list_entry ++{ ++ /* These must be initialized for each IR object with LTO wrapper. */ ++ void *handle; ++ ld_plugin_claim_file_handler claim_file; ++ ld_plugin_all_symbols_read_handler all_symbols_read; ++ ld_plugin_all_symbols_read_handler cleanup_handler; ++ char *resolution_file; ++ char *resolution_option; ++ bfd *real_bfd; ++ long real_nsyms; ++ asymbol **real_syms; ++ int lto_nsyms; ++ const struct ld_plugin_symbol *lto_syms; ++ ++ struct plugin_list_entry *next; ++ ++ /* These can be reused for all IR objects. */ ++ const char *plugin_name; ++ char *gcc; ++ char *lto_wrapper; ++ char *gcc_env; ++ bfd_boolean initialized; ++}; ++ ++/* Use GCC LTO wrapper to covert LTO IR object to the real object. */ ++ ++static bfd_boolean ++get_lto_wrapper (struct plugin_list_entry *plugin) ++{ ++ struct stat st; ++ const char *real_name; ++ const char *base_name; ++ size_t length; ++ const char *target_start = NULL; ++ const char *target_end = NULL; ++ size_t target_length = 0; ++ char *gcc_name; ++ char *wrapper_name; ++ char *p; ++ char dir_seperator = '\0'; ++ char *resolution_file; ++ ++ if (plugin->initialized) ++ { ++ if (plugin->lto_wrapper) ++ { ++ resolution_file = make_temp_file (".res"); ++ if (resolution_file) ++ { ++ plugin->resolution_file = resolution_file; ++ plugin->resolution_option = concat ("-fresolution=", ++ resolution_file, NULL); ++ return TRUE; ++ } ++ else ++ { ++ /* Something is wrong. Give up. */ ++ free (plugin->gcc); ++ free (plugin->lto_wrapper); ++ free (plugin->gcc_env); ++ plugin->gcc = NULL; ++ plugin->gcc_env = NULL; ++ plugin->lto_wrapper = NULL; ++ } ++ } ++ ++ return FALSE; ++ } ++ ++ plugin->initialized = TRUE; ++ ++ /* Check for PREFIX/libexec/gcc/TARGET/VERSION/liblto_plugin.so. */ ++ real_name = lrealpath (plugin->plugin_name); ++ base_name = lbasename (real_name); ++ ++ /* The directory length in plugin pathname. */ ++ length = base_name - real_name; ++ ++ /* Skip if there is no PREFIX. */ ++ if (!length) ++ return FALSE; ++ ++ p = (char *) real_name + length - 1; ++ if (IS_DIR_SEPARATOR (*p)) ++ { ++ int level = 0; ++ for (; p != real_name; p--) ++ if (IS_DIR_SEPARATOR (*p)) ++ { ++ level++; ++ if (level == 2) ++ target_end = p; ++ else if (level == 3) ++ { ++ target_start = p + 1; ++ target_length = target_end - target_start; ++ } ++ else if (level == 5) ++ { ++ dir_seperator = *p; ++ break; ++ } ++ } ++ } ++ ++ /* Skip if there is no TARGET nor PREFIX. */ ++ if (!target_length || !dir_seperator) ++ return FALSE; ++ ++#ifdef HAVE_EXECUTABLE_SUFFIX ++# define GCC_EXECUTABLE "gcc" EXECUTABLE_SUFFIX ++# define LTO_WRAPPER_EXECUTABLE "lto-wrapper" EXECUTABLE_SUFFIX ++#else ++# define GCC_EXECUTABLE "gcc" ++# define LTO_WRAPPER_EXECUTABLE "lto-wrapper" ++#endif ++ gcc_name = bfd_malloc (length + target_length ++ + sizeof (GCC_EXECUTABLE)); ++ if (gcc_name == NULL) ++ return FALSE; ++ memcpy (gcc_name, real_name, length); ++ ++ /* Get PREFIX/bin/. */ ++ p += gcc_name - real_name; ++ memcpy (p + 1, "bin", 3); ++ p[4] = dir_seperator; ++ ++ /* Try PREFIX/bin/TARGET-gcc first. */ ++ memcpy (p + 5, target_start, target_length); ++ p[5 + target_length] = '-'; ++ memcpy (p + 5 + target_length + 1, GCC_EXECUTABLE, ++ sizeof (GCC_EXECUTABLE)); ++ if (stat (gcc_name, &st) != 0 || !S_ISREG (st.st_mode)) ++ { ++ /* Then try PREFIX/bin/gcc. */ ++ memcpy (p + 5, GCC_EXECUTABLE, sizeof (GCC_EXECUTABLE)); ++ if (stat (gcc_name, &st) != 0 || !S_ISREG (st.st_mode)) ++ { ++ free (gcc_name); ++ return FALSE; ++ } ++ } ++ ++ /* lto-wrapper should be in the same directory with LTO plugin. */ ++ wrapper_name = bfd_malloc (length + sizeof (LTO_WRAPPER_EXECUTABLE)); ++ if (wrapper_name == NULL) ++ { ++ free (gcc_name); ++ return FALSE; ++ } ++ memcpy (wrapper_name, real_name, length); ++ memcpy (wrapper_name + length, LTO_WRAPPER_EXECUTABLE, ++ sizeof (LTO_WRAPPER_EXECUTABLE)); ++ if (stat (wrapper_name, &st) == 0 && S_ISREG (st.st_mode)) ++ { ++ resolution_file = make_temp_file (".res"); ++ if (resolution_file) ++ { ++ plugin->gcc = gcc_name; ++ plugin->lto_wrapper = wrapper_name; ++ plugin->gcc_env = concat ("COLLECT_GCC=", gcc_name, NULL); ++ plugin->resolution_file = resolution_file; ++ plugin->resolution_option = concat ("-fresolution=", ++ resolution_file, NULL); ++ return TRUE; ++ } ++ } ++ ++ free (gcc_name); ++ free (wrapper_name); ++ return FALSE; ++} ++ ++/* Set environment variables for GCC LTO wrapper to covert LTO IR ++ object to the real object. */ ++ ++static int ++setup_lto_wrapper_env (struct plugin_list_entry *plugin) ++{ ++ return (putenv (plugin->gcc_env) ++ || putenv ("COLLECT_GCC_OPTIONS=")); ++} ++ ++static struct plugin_list_entry *plugin_list = NULL; ++static struct plugin_list_entry *current_plugin = NULL; ++ + /* Register a claim-file handler. */ +-static ld_plugin_claim_file_handler claim_file = NULL; + + static enum ld_plugin_status + register_claim_file (ld_plugin_claim_file_handler handler) + { +- claim_file = handler; ++ current_plugin->claim_file = handler; ++ return LDPS_OK; ++} ++ ++/* Register an all-symbols-read handler. */ ++ ++static enum ld_plugin_status ++register_all_symbols_read (ld_plugin_all_symbols_read_handler handler) ++{ ++ current_plugin->all_symbols_read = handler; ++ return LDPS_OK; ++} ++ ++/* Register a cleanup handler. */ ++ ++static enum ld_plugin_status ++register_cleanup (ld_plugin_all_symbols_read_handler handler) ++{ ++ current_plugin->cleanup_handler = handler; ++ return LDPS_OK; ++} ++ ++/* Get the symbol resolution info for a plugin-claimed input file. */ ++ ++static enum ld_plugin_status ++get_symbols (const void *handle ATTRIBUTE_UNUSED, int nsyms, ++ struct ld_plugin_symbol *syms) ++{ ++ if (syms) ++ { ++ int n; ++ for (n = 0; n < nsyms; n++) ++ { ++ switch (syms[n].def) ++ { ++ default: ++ BFD_ASSERT (0); ++ break; ++ case LDPK_UNDEF: ++ case LDPK_WEAKUNDEF: ++ syms[n].resolution = LDPR_UNDEF; ++ break; ++ case LDPK_DEF: ++ case LDPK_WEAKDEF: ++ case LDPK_COMMON: ++ /* Tell plugin that LTO symbol has references from regular ++ object code. */ ++ syms[n].resolution = LDPR_PREVAILING_DEF; ++ break; ++ } ++ } ++ } ++ ++ return LDPS_OK; ++} ++ ++/* Add a new (real) input file generated by a plugin. */ ++ ++static enum ld_plugin_status ++add_input_file (const char *pathname) ++{ ++ /* Get symbols from the real LTO object. */ ++ char **matching; ++ long real_symsize; ++ long real_nsyms; ++ asymbol **real_syms; ++ int lto_nsyms; ++ bfd_boolean lto_symbol_found = FALSE; ++ const struct ld_plugin_symbol *lto_syms; ++ bfd *rbfd; ++ int i, j; ++ ++ rbfd = bfd_openr (pathname, NULL); ++ if (!bfd_check_format_matches (rbfd, bfd_object, &matching)) ++ BFD_ASSERT (0); ++ ++ real_symsize = bfd_get_symtab_upper_bound (rbfd); ++ if (real_symsize < 0) ++ BFD_ASSERT (0); ++ ++ real_syms = (asymbol **) bfd_malloc (real_symsize); ++ if (real_syms) ++ { ++ real_nsyms = bfd_canonicalize_symtab (rbfd, real_syms); ++ if (real_nsyms < 0) ++ BFD_ASSERT (0); ++ ++ /* NB: LTO plugin may generate more than one real object from one ++ LTO IR object. We use the one which contains LTO symbols. */ ++ lto_syms = current_plugin->lto_syms; ++ lto_nsyms = current_plugin->lto_nsyms; ++ for (i = 0; i < lto_nsyms; i++) ++ for (j = 0; j < real_nsyms; j++) ++ if (real_syms[j]->name ++ && strcmp (lto_syms[i].name, real_syms[j]->name) == 0) ++ { ++ lto_symbol_found = TRUE; ++ break; ++ } ++ } ++ ++ if (lto_symbol_found) ++ { ++ current_plugin->real_nsyms = real_nsyms; ++ current_plugin->real_syms = real_syms; ++ /* NB: We can't close RBFD which own the real symbol info. */ ++ current_plugin->real_bfd = rbfd; ++ } ++ else ++ { ++ bfd_close (rbfd); ++ free (real_syms); ++ } ++ + return LDPS_OK; + } + +@@ -143,13 +441,52 @@ add_symbols (void * handle, + struct plugin_data_struct *plugin_data = + bfd_alloc (abfd, sizeof (plugin_data_struct)); + +- plugin_data->nsyms = nsyms; +- plugin_data->syms = syms; ++ if (plugin_data) ++ { ++ struct ld_plugin_symbol *sym_info; ++ char *strtab; ++ size_t sym_info_size, name_length; ++ int i; ++ ++ memset (plugin_data, 0, sizeof (*plugin_data)); ++ ++ abfd->tdata.plugin_data = plugin_data; ++ ++ /* NB: LTO symbols are owned by LTO plugin. Create a copy so ++ that we can use it in bfd_plugin_canonicalize_symtab. */ ++ sym_info_size = nsyms * sizeof (*syms); ++ ++ /* Allocate a string table */ ++ for (i = 0; i < nsyms; i++) ++ sym_info_size += strlen (syms[i].name) + 1; ++ ++ sym_info = bfd_alloc (abfd, sym_info_size); ++ if (sym_info) ++ { ++ /* Copy symbol table. */ ++ memcpy (sym_info, syms, nsyms * sizeof (*syms)); ++ ++ /* Copy symbol names in symbol table. */ ++ strtab = (char *) (sym_info + nsyms); ++ for (i = 0; i < nsyms; i++) ++ { ++ name_length = strlen (syms[i].name); ++ memcpy (strtab, syms[i].name, name_length + 1); ++ sym_info[i].name = strtab; ++ strtab += name_length + 1; ++ } ++ ++ plugin_data->nsyms = nsyms; ++ plugin_data->syms = sym_info; ++ ++ current_plugin->lto_nsyms = nsyms; ++ current_plugin->lto_syms = sym_info; ++ } ++ } + + if (nsyms != 0) + abfd->flags |= HAS_SYMS; + +- abfd->tdata.plugin_data = plugin_data; + return LDPS_OK; + } + +@@ -212,34 +549,72 @@ try_claim (bfd *abfd) + struct ld_plugin_input_file file; + + file.handle = abfd; +- if (!bfd_plugin_open_input (abfd, &file)) +- return 0; +- if (claim_file) +- claim_file (&file, &claimed); +- close (file.fd); ++ if (bfd_plugin_open_input (abfd, &file) ++ && current_plugin->claim_file) ++ { ++ current_plugin->claim_file (&file, &claimed); ++ if (claimed) ++ { ++ if (current_plugin->all_symbols_read) ++ { ++ struct plugin_data_struct *plugin_data ++ = abfd->tdata.plugin_data; ++ if (plugin_data) ++ { ++ /* Get real symbols from LTO wrapper. */ ++ current_plugin->all_symbols_read (); ++ ++ /* Copy real symbols to plugin_data. */ ++ plugin_data->real_bfd = current_plugin->real_bfd; ++ plugin_data->real_nsyms = current_plugin->real_nsyms; ++ plugin_data->real_syms = current_plugin->real_syms; ++ ++ /* Clean up LTO plugin. */ ++ if (current_plugin->cleanup_handler) ++ current_plugin->cleanup_handler (); ++ } ++ } ++ } ++ ++ close (file.fd); ++ } ++ ++ if (current_plugin->lto_wrapper) ++ { ++ /* Clean up for LTO wrapper. NB: Resolution file and option ++ have been created regardless if an IR object is claimed or ++ not. */ ++ unlink (current_plugin->resolution_file); ++ free (current_plugin->resolution_option); ++ } ++ + return claimed; + } + +-struct plugin_list_entry +-{ +- void * handle; +- ld_plugin_claim_file_handler claim_file; +- struct plugin_list_entry * next; +-}; +- +-static struct plugin_list_entry * plugin_list = NULL; +- + static int +-try_load_plugin (const char *pname, bfd *abfd, int *has_plugin_p) ++try_load_plugin (const char *pname, ++ struct plugin_list_entry *plugin_list_iter, ++ bfd *abfd, bfd_boolean build_list_p) + { + void *plugin_handle = NULL; +- struct ld_plugin_tv tv[4]; ++ struct ld_plugin_tv tv[12]; + int i; + ld_plugin_onload onload; + enum ld_plugin_status status; +- struct plugin_list_entry *plugin_list_iter; + +- *has_plugin_p = 0; ++ /* NB: Each object is independent. Reuse the previous plugin from ++ the last run will lead to wrong result. */ ++ if (current_plugin) ++ { ++ if (current_plugin->handle) ++ dlclose (current_plugin->handle); ++ memset (current_plugin, 0, ++ offsetof (struct plugin_list_entry, next)); ++ current_plugin = NULL; ++ } ++ ++ if (plugin_list_iter) ++ pname = plugin_list_iter->plugin_name; + + plugin_handle = dlopen (pname, RTLD_NOW); + if (!plugin_handle) +@@ -248,28 +623,30 @@ try_load_plugin (const char *pname, bfd *abfd, int *has_plugin_p) + return 0; + } + +- for (plugin_list_iter = plugin_list; +- plugin_list_iter; +- plugin_list_iter = plugin_list_iter->next) +- { +- if (plugin_handle == plugin_list_iter->handle) +- { +- dlclose (plugin_handle); +- if (!plugin_list_iter->claim_file) +- return 0; +- +- register_claim_file (plugin_list_iter->claim_file); +- goto have_claim_file; +- } +- } +- +- plugin_list_iter = bfd_malloc (sizeof *plugin_list_iter); + if (plugin_list_iter == NULL) +- return 0; ++ { ++ size_t length_plugin_name = strlen (pname) + 1; ++ char *plugin_name = bfd_malloc (length_plugin_name); ++ if (plugin_name == NULL) ++ return 0; ++ plugin_list_iter = bfd_malloc (sizeof *plugin_list_iter); ++ if (plugin_list_iter == NULL) ++ { ++ free (plugin_name); ++ return 0; ++ } ++ /* Make a copy of PNAME since PNAME from load_plugin () will be ++ freed. */ ++ memcpy (plugin_name, pname, length_plugin_name); ++ memset (plugin_list_iter, 0, sizeof (*plugin_list_iter)); ++ plugin_list_iter->plugin_name = plugin_name; ++ plugin_list_iter->next = plugin_list; ++ plugin_list = plugin_list_iter; ++ } ++ + plugin_list_iter->handle = plugin_handle; +- plugin_list_iter->claim_file = NULL; +- plugin_list_iter->next = plugin_list; +- plugin_list = plugin_list_iter; ++ if (build_list_p) ++ return 0; + + onload = dlsym (plugin_handle, "onload"); + if (!onload) +@@ -287,23 +664,60 @@ try_load_plugin (const char *pname, bfd *abfd, int *has_plugin_p) + tv[i].tv_tag = LDPT_ADD_SYMBOLS; + tv[i].tv_u.tv_add_symbols = add_symbols; + ++ if (get_lto_wrapper (plugin_list_iter)) ++ { ++ ++i; ++ tv[i].tv_tag = LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK; ++ tv[i].tv_u.tv_register_all_symbols_read = register_all_symbols_read; ++ ++ ++i; ++ tv[i].tv_tag = LDPT_REGISTER_CLEANUP_HOOK; ++ tv[i].tv_u.tv_register_cleanup = register_cleanup; ++ ++ ++i; ++ tv[i].tv_tag = LDPT_GET_SYMBOLS; ++ tv[i].tv_u.tv_get_symbols = get_symbols; ++ ++ ++i; ++ tv[i].tv_tag = LDPT_GET_SYMBOLS_V2; ++ tv[i].tv_u.tv_get_symbols = get_symbols; ++ ++ ++i; ++ tv[i].tv_tag = LDPT_OPTION; ++ tv[i].tv_u.tv_string = plugin_list_iter->lto_wrapper; ++ ++ ++i; ++ tv[i].tv_tag = LDPT_OPTION; ++ tv[i].tv_u.tv_string = plugin_list_iter->resolution_option; ++ ++ ++i; ++ tv[i].tv_tag = LDPT_LINKER_OUTPUT; ++ tv[i].tv_u.tv_val = LDPO_EXEC; ++ ++ ++i; ++ tv[i].tv_tag = LDPT_ADD_INPUT_FILE; ++ tv[i].tv_u.tv_add_input_file = add_input_file; ++ } ++ + ++i; + tv[i].tv_tag = LDPT_NULL; + tv[i].tv_u.tv_val = 0; + ++ current_plugin = plugin_list_iter; ++ ++ /* LTO plugin will call handler hooks to set up plugin handlers. */ + status = (*onload)(tv); + + if (status != LDPS_OK) + return 0; + +- plugin_list_iter->claim_file = claim_file; +- +-have_claim_file: +- *has_plugin_p = 1; ++ if (current_plugin->lto_wrapper ++ && setup_lto_wrapper_env (current_plugin)) ++ return 0; + + abfd->plugin_format = bfd_plugin_no; + +- if (!claim_file) ++ if (!current_plugin->claim_file) + return 0; + + if (!try_claim (abfd)) +@@ -314,8 +728,7 @@ have_claim_file: + } + + /* There may be plugin libraries in lib/bfd-plugins. */ +- +-static int has_plugin = -1; ++static int has_plugin_list = -1; + + static const bfd_target *(*ld_plugin_object_p) (bfd *); + +@@ -325,7 +738,6 @@ void + bfd_plugin_set_plugin (const char *p) + { + plugin_name = p; +- has_plugin = p != NULL; + } + + /* Return TRUE if a plugin library is used. */ +@@ -333,7 +745,7 @@ bfd_plugin_set_plugin (const char *p) + bfd_boolean + bfd_plugin_specified_p (void) + { +- return has_plugin > 0; ++ return plugin_list != NULL; + } + + /* Return TRUE if ABFD can be claimed by linker LTO plugin. */ +@@ -364,8 +776,8 @@ register_ld_plugin_object_p (const bfd_target *(*object_p) (bfd *)) + ld_plugin_object_p = object_p; + } + +-static int +-load_plugin (bfd *abfd) ++static void ++build_plugin_list (bfd *abfd) + { + /* The intent was to search ${libdir}/bfd-plugins for plugins, but + unfortunately the original implementation wasn't precisely that +@@ -374,17 +786,10 @@ load_plugin (bfd *abfd) + static const char *path[] + = { LIBDIR "/bfd-plugins", BINDIR "/../lib/bfd-plugins" }; + struct stat last_st; +- int found = 0; + unsigned int i; + +- if (!has_plugin) +- return found; +- +- if (plugin_name) +- return try_load_plugin (plugin_name, abfd, &has_plugin); +- +- if (plugin_program_name == NULL) +- return found; ++ if (has_plugin_list >= 0) ++ return; + + /* Try not to search the same dir twice, by looking at st_dev and + st_ino for the dir. If we are on a file system that always sets +@@ -419,26 +824,38 @@ load_plugin (bfd *abfd) + + full_name = concat (plugin_dir, "/", ent->d_name, NULL); + if (stat (full_name, &st) == 0 && S_ISREG (st.st_mode)) +- { +- int valid_plugin; +- +- found = try_load_plugin (full_name, abfd, &valid_plugin); +- if (has_plugin <= 0) +- has_plugin = valid_plugin; +- } ++ try_load_plugin (full_name, NULL, abfd, TRUE); + free (full_name); +- if (found) +- break; + } + closedir (d); + } + free (plugin_dir); + } +- if (found) +- break; + } + +- return found; ++ has_plugin_list = plugin_list != NULL; ++} ++ ++static int ++load_plugin (bfd *abfd) ++{ ++ struct plugin_list_entry *plugin_list_iter; ++ ++ if (plugin_name) ++ return try_load_plugin (plugin_name, plugin_list, abfd, FALSE); ++ ++ if (plugin_program_name == NULL) ++ return 0; ++ ++ build_plugin_list (abfd); ++ ++ for (plugin_list_iter = plugin_list; ++ plugin_list_iter; ++ plugin_list_iter = plugin_list_iter->next) ++ if (try_load_plugin (NULL, plugin_list_iter, abfd, FALSE)) ++ return 1; ++ ++ return 0; + } + + +@@ -562,7 +979,15 @@ bfd_plugin_canonicalize_symtab (bfd *abfd, + SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS); + static asection fake_common_section + = BFD_FAKE_SECTION (fake_common_section, NULL, "plug", 0, SEC_IS_COMMON); +- int i; ++ int i, j; ++ long real_nsyms; ++ asymbol **real_syms; ++ ++ real_syms = plugin_data->real_syms; ++ if (real_syms) ++ real_nsyms = plugin_data->real_nsyms; ++ else ++ real_nsyms = 0; + + for (i = 0; i < nsyms; i++) + { +@@ -587,6 +1012,15 @@ bfd_plugin_canonicalize_symtab (bfd *abfd, + case LDPK_DEF: + case LDPK_WEAKDEF: + s->section = &fake_section; ++ if (real_nsyms) ++ /* Use real LTO symbols if possible. */ ++ for (j = 0; j < real_nsyms; j++) ++ if (real_syms[j]->name ++ && strcmp (syms[i].name, real_syms[j]->name) == 0) ++ { ++ s->section = real_syms[j]->section; ++ break; ++ } + break; + default: + BFD_ASSERT (0); +@@ -635,6 +1069,24 @@ bfd_plugin_sizeof_headers (bfd *a ATTRIBUTE_UNUSED, + return 0; + } + ++static bfd_boolean ++bfd_plugin_close_and_cleanup (bfd *abfd) ++{ ++ struct plugin_data_struct *plugin_data; ++ ++ if (abfd->format != bfd_archive ++ && (plugin_data = abfd->tdata.plugin_data)) ++ { ++ if (plugin_data->real_bfd) ++ bfd_close (plugin_data->real_bfd); ++ ++ if (plugin_data->real_syms) ++ free (plugin_data->real_syms); ++ } ++ ++ return _bfd_generic_close_and_cleanup (abfd); ++} ++ + const bfd_target plugin_vec = + { + "plugin", /* Name. */ +diff --git a/bfd/plugin.h b/bfd/plugin.h +index 098bf0845548..05c3573933dc 100644 +--- a/bfd/plugin.h ++++ b/bfd/plugin.h +@@ -33,6 +33,9 @@ typedef struct plugin_data_struct + { + int nsyms; + const struct ld_plugin_symbol *syms; ++ bfd *real_bfd; ++ long real_nsyms; ++ asymbol **real_syms; + } + plugin_data_struct; + +diff --git a/ld/ChangeLog b/ld/ChangeLog +index a7963cc0a910..999e0f4e3355 100644 +--- a/ld/ChangeLog ++++ b/ld/ChangeLog +@@ -1,3 +1,15 @@ ++2020-02-14 Nick Clifton ++ ++ Import from the mainline: ++ 2020-02-10 H.J. Lu ++ ++ PR binutils/25355 ++ * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. ++ * testsuite/ld-plugin/pr25355.c: New file. ++ * testsuite/ld-plugin/pr25355.d: Likewise. ++ * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile ++ only dump. ++ + 2020-02-01 Nick Clifton + + * configure: Regenerate. +diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp +index 9b03b7b39773..1b44b0da3fda 100644 +--- a/ld/testsuite/ld-plugin/lto.exp ++++ b/ld/testsuite/ld-plugin/lto.exp +@@ -234,6 +234,11 @@ set lto_link_tests [list \ + [list "Build pr24406-2b.o" \ + "" "-O2 -fno-lto" \ + {pr24406-2b.c}] \ ++ [list "pr25355.o" \ ++ "" \ ++ "-flto -fno-common $lto_no_fat" \ ++ {pr25355.c} \ ++ [list [list "nm" "$plug_opt" "pr25355.d"]]] \ + ] + + if { [at_least_gcc_version 4 7] } { +diff --git a/ld/testsuite/ld-plugin/pr25355.c b/ld/testsuite/ld-plugin/pr25355.c +new file mode 100644 +index 000000000000..99f01fb5c896 +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr25355.c +@@ -0,0 +1,2 @@ ++int nm_test_var; ++int nm_test_var2 = 1234; +diff --git a/ld/testsuite/ld-plugin/pr25355.d b/ld/testsuite/ld-plugin/pr25355.d +new file mode 100644 +index 000000000000..98d10aba1cf7 +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr25355.d +@@ -0,0 +1,4 @@ ++#... ++[0-9a-f]+ B _?nm_test_var ++[0-9a-f]+ D _?nm_test_var2 ++#pass +diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp +index 6752a76483a9..e276bb589d88 100644 +--- a/ld/testsuite/lib/ld-lib.exp ++++ b/ld/testsuite/lib/ld-lib.exp +@@ -928,6 +928,7 @@ proc run_cc_link_tests { ldtests } { + + if { $binfile eq "tmpdir/" } { + # compile only ++ set binfile $objfile + } elseif { [regexp ".*\\.a$" $binfile] } { + if { ![ar_simple_create $ar $ldflags $binfile "$objfiles"] } { + set failed 1 +-- +2.27.0 + +From e2b46ba142d9901897d8189422f0bcc28e5660b8 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Wed, 19 Feb 2020 03:29:51 -0800 +Subject: [PATCH] plugin: Call dlclose before return in try_load_plugin + +Since plugin can be used only once in try_load_plugin, call dlclose +before return. + + PR binutils/25355 + * plugin.c (plugin_list_entry): Remove handle. + (try_load_plugin): Call dlclose before return. + +(cherry picked from commit dcf06b89b9129da6988878a77afdd02d3acc2e30) +--- + bfd/ChangeLog | 6 ++++++ + bfd/plugin.c | 39 ++++++++++++++++++--------------------- + 2 files changed, 24 insertions(+), 21 deletions(-) + +diff --git a/bfd/plugin.c b/bfd/plugin.c +index 47c3439042c7..93d562b9fed3 100644 +--- a/bfd/plugin.c ++++ b/bfd/plugin.c +@@ -126,7 +126,6 @@ message (int level ATTRIBUTE_UNUSED, + struct plugin_list_entry + { + /* These must be initialized for each IR object with LTO wrapper. */ +- void *handle; + ld_plugin_claim_file_handler claim_file; + ld_plugin_all_symbols_read_handler all_symbols_read; + ld_plugin_all_symbols_read_handler cleanup_handler; +@@ -596,22 +595,18 @@ try_load_plugin (const char *pname, + struct plugin_list_entry *plugin_list_iter, + bfd *abfd, bfd_boolean build_list_p) + { +- void *plugin_handle = NULL; ++ void *plugin_handle; + struct ld_plugin_tv tv[12]; + int i; + ld_plugin_onload onload; + enum ld_plugin_status status; ++ int result = 0; + + /* NB: Each object is independent. Reuse the previous plugin from + the last run will lead to wrong result. */ + if (current_plugin) +- { +- if (current_plugin->handle) +- dlclose (current_plugin->handle); +- memset (current_plugin, 0, +- offsetof (struct plugin_list_entry, next)); +- current_plugin = NULL; +- } ++ memset (current_plugin, 0, ++ offsetof (struct plugin_list_entry, next)); + + if (plugin_list_iter) + pname = plugin_list_iter->plugin_name; +@@ -628,12 +623,12 @@ try_load_plugin (const char *pname, + size_t length_plugin_name = strlen (pname) + 1; + char *plugin_name = bfd_malloc (length_plugin_name); + if (plugin_name == NULL) +- return 0; ++ goto short_circuit; + plugin_list_iter = bfd_malloc (sizeof *plugin_list_iter); + if (plugin_list_iter == NULL) + { + free (plugin_name); +- return 0; ++ goto short_circuit; + } + /* Make a copy of PNAME since PNAME from load_plugin () will be + freed. */ +@@ -644,13 +639,13 @@ try_load_plugin (const char *pname, + plugin_list = plugin_list_iter; + } + +- plugin_list_iter->handle = plugin_handle; ++ current_plugin = plugin_list_iter; + if (build_list_p) +- return 0; ++ goto short_circuit; + + onload = dlsym (plugin_handle, "onload"); + if (!onload) +- return 0; ++ goto short_circuit; + + i = 0; + tv[i].tv_tag = LDPT_MESSAGE; +@@ -703,28 +698,30 @@ try_load_plugin (const char *pname, + tv[i].tv_tag = LDPT_NULL; + tv[i].tv_u.tv_val = 0; + +- current_plugin = plugin_list_iter; +- + /* LTO plugin will call handler hooks to set up plugin handlers. */ + status = (*onload)(tv); + + if (status != LDPS_OK) +- return 0; ++ goto short_circuit; + + if (current_plugin->lto_wrapper + && setup_lto_wrapper_env (current_plugin)) +- return 0; ++ goto short_circuit; + + abfd->plugin_format = bfd_plugin_no; + + if (!current_plugin->claim_file) +- return 0; ++ goto short_circuit; + + if (!try_claim (abfd)) +- return 0; ++ goto short_circuit; + + abfd->plugin_format = bfd_plugin_yes; +- return 1; ++ result = 1; ++ ++short_circuit: ++ dlclose (plugin_handle); ++ return result; + } + + /* There may be plugin libraries in lib/bfd-plugins. */ +-- +2.27.0 + +From 42b2380cdced1f828ede6fa1c7c7d1fdf0e331ca Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Tue, 25 Feb 2020 03:30:33 -0800 +Subject: [PATCH] Don't call lto-wrapper for ar and ranlib + +Since ar and ranlib don't need to know symbol types to work properly, +we should avoid calling lto-wrapper for them to speed them up. + +bfd/ + + PR binutils/25584 + * plugin.c (need_lto_wrapper_p): New. + (bfd_plugin_set_program_name): Add an int argument to set + need_lto_wrapper_p. + (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't + set. + * plugin.h (bfd_plugin_set_program_name): Add an int argument. + +binutils/ + + PR binutils/25584 + * ar.c (main): Pass 0 to bfd_plugin_set_program_name. + * nm.c (main): Pass 1 to bfd_plugin_set_program_name. + +(cherry picked from commit ecda90163e2b0a6f0be96e3fc262c28820a27211) +--- + bfd/ChangeLog | 10 ++++++++++ + bfd/plugin.c | 22 ++++++++++++++-------- + bfd/plugin.h | 2 +- + binutils/ChangeLog | 6 ++++++ + binutils/ar.c | 2 +- + binutils/nm.c | 2 +- + 6 files changed, 33 insertions(+), 11 deletions(-) + +diff --git a/bfd/plugin.c b/bfd/plugin.c +index 93d562b9fed3..c79468fab87c 100644 +--- a/bfd/plugin.c ++++ b/bfd/plugin.c +@@ -147,6 +147,17 @@ struct plugin_list_entry + bfd_boolean initialized; + }; + ++static const char *plugin_program_name; ++static int need_lto_wrapper_p; ++ ++void ++bfd_plugin_set_program_name (const char *program_name, ++ int need_lto_wrapper) ++{ ++ plugin_program_name = program_name; ++ need_lto_wrapper_p = need_lto_wrapper; ++} ++ + /* Use GCC LTO wrapper to covert LTO IR object to the real object. */ + + static bfd_boolean +@@ -165,6 +176,9 @@ get_lto_wrapper (struct plugin_list_entry *plugin) + char dir_seperator = '\0'; + char *resolution_file; + ++ if (!need_lto_wrapper_p) ++ return FALSE; ++ + if (plugin->initialized) + { + if (plugin->lto_wrapper) +@@ -489,14 +503,6 @@ add_symbols (void * handle, + return LDPS_OK; + } + +-static const char *plugin_program_name; +- +-void +-bfd_plugin_set_program_name (const char *program_name) +-{ +- plugin_program_name = program_name; +-} +- + int + bfd_plugin_open_input (bfd *ibfd, struct ld_plugin_input_file *file) + { +diff --git a/bfd/plugin.h b/bfd/plugin.h +index 05c3573933dc..b2d5e50137f2 100644 +--- a/bfd/plugin.h ++++ b/bfd/plugin.h +@@ -21,7 +21,7 @@ + #ifndef _PLUGIN_H_ + #define _PLUGIN_H_ + +-void bfd_plugin_set_program_name (const char *); ++void bfd_plugin_set_program_name (const char *, int); + int bfd_plugin_open_input (bfd *, struct ld_plugin_input_file *); + void bfd_plugin_set_plugin (const char *); + bfd_boolean bfd_plugin_target_p (const bfd_target *); +diff --git a/binutils/ar.c b/binutils/ar.c +index 1057db9980ed..35dd51e04af4 100644 +--- a/binutils/ar.c ++++ b/binutils/ar.c +@@ -725,7 +725,7 @@ main (int argc, char **argv) + xmalloc_set_program_name (program_name); + bfd_set_error_program_name (program_name); + #if BFD_SUPPORTS_PLUGINS +- bfd_plugin_set_program_name (program_name); ++ bfd_plugin_set_program_name (program_name, 0); + #endif + + expandargv (&argc, &argv); +diff --git a/binutils/nm.c b/binutils/nm.c +index 0ee3f8838654..5b386592a615 100644 +--- a/binutils/nm.c ++++ b/binutils/nm.c +@@ -1701,7 +1701,7 @@ main (int argc, char **argv) + xmalloc_set_program_name (program_name); + bfd_set_error_program_name (program_name); + #if BFD_SUPPORTS_PLUGINS +- bfd_plugin_set_program_name (program_name); ++ bfd_plugin_set_program_name (program_name, 1); + #endif + + START_PROGRESS (program_name, 0); +-- +2.27.0 + +From e7c0ee5110c175cc8762a8d379bdf2e3405d45d3 Mon Sep 17 00:00:00 2001 +From: Martin Liska +Date: Wed, 25 Mar 2020 06:47:35 -0700 +Subject: [PATCH] Include: Sync lto-symtab.h and plugin-api.h with GCC + +2020-03-19 Martin Liska + + * lto-symtab.h (enum gcc_plugin_symbol_type): New. + (enum gcc_plugin_symbol_section_kind): Likewise. + +2020-03-19 Martin Liska + + * plugin-api.h (struct ld_plugin_symbol): Split + int def into 4 char fields. + (enum ld_plugin_symbol_type): New. + (enum ld_plugin_symbol_section_kind): New. + (enum ld_plugin_tag): Add LDPT_ADD_SYMBOLS_V2. + +(cherry picked from commit 3734bec8336f6f33927ab99460cb681035c2ca4f) +--- + include/ChangeLog | 13 +++++++++++++ + include/lto-symtab.h | 13 +++++++++++++ + include/plugin-api.h | 32 ++++++++++++++++++++++++++++++-- + 3 files changed, 56 insertions(+), 2 deletions(-) + +diff --git a/include/lto-symtab.h b/include/lto-symtab.h +index 0ce0de10121d..ef2e35f19c3e 100644 +--- a/include/lto-symtab.h ++++ b/include/lto-symtab.h +@@ -38,4 +38,17 @@ enum gcc_plugin_symbol_visibility + GCCPV_HIDDEN + }; + ++enum gcc_plugin_symbol_type ++{ ++ GCCST_UNKNOWN, ++ GCCST_FUNCTION, ++ GCCST_VARIABLE, ++}; ++ ++enum gcc_plugin_symbol_section_kind ++{ ++ GCCSSK_DEFAULT, ++ GCCSSK_BSS ++}; ++ + #endif /* GCC_LTO_SYMTAB_H */ +diff --git a/include/plugin-api.h b/include/plugin-api.h +index 09e1202df07a..f0f9667bf3b9 100644 +--- a/include/plugin-api.h ++++ b/include/plugin-api.h +@@ -87,7 +87,19 @@ struct ld_plugin_symbol + { + char *name; + char *version; +- int def; ++ /* This is for compatibility with older ABIs. The older ABI defined ++ only 'def' field. */ ++#ifdef __BIG_ENDIAN__ ++ char unused; ++ char section_kind; ++ char symbol_type; ++ char def; ++#else ++ char def; ++ char symbol_type; ++ char section_kind; ++ char unused; ++#endif + int visibility; + uint64_t size; + char *comdat_key; +@@ -123,6 +135,21 @@ enum ld_plugin_symbol_visibility + LDPV_HIDDEN + }; + ++/* The type of the symbol. */ ++ ++enum ld_plugin_symbol_type ++{ ++ LDST_UNKNOWN, ++ LDST_FUNCTION, ++ LDST_VARIABLE, ++}; ++ ++enum ld_plugin_symbol_section_kind ++{ ++ LDSSK_DEFAULT, ++ LDSSK_BSS ++}; ++ + /* How a symbol is resolved. */ + + enum ld_plugin_symbol_resolution +@@ -431,7 +458,8 @@ enum ld_plugin_tag + LDPT_GET_INPUT_SECTION_ALIGNMENT = 29, + LDPT_GET_INPUT_SECTION_SIZE = 30, + LDPT_REGISTER_NEW_INPUT_HOOK = 31, +- LDPT_GET_WRAP_SYMBOLS = 32 ++ LDPT_GET_WRAP_SYMBOLS = 32, ++ LDPT_ADD_SYMBOLS_V2 = 33 + }; + + /* The plugin transfer vector. */ +-- +2.27.0 + +From 64f5c0afcc4683f0003b60d6a5a299beb08f38de Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Wed, 25 Mar 2020 06:54:20 -0700 +Subject: [PATCH] plugin: Use LDPT_ADD_SYMBOLS_V2 to get symbol type + +Since LTO plugin may generate more than one ltrans.o file from one input +IR object as LTO wrapper ignores -flto-partition=none: + +lto-wrapper.c:608: + + 604 /* Drop arguments that we want to take from the link line. */ + 605 case OPT_flto_: + 606 case OPT_flto: + 607 case OPT_flto_partition_: + 608 continue; + +the LTO wrapper approach is not only slow but also unreliable. Since +the LTO plugin API has been extended to add LDPT_ADD_SYMBOLS_V2 with +symbol type and section kind, we can use LDPT_ADD_SYMBOLS_V2 to get +symbol type, instead of invoking the LTO wrapper. + + PR binutils/25640 + * plugin.c (plugin_list_entry): Add has_symbol_type. + (add_symbols_v2): New function. + (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin + provides symbol type. + (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2. + (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if + available. + +(cherry picked from commit c3a1714ce7806002726a60c0db09371425fe3097) +--- + bfd/ChangeLog | 11 +++++++++ + bfd/plugin.c | 66 ++++++++++++++++++++++++++++++++++++++++----------- + 2 files changed, 63 insertions(+), 14 deletions(-) + +diff --git a/bfd/plugin.c b/bfd/plugin.c +index c79468fab87c..0f045372b7e0 100644 +--- a/bfd/plugin.c ++++ b/bfd/plugin.c +@@ -136,6 +136,7 @@ struct plugin_list_entry + asymbol **real_syms; + int lto_nsyms; + const struct ld_plugin_symbol *lto_syms; ++ bfd_boolean has_symbol_type; + + struct plugin_list_entry *next; + +@@ -503,6 +504,14 @@ add_symbols (void * handle, + return LDPS_OK; + } + ++static enum ld_plugin_status ++add_symbols_v2 (void *handle, int nsyms, ++ const struct ld_plugin_symbol *syms) ++{ ++ current_plugin->has_symbol_type = TRUE; ++ return add_symbols (handle, nsyms, syms); ++} ++ + int + bfd_plugin_open_input (bfd *ibfd, struct ld_plugin_input_file *file) + { +@@ -560,7 +569,8 @@ try_claim (bfd *abfd) + current_plugin->claim_file (&file, &claimed); + if (claimed) + { +- if (current_plugin->all_symbols_read) ++ if (current_plugin->all_symbols_read ++ && !current_plugin->has_symbol_type) + { + struct plugin_data_struct *plugin_data + = abfd->tdata.plugin_data; +@@ -602,7 +612,7 @@ try_load_plugin (const char *pname, + bfd *abfd, bfd_boolean build_list_p) + { + void *plugin_handle; +- struct ld_plugin_tv tv[12]; ++ struct ld_plugin_tv tv[13]; + int i; + ld_plugin_onload onload; + enum ld_plugin_status status; +@@ -665,6 +675,10 @@ try_load_plugin (const char *pname, + tv[i].tv_tag = LDPT_ADD_SYMBOLS; + tv[i].tv_u.tv_add_symbols = add_symbols; + ++ ++i; ++ tv[i].tv_tag = LDPT_ADD_SYMBOLS_V2; ++ tv[i].tv_u.tv_add_symbols = add_symbols_v2; ++ + if (get_lto_wrapper (plugin_list_iter)) + { + ++i; +@@ -977,9 +991,15 @@ bfd_plugin_canonicalize_symtab (bfd *abfd, + struct plugin_data_struct *plugin_data = abfd->tdata.plugin_data; + long nsyms = plugin_data->nsyms; + const struct ld_plugin_symbol *syms = plugin_data->syms; +- static asection fake_section +- = BFD_FAKE_SECTION (fake_section, NULL, "plug", 0, ++ static asection fake_text_section ++ = BFD_FAKE_SECTION (fake_text_section, NULL, "plug", 0, + SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS); ++ static asection fake_data_section ++ = BFD_FAKE_SECTION (fake_data_section, NULL, "plug", 0, ++ SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS); ++ static asection fake_bss_section ++ = BFD_FAKE_SECTION (fake_bss_section, NULL, "plug", 0, ++ SEC_ALLOC); + static asection fake_common_section + = BFD_FAKE_SECTION (fake_common_section, NULL, "plug", 0, SEC_IS_COMMON); + int i, j; +@@ -1014,16 +1034,34 @@ bfd_plugin_canonicalize_symtab (bfd *abfd, + break; + case LDPK_DEF: + case LDPK_WEAKDEF: +- s->section = &fake_section; +- if (real_nsyms) +- /* Use real LTO symbols if possible. */ +- for (j = 0; j < real_nsyms; j++) +- if (real_syms[j]->name +- && strcmp (syms[i].name, real_syms[j]->name) == 0) +- { +- s->section = real_syms[j]->section; +- break; +- } ++ if (current_plugin->has_symbol_type) ++ switch (syms[i].symbol_type) ++ { ++ case LDST_UNKNOWN: ++ /* What is the best fake section for LDST_UNKNOWN? */ ++ case LDST_FUNCTION: ++ s->section = &fake_text_section; ++ break; ++ case LDST_VARIABLE: ++ if (syms[i].section_kind == LDSSK_BSS) ++ s->section = &fake_bss_section; ++ else ++ s->section = &fake_data_section; ++ break; ++ } ++ else ++ { ++ s->section = &fake_text_section; ++ if (real_nsyms) ++ /* Use real LTO symbols if possible. */ ++ for (j = 0; j < real_nsyms; j++) ++ if (real_syms[j]->name ++ && strcmp (syms[i].name, real_syms[j]->name) == 0) ++ { ++ s->section = real_syms[j]->section; ++ break; ++ } ++ } + break; + default: + BFD_ASSERT (0); +-- +2.27.0 + +From 23820109ced73d231b69ea6fa9a85b743d7843c8 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Wed, 25 Mar 2020 06:58:19 -0700 +Subject: [PATCH] plugin: Don't invoke LTO-wrapper + +Don't invoke LTO-wrapper since the LTO wrapper approach is not only +slow but also unreliable. For GCC 10 or newer, LDPT_ADD_SYMBOLS_V2 +will be used. + +bfd/ + + * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed. + (EXECUTABLE_SUFFIX): Likewise. + * config.in: Regenerated. + * configure: Likewise. + * plugin.c (bfd_plugin_close_and_cleanup): Defined as + _bfd_generic_close_and_cleanup. + (plugin_list_entry): Remove resolution_file, resolution_option, + real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc, + lto_wrapper, gcc_env and initialized, + (need_lto_wrapper_p): Removed. + (get_lto_wrapper): Likewise. + (setup_lto_wrapper_env): Likewise. + (register_all_symbols_read): Likewise. + (egister_cleanup): Likewise. + (get_symbols): Likewise. + (add_input_file): Likewise. + (bfd_plugin_set_program_name): Remove need_lto_wrapper. + (add_symbols): Updated. + (try_claim): Likewise. + (try_load_plugin): Likewise. + (bfd_plugin_canonicalize_symtab): Likewise. + * plugin.h (bfd_plugin_set_program_name): Remove int argument. + (plugin_data_struct): Remove real_bfd, real_nsyms and + real_syms. + +binutils/ + + * ar.c (main): Update bfd_plugin_set_program_name call. + * nm.c (main): Likewise. + +ld/ + + * testsuite/ld-plugin/lto.exp (lto_link_tests): Run PR ld/25355 + test only for GCC 10 or newer. + +(cherry picked from commit 3d98c46092341c1373d960d0a66ca502d5b7ee7f) +--- + bfd/ChangeLog | 27 ++ + bfd/config.in | 6 - + bfd/configure | 10 - + bfd/configure.ac | 6 - + bfd/plugin.c | 453 +-------------------------------- + bfd/plugin.h | 5 +- + binutils/ChangeLog | 5 + + binutils/ar.c | 2 +- + binutils/nm.c | 2 +- + ld/ChangeLog | 5 + + ld/testsuite/ld-plugin/lto.exp | 15 +- + 11 files changed, 60 insertions(+), 476 deletions(-) + +diff --git a/bfd/config.in b/bfd/config.in +index e1dc0f0c445b..be572969fc04 100644 +--- a/bfd/config.in ++++ b/bfd/config.in +@@ -18,9 +18,6 @@ + language is requested. */ + #undef ENABLE_NLS + +-/* Suffix used for executables, if any. */ +-#undef EXECUTABLE_SUFFIX +- + /* Define to 1 if you have the header file. */ + #undef HAVE_ALLOCA_H + +@@ -98,9 +95,6 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_DLFCN_H + +-/* Does the platform use an executable suffix? */ +-#undef HAVE_EXECUTABLE_SUFFIX +- + /* Define to 1 if you have the `fcntl' function. */ + #undef HAVE_FCNTL + +diff --git a/bfd/configure b/bfd/configure +index 7c0708e2f82c..bc576b7894ab 100755 +--- a/bfd/configure ++++ b/bfd/configure +@@ -12813,16 +12813,6 @@ fi + + + +-if test -n "$EXEEXT"; then +- +-$as_echo "#define HAVE_EXECUTABLE_SUFFIX 1" >>confdefs.h +- +-fi +- +-cat >>confdefs.h <<_ACEOF +-#define EXECUTABLE_SUFFIX "${EXEEXT}" +-_ACEOF +- + + host64=false + target64=false +diff --git a/bfd/configure.ac b/bfd/configure.ac +index af4d4b8c1354..c5bfbd5d129c 100644 +--- a/bfd/configure.ac ++++ b/bfd/configure.ac +@@ -157,12 +157,6 @@ AM_MAINTAINER_MODE + AM_CONDITIONAL(GENINSRC_NEVER, false) + AM_INSTALL_LIBBFD + AC_EXEEXT +-if test -n "$EXEEXT"; then +- AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1, +- [Does the platform use an executable suffix?]) +-fi +-AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}", +- [Suffix used for executables, if any.]) + + host64=false + target64=false +diff --git a/bfd/plugin.c b/bfd/plugin.c +index 0f045372b7e0..b2b1630e355c 100644 +--- a/bfd/plugin.c ++++ b/bfd/plugin.c +@@ -69,6 +69,7 @@ dlerror (void) + + #endif /* !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) */ + ++#define bfd_plugin_close_and_cleanup _bfd_generic_close_and_cleanup + #define bfd_plugin_bfd_free_cached_info _bfd_generic_bfd_free_cached_info + #define bfd_plugin_new_section_hook _bfd_generic_new_section_hook + #define bfd_plugin_get_section_contents _bfd_generic_get_section_contents +@@ -129,196 +130,20 @@ struct plugin_list_entry + ld_plugin_claim_file_handler claim_file; + ld_plugin_all_symbols_read_handler all_symbols_read; + ld_plugin_all_symbols_read_handler cleanup_handler; +- char *resolution_file; +- char *resolution_option; +- bfd *real_bfd; +- long real_nsyms; +- asymbol **real_syms; +- int lto_nsyms; +- const struct ld_plugin_symbol *lto_syms; + bfd_boolean has_symbol_type; + + struct plugin_list_entry *next; + + /* These can be reused for all IR objects. */ + const char *plugin_name; +- char *gcc; +- char *lto_wrapper; +- char *gcc_env; +- bfd_boolean initialized; + }; + + static const char *plugin_program_name; +-static int need_lto_wrapper_p; + + void +-bfd_plugin_set_program_name (const char *program_name, +- int need_lto_wrapper) ++bfd_plugin_set_program_name (const char *program_name) + { + plugin_program_name = program_name; +- need_lto_wrapper_p = need_lto_wrapper; +-} +- +-/* Use GCC LTO wrapper to covert LTO IR object to the real object. */ +- +-static bfd_boolean +-get_lto_wrapper (struct plugin_list_entry *plugin) +-{ +- struct stat st; +- const char *real_name; +- const char *base_name; +- size_t length; +- const char *target_start = NULL; +- const char *target_end = NULL; +- size_t target_length = 0; +- char *gcc_name; +- char *wrapper_name; +- char *p; +- char dir_seperator = '\0'; +- char *resolution_file; +- +- if (!need_lto_wrapper_p) +- return FALSE; +- +- if (plugin->initialized) +- { +- if (plugin->lto_wrapper) +- { +- resolution_file = make_temp_file (".res"); +- if (resolution_file) +- { +- plugin->resolution_file = resolution_file; +- plugin->resolution_option = concat ("-fresolution=", +- resolution_file, NULL); +- return TRUE; +- } +- else +- { +- /* Something is wrong. Give up. */ +- free (plugin->gcc); +- free (plugin->lto_wrapper); +- free (plugin->gcc_env); +- plugin->gcc = NULL; +- plugin->gcc_env = NULL; +- plugin->lto_wrapper = NULL; +- } +- } +- +- return FALSE; +- } +- +- plugin->initialized = TRUE; +- +- /* Check for PREFIX/libexec/gcc/TARGET/VERSION/liblto_plugin.so. */ +- real_name = lrealpath (plugin->plugin_name); +- base_name = lbasename (real_name); +- +- /* The directory length in plugin pathname. */ +- length = base_name - real_name; +- +- /* Skip if there is no PREFIX. */ +- if (!length) +- return FALSE; +- +- p = (char *) real_name + length - 1; +- if (IS_DIR_SEPARATOR (*p)) +- { +- int level = 0; +- for (; p != real_name; p--) +- if (IS_DIR_SEPARATOR (*p)) +- { +- level++; +- if (level == 2) +- target_end = p; +- else if (level == 3) +- { +- target_start = p + 1; +- target_length = target_end - target_start; +- } +- else if (level == 5) +- { +- dir_seperator = *p; +- break; +- } +- } +- } +- +- /* Skip if there is no TARGET nor PREFIX. */ +- if (!target_length || !dir_seperator) +- return FALSE; +- +-#ifdef HAVE_EXECUTABLE_SUFFIX +-# define GCC_EXECUTABLE "gcc" EXECUTABLE_SUFFIX +-# define LTO_WRAPPER_EXECUTABLE "lto-wrapper" EXECUTABLE_SUFFIX +-#else +-# define GCC_EXECUTABLE "gcc" +-# define LTO_WRAPPER_EXECUTABLE "lto-wrapper" +-#endif +- gcc_name = bfd_malloc (length + target_length +- + sizeof (GCC_EXECUTABLE)); +- if (gcc_name == NULL) +- return FALSE; +- memcpy (gcc_name, real_name, length); +- +- /* Get PREFIX/bin/. */ +- p += gcc_name - real_name; +- memcpy (p + 1, "bin", 3); +- p[4] = dir_seperator; +- +- /* Try PREFIX/bin/TARGET-gcc first. */ +- memcpy (p + 5, target_start, target_length); +- p[5 + target_length] = '-'; +- memcpy (p + 5 + target_length + 1, GCC_EXECUTABLE, +- sizeof (GCC_EXECUTABLE)); +- if (stat (gcc_name, &st) != 0 || !S_ISREG (st.st_mode)) +- { +- /* Then try PREFIX/bin/gcc. */ +- memcpy (p + 5, GCC_EXECUTABLE, sizeof (GCC_EXECUTABLE)); +- if (stat (gcc_name, &st) != 0 || !S_ISREG (st.st_mode)) +- { +- free (gcc_name); +- return FALSE; +- } +- } +- +- /* lto-wrapper should be in the same directory with LTO plugin. */ +- wrapper_name = bfd_malloc (length + sizeof (LTO_WRAPPER_EXECUTABLE)); +- if (wrapper_name == NULL) +- { +- free (gcc_name); +- return FALSE; +- } +- memcpy (wrapper_name, real_name, length); +- memcpy (wrapper_name + length, LTO_WRAPPER_EXECUTABLE, +- sizeof (LTO_WRAPPER_EXECUTABLE)); +- if (stat (wrapper_name, &st) == 0 && S_ISREG (st.st_mode)) +- { +- resolution_file = make_temp_file (".res"); +- if (resolution_file) +- { +- plugin->gcc = gcc_name; +- plugin->lto_wrapper = wrapper_name; +- plugin->gcc_env = concat ("COLLECT_GCC=", gcc_name, NULL); +- plugin->resolution_file = resolution_file; +- plugin->resolution_option = concat ("-fresolution=", +- resolution_file, NULL); +- return TRUE; +- } +- } +- +- free (gcc_name); +- free (wrapper_name); +- return FALSE; +-} +- +-/* Set environment variables for GCC LTO wrapper to covert LTO IR +- object to the real object. */ +- +-static int +-setup_lto_wrapper_env (struct plugin_list_entry *plugin) +-{ +- return (putenv (plugin->gcc_env) +- || putenv ("COLLECT_GCC_OPTIONS=")); + } + + static struct plugin_list_entry *plugin_list = NULL; +@@ -333,119 +158,6 @@ register_claim_file (ld_plugin_claim_file_handler handler) + return LDPS_OK; + } + +-/* Register an all-symbols-read handler. */ +- +-static enum ld_plugin_status +-register_all_symbols_read (ld_plugin_all_symbols_read_handler handler) +-{ +- current_plugin->all_symbols_read = handler; +- return LDPS_OK; +-} +- +-/* Register a cleanup handler. */ +- +-static enum ld_plugin_status +-register_cleanup (ld_plugin_all_symbols_read_handler handler) +-{ +- current_plugin->cleanup_handler = handler; +- return LDPS_OK; +-} +- +-/* Get the symbol resolution info for a plugin-claimed input file. */ +- +-static enum ld_plugin_status +-get_symbols (const void *handle ATTRIBUTE_UNUSED, int nsyms, +- struct ld_plugin_symbol *syms) +-{ +- if (syms) +- { +- int n; +- for (n = 0; n < nsyms; n++) +- { +- switch (syms[n].def) +- { +- default: +- BFD_ASSERT (0); +- break; +- case LDPK_UNDEF: +- case LDPK_WEAKUNDEF: +- syms[n].resolution = LDPR_UNDEF; +- break; +- case LDPK_DEF: +- case LDPK_WEAKDEF: +- case LDPK_COMMON: +- /* Tell plugin that LTO symbol has references from regular +- object code. */ +- syms[n].resolution = LDPR_PREVAILING_DEF; +- break; +- } +- } +- } +- +- return LDPS_OK; +-} +- +-/* Add a new (real) input file generated by a plugin. */ +- +-static enum ld_plugin_status +-add_input_file (const char *pathname) +-{ +- /* Get symbols from the real LTO object. */ +- char **matching; +- long real_symsize; +- long real_nsyms; +- asymbol **real_syms; +- int lto_nsyms; +- bfd_boolean lto_symbol_found = FALSE; +- const struct ld_plugin_symbol *lto_syms; +- bfd *rbfd; +- int i, j; +- +- rbfd = bfd_openr (pathname, NULL); +- if (!bfd_check_format_matches (rbfd, bfd_object, &matching)) +- BFD_ASSERT (0); +- +- real_symsize = bfd_get_symtab_upper_bound (rbfd); +- if (real_symsize < 0) +- BFD_ASSERT (0); +- +- real_syms = (asymbol **) bfd_malloc (real_symsize); +- if (real_syms) +- { +- real_nsyms = bfd_canonicalize_symtab (rbfd, real_syms); +- if (real_nsyms < 0) +- BFD_ASSERT (0); +- +- /* NB: LTO plugin may generate more than one real object from one +- LTO IR object. We use the one which contains LTO symbols. */ +- lto_syms = current_plugin->lto_syms; +- lto_nsyms = current_plugin->lto_nsyms; +- for (i = 0; i < lto_nsyms; i++) +- for (j = 0; j < real_nsyms; j++) +- if (real_syms[j]->name +- && strcmp (lto_syms[i].name, real_syms[j]->name) == 0) +- { +- lto_symbol_found = TRUE; +- break; +- } +- } +- +- if (lto_symbol_found) +- { +- current_plugin->real_nsyms = real_nsyms; +- current_plugin->real_syms = real_syms; +- /* NB: We can't close RBFD which own the real symbol info. */ +- current_plugin->real_bfd = rbfd; +- } +- else +- { +- bfd_close (rbfd); +- free (real_syms); +- } +- +- return LDPS_OK; +-} +- + static enum ld_plugin_status + add_symbols (void * handle, + int nsyms, +@@ -455,52 +167,16 @@ add_symbols (void * handle, + struct plugin_data_struct *plugin_data = + bfd_alloc (abfd, sizeof (plugin_data_struct)); + +- if (plugin_data) +- { +- struct ld_plugin_symbol *sym_info; +- char *strtab; +- size_t sym_info_size, name_length; +- int i; ++ if (!plugin_data) ++ return LDPS_ERR; + +- memset (plugin_data, 0, sizeof (*plugin_data)); +- +- abfd->tdata.plugin_data = plugin_data; +- +- /* NB: LTO symbols are owned by LTO plugin. Create a copy so +- that we can use it in bfd_plugin_canonicalize_symtab. */ +- sym_info_size = nsyms * sizeof (*syms); +- +- /* Allocate a string table */ +- for (i = 0; i < nsyms; i++) +- sym_info_size += strlen (syms[i].name) + 1; +- +- sym_info = bfd_alloc (abfd, sym_info_size); +- if (sym_info) +- { +- /* Copy symbol table. */ +- memcpy (sym_info, syms, nsyms * sizeof (*syms)); +- +- /* Copy symbol names in symbol table. */ +- strtab = (char *) (sym_info + nsyms); +- for (i = 0; i < nsyms; i++) +- { +- name_length = strlen (syms[i].name); +- memcpy (strtab, syms[i].name, name_length + 1); +- sym_info[i].name = strtab; +- strtab += name_length + 1; +- } +- +- plugin_data->nsyms = nsyms; +- plugin_data->syms = sym_info; +- +- current_plugin->lto_nsyms = nsyms; +- current_plugin->lto_syms = sym_info; +- } +- } ++ plugin_data->nsyms = nsyms; ++ plugin_data->syms = syms; + + if (nsyms != 0) + abfd->flags |= HAS_SYMS; + ++ abfd->tdata.plugin_data = plugin_data; + return LDPS_OK; + } + +@@ -567,42 +243,9 @@ try_claim (bfd *abfd) + && current_plugin->claim_file) + { + current_plugin->claim_file (&file, &claimed); +- if (claimed) +- { +- if (current_plugin->all_symbols_read +- && !current_plugin->has_symbol_type) +- { +- struct plugin_data_struct *plugin_data +- = abfd->tdata.plugin_data; +- if (plugin_data) +- { +- /* Get real symbols from LTO wrapper. */ +- current_plugin->all_symbols_read (); +- +- /* Copy real symbols to plugin_data. */ +- plugin_data->real_bfd = current_plugin->real_bfd; +- plugin_data->real_nsyms = current_plugin->real_nsyms; +- plugin_data->real_syms = current_plugin->real_syms; +- +- /* Clean up LTO plugin. */ +- if (current_plugin->cleanup_handler) +- current_plugin->cleanup_handler (); +- } +- } +- } +- + close (file.fd); + } + +- if (current_plugin->lto_wrapper) +- { +- /* Clean up for LTO wrapper. NB: Resolution file and option +- have been created regardless if an IR object is claimed or +- not. */ +- unlink (current_plugin->resolution_file); +- free (current_plugin->resolution_option); +- } +- + return claimed; + } + +@@ -612,7 +255,7 @@ try_load_plugin (const char *pname, + bfd *abfd, bfd_boolean build_list_p) + { + void *plugin_handle; +- struct ld_plugin_tv tv[13]; ++ struct ld_plugin_tv tv[5]; + int i; + ld_plugin_onload onload; + enum ld_plugin_status status; +@@ -679,41 +322,6 @@ try_load_plugin (const char *pname, + tv[i].tv_tag = LDPT_ADD_SYMBOLS_V2; + tv[i].tv_u.tv_add_symbols = add_symbols_v2; + +- if (get_lto_wrapper (plugin_list_iter)) +- { +- ++i; +- tv[i].tv_tag = LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK; +- tv[i].tv_u.tv_register_all_symbols_read = register_all_symbols_read; +- +- ++i; +- tv[i].tv_tag = LDPT_REGISTER_CLEANUP_HOOK; +- tv[i].tv_u.tv_register_cleanup = register_cleanup; +- +- ++i; +- tv[i].tv_tag = LDPT_GET_SYMBOLS; +- tv[i].tv_u.tv_get_symbols = get_symbols; +- +- ++i; +- tv[i].tv_tag = LDPT_GET_SYMBOLS_V2; +- tv[i].tv_u.tv_get_symbols = get_symbols; +- +- ++i; +- tv[i].tv_tag = LDPT_OPTION; +- tv[i].tv_u.tv_string = plugin_list_iter->lto_wrapper; +- +- ++i; +- tv[i].tv_tag = LDPT_OPTION; +- tv[i].tv_u.tv_string = plugin_list_iter->resolution_option; +- +- ++i; +- tv[i].tv_tag = LDPT_LINKER_OUTPUT; +- tv[i].tv_u.tv_val = LDPO_EXEC; +- +- ++i; +- tv[i].tv_tag = LDPT_ADD_INPUT_FILE; +- tv[i].tv_u.tv_add_input_file = add_input_file; +- } +- + ++i; + tv[i].tv_tag = LDPT_NULL; + tv[i].tv_u.tv_val = 0; +@@ -724,10 +332,6 @@ try_load_plugin (const char *pname, + if (status != LDPS_OK) + goto short_circuit; + +- if (current_plugin->lto_wrapper +- && setup_lto_wrapper_env (current_plugin)) +- goto short_circuit; +- + abfd->plugin_format = bfd_plugin_no; + + if (!current_plugin->claim_file) +@@ -1002,15 +606,7 @@ bfd_plugin_canonicalize_symtab (bfd *abfd, + SEC_ALLOC); + static asection fake_common_section + = BFD_FAKE_SECTION (fake_common_section, NULL, "plug", 0, SEC_IS_COMMON); +- int i, j; +- long real_nsyms; +- asymbol **real_syms; +- +- real_syms = plugin_data->real_syms; +- if (real_syms) +- real_nsyms = plugin_data->real_nsyms; +- else +- real_nsyms = 0; ++ int i; + + for (i = 0; i < nsyms; i++) + { +@@ -1050,18 +646,7 @@ bfd_plugin_canonicalize_symtab (bfd *abfd, + break; + } + else +- { +- s->section = &fake_text_section; +- if (real_nsyms) +- /* Use real LTO symbols if possible. */ +- for (j = 0; j < real_nsyms; j++) +- if (real_syms[j]->name +- && strcmp (syms[i].name, real_syms[j]->name) == 0) +- { +- s->section = real_syms[j]->section; +- break; +- } +- } ++ s->section = &fake_text_section; + break; + default: + BFD_ASSERT (0); +@@ -1110,24 +695,6 @@ bfd_plugin_sizeof_headers (bfd *a ATTRIBUTE_UNUSED, + return 0; + } + +-static bfd_boolean +-bfd_plugin_close_and_cleanup (bfd *abfd) +-{ +- struct plugin_data_struct *plugin_data; +- +- if (abfd->format != bfd_archive +- && (plugin_data = abfd->tdata.plugin_data)) +- { +- if (plugin_data->real_bfd) +- bfd_close (plugin_data->real_bfd); +- +- if (plugin_data->real_syms) +- free (plugin_data->real_syms); +- } +- +- return _bfd_generic_close_and_cleanup (abfd); +-} +- + const bfd_target plugin_vec = + { + "plugin", /* Name. */ +diff --git a/bfd/plugin.h b/bfd/plugin.h +index b2d5e50137f2..098bf0845548 100644 +--- a/bfd/plugin.h ++++ b/bfd/plugin.h +@@ -21,7 +21,7 @@ + #ifndef _PLUGIN_H_ + #define _PLUGIN_H_ + +-void bfd_plugin_set_program_name (const char *, int); ++void bfd_plugin_set_program_name (const char *); + int bfd_plugin_open_input (bfd *, struct ld_plugin_input_file *); + void bfd_plugin_set_plugin (const char *); + bfd_boolean bfd_plugin_target_p (const bfd_target *); +@@ -33,9 +33,6 @@ typedef struct plugin_data_struct + { + int nsyms; + const struct ld_plugin_symbol *syms; +- bfd *real_bfd; +- long real_nsyms; +- asymbol **real_syms; + } + plugin_data_struct; + +diff --git a/binutils/ar.c b/binutils/ar.c +index 35dd51e04af4..1057db9980ed 100644 +--- a/binutils/ar.c ++++ b/binutils/ar.c +@@ -725,7 +725,7 @@ main (int argc, char **argv) + xmalloc_set_program_name (program_name); + bfd_set_error_program_name (program_name); + #if BFD_SUPPORTS_PLUGINS +- bfd_plugin_set_program_name (program_name, 0); ++ bfd_plugin_set_program_name (program_name); + #endif + + expandargv (&argc, &argv); +diff --git a/binutils/nm.c b/binutils/nm.c +index 5b386592a615..0ee3f8838654 100644 +--- a/binutils/nm.c ++++ b/binutils/nm.c +@@ -1701,7 +1701,7 @@ main (int argc, char **argv) + xmalloc_set_program_name (program_name); + bfd_set_error_program_name (program_name); + #if BFD_SUPPORTS_PLUGINS +- bfd_plugin_set_program_name (program_name, 1); ++ bfd_plugin_set_program_name (program_name); + #endif + + START_PROGRESS (program_name, 0); +diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp +index 1b44b0da3fda..3f1d804223d2 100644 +--- a/ld/testsuite/ld-plugin/lto.exp ++++ b/ld/testsuite/ld-plugin/lto.exp +@@ -234,13 +234,18 @@ set lto_link_tests [list \ + [list "Build pr24406-2b.o" \ + "" "-O2 -fno-lto" \ + {pr24406-2b.c}] \ +- [list "pr25355.o" \ +- "" \ +- "-flto -fno-common $lto_no_fat" \ +- {pr25355.c} \ +- [list [list "nm" "$plug_opt" "pr25355.d"]]] \ + ] + ++if { [at_least_gcc_version 10 0] } { ++ set lto_link_tests [concat $lto_link_tests [list \ ++ [list "pr25355.o" \ ++ "" \ ++ "-flto -fno-common $lto_no_fat" \ ++ {pr25355.c} \ ++ [list [list "nm" "$plug_opt" "pr25355.d"]]] \ ++ ]] ++} ++ + if { [at_least_gcc_version 4 7] } { + set lto_link_tests [concat $lto_link_tests [list \ + [list "Compile PR ld/12942 (1)" \ +-- +2.27.0 + From fc2aa688a6669c8ebf7363efe7910bb23eeab675 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 21 Jun 2020 03:14:57 +0100 Subject: [PATCH 10/43] dtc: update to dtc-1.6.0 --- packages/tools/dtc/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tools/dtc/package.mk b/packages/tools/dtc/package.mk index 2b84cc7fcd8..a9c0a3a72fa 100644 --- a/packages/tools/dtc/package.mk +++ b/packages/tools/dtc/package.mk @@ -3,8 +3,8 @@ # Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv) PKG_NAME="dtc" -PKG_VERSION="1.5.1" -PKG_SHA256="c7a565ea4ea6d2b1fc866698940ee33a303bb6b59076167b0374f125ae2a8420" +PKG_VERSION="1.6.0" +PKG_SHA256="af720893485b02441f8812773484b286f969d1b8c98769d435a75c6ad524104b" PKG_LICENSE="GPL" PKG_SITE="https://git.kernel.org/pub/scm/utils/dtc/dtc.git/" PKG_URL="https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/$PKG_VERSION.tar.gz" From 80c1c21865e24e904214a5bc1e931485f5986687 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 21 Jun 2020 03:29:16 +0100 Subject: [PATCH 11/43] intel-vaapi-driver: update to intel-vaapi-driver-2.4.1 --- packages/multimedia/intel-vaapi-driver/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/multimedia/intel-vaapi-driver/package.mk b/packages/multimedia/intel-vaapi-driver/package.mk index 3001c633a4a..0b3b5bd49ed 100644 --- a/packages/multimedia/intel-vaapi-driver/package.mk +++ b/packages/multimedia/intel-vaapi-driver/package.mk @@ -3,8 +3,8 @@ # Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv) PKG_NAME="intel-vaapi-driver" -PKG_VERSION="2.4.0" -PKG_SHA256="58567dac882167021f031489062cbbab76bc646214be0ee44d5f724d960b3d76" +PKG_VERSION="2.4.1" +PKG_SHA256="03cd7e16acc94f828b6e7f3087863d8ca06e99ffa3385588005b1984bdd56157" PKG_ARCH="x86_64" PKG_LICENSE="GPL" PKG_SITE="https://01.org/linuxmedia" From f1d58c8d4b6e921d00dfdcbfb9ad560615a966eb Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 21 Jun 2020 03:31:48 +0100 Subject: [PATCH 12/43] open-vm-tools: update to open-vm-tools-stable-11.1.0 --- packages/sysutils/open-vm-tools/package.mk | 4 +- .../open-vm-tools-0001-fix-issue-429.patch | 31 +++++++ .../open-vm-tools-0002-fix-issue-429.patch | 23 +++++ .../open-vm-tools-0003-fix-issue-429.patch | 64 +++++++++++++ ...-tools-001-fix-deprecated-glib-funcs.patch | 90 ------------------- 5 files changed, 120 insertions(+), 92 deletions(-) create mode 100644 packages/sysutils/open-vm-tools/patches/open-vm-tools-0001-fix-issue-429.patch create mode 100644 packages/sysutils/open-vm-tools/patches/open-vm-tools-0002-fix-issue-429.patch create mode 100644 packages/sysutils/open-vm-tools/patches/open-vm-tools-0003-fix-issue-429.patch delete mode 100644 packages/sysutils/open-vm-tools/patches/open-vm-tools-001-fix-deprecated-glib-funcs.patch diff --git a/packages/sysutils/open-vm-tools/package.mk b/packages/sysutils/open-vm-tools/package.mk index 3b53e0d9ffa..3c96ef01aea 100644 --- a/packages/sysutils/open-vm-tools/package.mk +++ b/packages/sysutils/open-vm-tools/package.mk @@ -4,8 +4,8 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="open-vm-tools" -PKG_VERSION="stable-11.0.5" -PKG_SHA256="f4300d8ccf665a3ff435476bc372a3f189a98c2b830730608d4286226802bd97" +PKG_VERSION="stable-11.1.0" +PKG_SHA256="5930448c65cf298e3dded2a3670750f4affaf3a631500a1774eeb4cfe0a32b80" PKG_ARCH="x86_64" PKG_LICENSE="GPL" PKG_SITE="https://github.com/vmware/open-vm-tools" diff --git a/packages/sysutils/open-vm-tools/patches/open-vm-tools-0001-fix-issue-429.patch b/packages/sysutils/open-vm-tools/patches/open-vm-tools-0001-fix-issue-429.patch new file mode 100644 index 00000000000..2f4e69e17a1 --- /dev/null +++ b/packages/sysutils/open-vm-tools/patches/open-vm-tools-0001-fix-issue-429.patch @@ -0,0 +1,31 @@ +From 9cbdf3a6e2cb23a7673fe19b2a3f888714095019 Mon Sep 17 00:00:00 2001 +From: Oliver Kurth +Date: Wed, 1 Apr 2020 11:31:36 -0700 +Subject: [PATCH] Add a Coverity annotation. + +The Coverity scan of open-vm-tools reports an out-of-bounds access +issue in Util_BacktraceWithFunc. This is intentional, to compute +the base pointer for a stack trace. +--- + lib/user/utilBacktrace.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/user/utilBacktrace.c b/lib/user/utilBacktrace.c +index dca33d267..e1259606f 100644 +--- a/lib/user/utilBacktrace.c ++++ b/lib/user/utilBacktrace.c +@@ -1,5 +1,5 @@ + /********************************************************* +- * Copyright (C) 2013-2019 VMware, Inc. All rights reserved. ++ * Copyright (C) 2013-2020 VMware, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published +@@ -438,6 +438,7 @@ Util_BacktraceWithFunc(int bugNr, // IN: + } else { + outFunc(outFuncData, "Backtrace for bugNr=%d\n",bugNr); + } ++ /* coverity[ptr_arith] */ + UtilBacktraceFromPointerWithFunc(&x[-2], outFunc, outFuncData); + #endif + } diff --git a/packages/sysutils/open-vm-tools/patches/open-vm-tools-0002-fix-issue-429.patch b/packages/sysutils/open-vm-tools/patches/open-vm-tools-0002-fix-issue-429.patch new file mode 100644 index 00000000000..def8c54cd49 --- /dev/null +++ b/packages/sysutils/open-vm-tools/patches/open-vm-tools-0002-fix-issue-429.patch @@ -0,0 +1,23 @@ +From bb11e038323893d2428eb2ce94f8742233b45546 Mon Sep 17 00:00:00 2001 +From: Oliver Kurth +Date: Wed, 10 Jun 2020 12:05:43 -0700 +Subject: [PATCH] Changes to common source file not applicable to + open-vm-tools. + +--- + lib/user/utilBacktrace.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/user/utilBacktrace.c b/lib/user/utilBacktrace.c +index e1259606f..998713656 100644 +--- a/lib/user/utilBacktrace.c ++++ b/lib/user/utilBacktrace.c +@@ -422,7 +422,7 @@ Util_BacktraceWithFunc(int bugNr, // IN: + for (i = 0; i < frames; i++) { + if (dladdr(callstack[i], &dli)) { + outFunc(outFuncData, "SymBacktrace[%d] rip=%016lx in function %s " +- "in object %s loaded at %#08x\n", ++ "in object %s loaded at %016lx\n", + i, callstack[i], dli.dli_sname, dli.dli_fname, + dli.dli_fbase); + } else { diff --git a/packages/sysutils/open-vm-tools/patches/open-vm-tools-0003-fix-issue-429.patch b/packages/sysutils/open-vm-tools/patches/open-vm-tools-0003-fix-issue-429.patch new file mode 100644 index 00000000000..96f48755fb3 --- /dev/null +++ b/packages/sysutils/open-vm-tools/patches/open-vm-tools-0003-fix-issue-429.patch @@ -0,0 +1,64 @@ +From 0cfda58aaa8bc0fea56f1211897e7f2237f6070a Mon Sep 17 00:00:00 2001 +From: Oliver Kurth +Date: Wed, 10 Jun 2020 12:05:46 -0700 +Subject: [PATCH] Make peeking back into the stack work for back traces + +GCC 10 doesn't like peeking back before the end of an arrary (which +is used to peek into the stack). Fix this. + +https://github.com/vmware/open-vm-tools/issues/429 +--- + lib/user/utilBacktrace.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/lib/user/utilBacktrace.c b/lib/user/utilBacktrace.c +index 998713656..d26d21e7d 100644 +--- a/lib/user/utilBacktrace.c ++++ b/lib/user/utilBacktrace.c +@@ -343,7 +343,8 @@ UtilBacktraceFromPointerWithFunc(uintptr_t *basePtr, // IN: + i, x[0], x[1], dli.dli_sname, dli.dli_fname, + dli.dli_fbase); + } else { +- outFunc(outFuncData, "SymBacktrace[%d] %#08x eip %#08x \n", i, x[0], x[1]); ++ outFunc(outFuncData, "SymBacktrace[%d] %#08x eip %#08x \n", i, x[0], ++ x[1]); + } + x = (uintptr_t *) x[0]; + } +@@ -394,6 +395,7 @@ Util_Backtrace(int bugNr) // IN + *----------------------------------------------------------------------------- + */ + ++ + void + Util_BacktraceWithFunc(int bugNr, // IN: + Util_OutputFunc outFunc, // IN: +@@ -413,7 +415,7 @@ Util_BacktraceWithFunc(int bugNr, // IN: + if (bugNr == 0) { + outFunc(outFuncData, "Backtrace:\n"); + } else { +- outFunc(outFuncData, "Backtrace for bugNr=%d\n",bugNr); ++ outFunc(outFuncData, "Backtrace for bugNr=%d\n", bugNr); + } + frames = backtrace(callstack, ARRAYSIZE(callstack)); + for (i = 0; i < frames; i++) { +@@ -431,14 +433,14 @@ Util_BacktraceWithFunc(int bugNr, // IN: + } + } + #else +- uintptr_t *x = (uintptr_t *) &bugNr; +- + if (bugNr == 0) { + outFunc(outFuncData, "Backtrace:\n"); + } else { +- outFunc(outFuncData, "Backtrace for bugNr=%d\n",bugNr); ++ outFunc(outFuncData, "Backtrace for bugNr=%d\n", bugNr); + } +- /* coverity[ptr_arith] */ +- UtilBacktraceFromPointerWithFunc(&x[-2], outFunc, outFuncData); ++ ++ UtilBacktraceFromPointerWithFunc(__builtin_frame_address(0), outFunc, ++ outFuncData); + #endif + } ++ diff --git a/packages/sysutils/open-vm-tools/patches/open-vm-tools-001-fix-deprecated-glib-funcs.patch b/packages/sysutils/open-vm-tools/patches/open-vm-tools-001-fix-deprecated-glib-funcs.patch deleted file mode 100644 index 0efae9a0a31..00000000000 --- a/packages/sysutils/open-vm-tools/patches/open-vm-tools-001-fix-deprecated-glib-funcs.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 7ec4955072f3f93dd4b5821c9688bc524a089087 Mon Sep 17 00:00:00 2001 -From: Oliver Kurth -Date: Mon, 30 Sep 2019 16:24:27 -0700 -Subject: [PATCH] GitHub Issue #367. Remove references to deprecated - G_INLINE_FUNC. - -G_INLINE_FUNC was a work-around for compilers that didn't support -static inline. Change uses of it to static inline. ---- - lib/include/vmware/tools/plugin.h | 2 +- - lib/include/vmware/tools/threadPool.h | 8 ++++---- - lib/include/vmware/tools/utils.h | 9 --------- - 3 files changed, 5 insertions(+), 14 deletions(-) - -diff --git a/lib/include/vmware/tools/plugin.h b/lib/include/vmware/tools/plugin.h -index f9acc6a..deefd1f 100644 ---- a/lib/include/vmware/tools/plugin.h -+++ b/lib/include/vmware/tools/plugin.h -@@ -290,7 +290,7 @@ typedef struct ToolsAppCtx { - * - * @return TRUE if COM is initialized when the function returns. - */ --G_INLINE_FUNC gboolean -+static inline gboolean - ToolsCore_InitializeCOM(ToolsAppCtx *ctx) - { - if (!ctx->comInitialized) { -diff --git a/lib/include/vmware/tools/threadPool.h b/lib/include/vmware/tools/threadPool.h -index 3f2082b..5880fbc 100644 ---- a/lib/include/vmware/tools/threadPool.h -+++ b/lib/include/vmware/tools/threadPool.h -@@ -91,7 +91,7 @@ typedef struct ToolsCorePool { - ******************************************************************************* - */ - --G_INLINE_FUNC ToolsCorePool * -+static inline ToolsCorePool * - ToolsCorePool_GetPool(ToolsAppCtx *ctx) - { - ToolsCorePool *pool = NULL; -@@ -123,7 +123,7 @@ ToolsCorePool_GetPool(ToolsAppCtx *ctx) - ******************************************************************************* - */ - --G_INLINE_FUNC guint -+static inline guint - ToolsCorePool_SubmitTask(ToolsAppCtx *ctx, - ToolsCorePoolCb cb, - gpointer data, -@@ -153,7 +153,7 @@ ToolsCorePool_SubmitTask(ToolsAppCtx *ctx, - ******************************************************************************* - */ - --G_INLINE_FUNC void -+static inline void - ToolsCorePool_CancelTask(ToolsAppCtx *ctx, - guint taskId) - { -@@ -197,7 +197,7 @@ ToolsCorePool_CancelTask(ToolsAppCtx *ctx, - ******************************************************************************* - */ - --G_INLINE_FUNC gboolean -+static inline gboolean - ToolsCorePool_StartThread(ToolsAppCtx *ctx, - const gchar *threadName, - ToolsCorePoolCb cb, -diff --git a/lib/include/vmware/tools/utils.h b/lib/include/vmware/tools/utils.h -index f657459..a3292d5 100644 ---- a/lib/include/vmware/tools/utils.h -+++ b/lib/include/vmware/tools/utils.h -@@ -51,15 +51,6 @@ - # include - #endif - -- --/* Work around a glib limitation: it doesn't set G_INLINE_FUNC on Win32. */ --#if defined(G_PLATFORM_WIN32) --# if defined(G_INLINE_FUNC) --# undef G_INLINE_FUNC --# endif --# define G_INLINE_FUNC static __inline --#endif -- - #ifndef ABS - # define ABS(x) (((x) >= 0) ? (x) : -(x)) - #endif --- -2.7.4 - From 0572358ddff6bcd6a13bcebfa3b36d13ce43a738 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 21 Jun 2020 03:47:57 +0100 Subject: [PATCH 13/43] llvm: update to llvm-10.0.0 --- packages/lang/llvm/package.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/lang/llvm/package.mk b/packages/lang/llvm/package.mk index bb63ca1b965..8a5f20b4a3c 100644 --- a/packages/lang/llvm/package.mk +++ b/packages/lang/llvm/package.mk @@ -3,12 +3,12 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="llvm" -PKG_VERSION="9.0.0" -PKG_SHA256="d6a0565cf21f22e9b4353b2eb92622e8365000a9e90a16b09b56f8157eabfe84" +PKG_VERSION="10.0.0" +PKG_SHA256="df83a44b3a9a71029049ec101fb0077ecbbdf5fe41e395215025779099a98fdf" PKG_ARCH="x86_64" PKG_LICENSE="Apache-2.0" PKG_SITE="http://llvm.org/" -PKG_URL="https://releases.llvm.org/${PKG_VERSION}/llvm-${PKG_VERSION}.src.tar.xz" +PKG_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${PKG_VERSION}/llvm-${PKG_VERSION}.src.tar.xz" PKG_DEPENDS_HOST="toolchain:host" PKG_DEPENDS_TARGET="toolchain llvm:host zlib" PKG_LONGDESC="Low-Level Virtual Machine (LLVM) is a compiler infrastructure." From dcd3b1ba08a889d1fb78687b61b74d31c8485ed5 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 21 Jun 2020 05:27:13 +0100 Subject: [PATCH 14/43] media-driver: update to media-driver-20.1.1 --- packages/multimedia/media-driver/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/multimedia/media-driver/package.mk b/packages/multimedia/media-driver/package.mk index 63f9b823ff0..8ca48d0fb74 100644 --- a/packages/multimedia/media-driver/package.mk +++ b/packages/multimedia/media-driver/package.mk @@ -2,8 +2,8 @@ # Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv) PKG_NAME="media-driver" -PKG_VERSION="19.4.0r" -PKG_SHA256="a03bd75eefe9cb0245e3aab2723b3fef555d9f180a180b2c29d7b12d483d9ec2" +PKG_VERSION="20.1.1" +PKG_SHA256="dbca37ba8383cd4d1f3e15fa906f03457ebdb5a118d2459d8f9cd477e0f3d4d4" PKG_ARCH="x86_64" PKG_LICENSE="MIT" PKG_SITE="https://01.org/linuxmedia" From 18b7fc2bc6fbcdfd2b58de4c5d40ae50219df11c Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 21 Jun 2020 06:23:54 +0100 Subject: [PATCH 15/43] linux (RPi): fix perf with gcc-10 and 5.4.y --- .../linux-999.20-fix-perf-gcc-10.patch | 234 ++++++++++++++++++ .../linux-999.21-fix-perf-gcc-10.patch | 37 +++ 2 files changed, 271 insertions(+) create mode 100644 packages/linux/patches/raspberrypi/linux-999.20-fix-perf-gcc-10.patch create mode 100644 packages/linux/patches/raspberrypi/linux-999.21-fix-perf-gcc-10.patch diff --git a/packages/linux/patches/raspberrypi/linux-999.20-fix-perf-gcc-10.patch b/packages/linux/patches/raspberrypi/linux-999.20-fix-perf-gcc-10.patch new file mode 100644 index 00000000000..b5b89e45c6f --- /dev/null +++ b/packages/linux/patches/raspberrypi/linux-999.20-fix-perf-gcc-10.patch @@ -0,0 +1,234 @@ +From e4d9b04b973b2dbce7b42af95ea70d07da1c936d Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Mon, 2 Mar 2020 12:09:38 -0300 +Subject: [PATCH] perf bench: Share some global variables to fix build with gcc + 10 + +Noticed with gcc 10 (fedora rawhide) that those variables were not being +declared as static, so end up with: + + ld: /tmp/build/perf/bench/epoll-wait.o:/git/perf/tools/perf/bench/epoll-wait.c:93: multiple definition of `end'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here + ld: /tmp/build/perf/bench/epoll-wait.o:/git/perf/tools/perf/bench/epoll-wait.c:93: multiple definition of `start'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here + ld: /tmp/build/perf/bench/epoll-wait.o:/git/perf/tools/perf/bench/epoll-wait.c:93: multiple definition of `runtime'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here + ld: /tmp/build/perf/bench/epoll-ctl.o:/git/perf/tools/perf/bench/epoll-ctl.c:38: multiple definition of `end'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here + ld: /tmp/build/perf/bench/epoll-ctl.o:/git/perf/tools/perf/bench/epoll-ctl.c:38: multiple definition of `start'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here + ld: /tmp/build/perf/bench/epoll-ctl.o:/git/perf/tools/perf/bench/epoll-ctl.c:38: multiple definition of `runtime'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here + make[4]: *** [/git/perf/tools/build/Makefile.build:145: /tmp/build/perf/bench/perf-in.o] Error 1 + +Prefix those with bench__ and add them to bench/bench.h, so that we can +share those on the tools needing to access those variables from signal +handlers. + +Acked-by: Thomas Gleixner +Cc: Adrian Hunter +Cc: Davidlohr Bueso +Cc: Jiri Olsa +Cc: Namhyung Kim +Link: http://lore.kernel.org/lkml/20200303155811.GD13702@kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +--- + tools/perf/bench/bench.h | 4 ++++ + tools/perf/bench/epoll-ctl.c | 7 +++---- + tools/perf/bench/epoll-wait.c | 11 +++++------ + tools/perf/bench/futex-hash.c | 12 ++++++------ + tools/perf/bench/futex-lock-pi.c | 11 +++++------ + 5 files changed, 23 insertions(+), 22 deletions(-) + +diff --git a/tools/perf/bench/bench.h b/tools/perf/bench/bench.h +index fddb3ced9db6..4aa6de1aa67d 100644 +--- a/tools/perf/bench/bench.h ++++ b/tools/perf/bench/bench.h +@@ -2,6 +2,10 @@ + #ifndef BENCH_H + #define BENCH_H + ++#include ++ ++extern struct timeval bench__start, bench__end, bench__runtime; ++ + /* + * The madvise transparent hugepage constants were added in glibc + * 2.13. For compatibility with older versions of glibc, define these +diff --git a/tools/perf/bench/epoll-ctl.c b/tools/perf/bench/epoll-ctl.c +index bb617e568841..a7526c05df38 100644 +--- a/tools/perf/bench/epoll-ctl.c ++++ b/tools/perf/bench/epoll-ctl.c +@@ -35,7 +35,6 @@ + + static unsigned int nthreads = 0; + static unsigned int nsecs = 8; +-struct timeval start, end, runtime; + static bool done, __verbose, randomize; + + /* +@@ -94,8 +93,8 @@ static void toggle_done(int sig __maybe_unused, + { + /* inform all threads that we're done for the day */ + done = true; +- gettimeofday(&end, NULL); +- timersub(&end, &start, &runtime); ++ gettimeofday(&bench__end, NULL); ++ timersub(&bench__end, &bench__start, &bench__runtime); + } + + static void nest_epollfd(void) +@@ -361,7 +360,7 @@ int bench_epoll_ctl(int argc, const char **argv) + + threads_starting = nthreads; + +- gettimeofday(&start, NULL); ++ gettimeofday(&bench__start, NULL); + + do_threads(worker, cpu); + +diff --git a/tools/perf/bench/epoll-wait.c b/tools/perf/bench/epoll-wait.c +index 7af694437f4e..d1c5cb526b9f 100644 +--- a/tools/perf/bench/epoll-wait.c ++++ b/tools/perf/bench/epoll-wait.c +@@ -90,7 +90,6 @@ + + static unsigned int nthreads = 0; + static unsigned int nsecs = 8; +-struct timeval start, end, runtime; + static bool wdone, done, __verbose, randomize, nonblocking; + + /* +@@ -276,8 +275,8 @@ static void toggle_done(int sig __maybe_unused, + { + /* inform all threads that we're done for the day */ + done = true; +- gettimeofday(&end, NULL); +- timersub(&end, &start, &runtime); ++ gettimeofday(&bench__end, NULL); ++ timersub(&bench__end, &bench__start, &bench__runtime); + } + + static void print_summary(void) +@@ -287,7 +286,7 @@ static void print_summary(void) + + printf("\nAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n", + avg, rel_stddev_stats(stddev, avg), +- (int) runtime.tv_sec); ++ (int)bench__runtime.tv_sec); + } + + static int do_threads(struct worker *worker, struct perf_cpu_map *cpu) +@@ -479,7 +478,7 @@ int bench_epoll_wait(int argc, const char **argv) + + threads_starting = nthreads; + +- gettimeofday(&start, NULL); ++ gettimeofday(&bench__start, NULL); + + do_threads(worker, cpu); + +@@ -519,7 +518,7 @@ int bench_epoll_wait(int argc, const char **argv) + qsort(worker, nthreads, sizeof(struct worker), cmpworker); + + for (i = 0; i < nthreads; i++) { +- unsigned long t = worker[i].ops/runtime.tv_sec; ++ unsigned long t = worker[i].ops / bench__runtime.tv_sec; + + update_stats(&throughput_stats, t); + +diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c +index 8ba0c3330a9a..21776862e940 100644 +--- a/tools/perf/bench/futex-hash.c ++++ b/tools/perf/bench/futex-hash.c +@@ -37,7 +37,7 @@ static unsigned int nfutexes = 1024; + static bool fshared = false, done = false, silent = false; + static int futex_flag = 0; + +-struct timeval start, end, runtime; ++struct timeval bench__start, bench__end, bench__runtime; + static pthread_mutex_t thread_lock; + static unsigned int threads_starting; + static struct stats throughput_stats; +@@ -103,8 +103,8 @@ static void toggle_done(int sig __maybe_unused, + { + /* inform all threads that we're done for the day */ + done = true; +- gettimeofday(&end, NULL); +- timersub(&end, &start, &runtime); ++ gettimeofday(&bench__end, NULL); ++ timersub(&bench__end, &bench__start, &bench__runtime); + } + + static void print_summary(void) +@@ -114,7 +114,7 @@ static void print_summary(void) + + printf("%sAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n", + !silent ? "\n" : "", avg, rel_stddev_stats(stddev, avg), +- (int) runtime.tv_sec); ++ (int)bench__runtime.tv_sec); + } + + int bench_futex_hash(int argc, const char **argv) +@@ -161,7 +161,7 @@ int bench_futex_hash(int argc, const char **argv) + + threads_starting = nthreads; + pthread_attr_init(&thread_attr); +- gettimeofday(&start, NULL); ++ gettimeofday(&bench__start, NULL); + for (i = 0; i < nthreads; i++) { + worker[i].tid = i; + worker[i].futex = calloc(nfutexes, sizeof(*worker[i].futex)); +@@ -204,7 +204,7 @@ int bench_futex_hash(int argc, const char **argv) + pthread_mutex_destroy(&thread_lock); + + for (i = 0; i < nthreads; i++) { +- unsigned long t = worker[i].ops/runtime.tv_sec; ++ unsigned long t = worker[i].ops / bench__runtime.tv_sec; + update_stats(&throughput_stats, t); + if (!silent) { + if (nfutexes == 1) +diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c +index d0cae8125423..30d97121dc4f 100644 +--- a/tools/perf/bench/futex-lock-pi.c ++++ b/tools/perf/bench/futex-lock-pi.c +@@ -37,7 +37,6 @@ static bool silent = false, multi = false; + static bool done = false, fshared = false; + static unsigned int nthreads = 0; + static int futex_flag = 0; +-struct timeval start, end, runtime; + static pthread_mutex_t thread_lock; + static unsigned int threads_starting; + static struct stats throughput_stats; +@@ -64,7 +63,7 @@ static void print_summary(void) + + printf("%sAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n", + !silent ? "\n" : "", avg, rel_stddev_stats(stddev, avg), +- (int) runtime.tv_sec); ++ (int)bench__runtime.tv_sec); + } + + static void toggle_done(int sig __maybe_unused, +@@ -73,8 +72,8 @@ static void toggle_done(int sig __maybe_unused, + { + /* inform all threads that we're done for the day */ + done = true; +- gettimeofday(&end, NULL); +- timersub(&end, &start, &runtime); ++ gettimeofday(&bench__end, NULL); ++ timersub(&bench__end, &bench__start, &bench__runtime); + } + + static void *workerfn(void *arg) +@@ -185,7 +184,7 @@ int bench_futex_lock_pi(int argc, const char **argv) + + threads_starting = nthreads; + pthread_attr_init(&thread_attr); +- gettimeofday(&start, NULL); ++ gettimeofday(&bench__start, NULL); + + create_threads(worker, thread_attr, cpu); + pthread_attr_destroy(&thread_attr); +@@ -211,7 +210,7 @@ int bench_futex_lock_pi(int argc, const char **argv) + pthread_mutex_destroy(&thread_lock); + + for (i = 0; i < nthreads; i++) { +- unsigned long t = worker[i].ops/runtime.tv_sec; ++ unsigned long t = worker[i].ops / bench__runtime.tv_sec; + + update_stats(&throughput_stats, t); + if (!silent) diff --git a/packages/linux/patches/raspberrypi/linux-999.21-fix-perf-gcc-10.patch b/packages/linux/patches/raspberrypi/linux-999.21-fix-perf-gcc-10.patch new file mode 100644 index 00000000000..3596ff39c55 --- /dev/null +++ b/packages/linux/patches/raspberrypi/linux-999.21-fix-perf-gcc-10.patch @@ -0,0 +1,37 @@ +From cff20b3151ccab690715cb6cf0f5da5cccb32adf Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Mon, 2 Mar 2020 11:13:19 -0300 +Subject: [PATCH] perf tests bp_account: Make global variable static + +To fix the build with newer gccs, that without this patch exit with: + + LD /tmp/build/perf/tests/perf-in.o + ld: /tmp/build/perf/tests/bp_account.o:/git/perf/tools/perf/tests/bp_account.c:22: multiple definition of `the_var'; /tmp/build/perf/tests/bp_signal.o:/git/perf/tools/perf/tests/bp_signal.c:38: first defined here + make[4]: *** [/git/perf/tools/build/Makefile.build:145: /tmp/build/perf/tests/perf-in.o] Error 1 + +First noticed in fedora:rawhide/32 with: + + [perfbuilder@a5ff49d6e6e4 ~]$ gcc --version + gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8) + +Reported-by: Jiri Olsa +Cc: Adrian Hunter +Cc: Namhyung Kim +Signed-off-by: Arnaldo Carvalho de Melo +--- + tools/perf/tests/bp_account.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c +index d0b935356274..489b50604cf2 100644 +--- a/tools/perf/tests/bp_account.c ++++ b/tools/perf/tests/bp_account.c +@@ -19,7 +19,7 @@ + #include "../perf-sys.h" + #include "cloexec.h" + +-volatile long the_var; ++static volatile long the_var; + + static noinline int test_function(void) + { From d6c57676086b8f05a63d693ef045d8a2e26ca6e4 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 21 Jun 2020 10:24:53 +0100 Subject: [PATCH 16/43] grub: update to grub-6a34fdb --- packages/tools/grub/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tools/grub/package.mk b/packages/tools/grub/package.mk index ed4dccdbfdb..35c877f79ce 100755 --- a/packages/tools/grub/package.mk +++ b/packages/tools/grub/package.mk @@ -2,8 +2,8 @@ # Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv) PKG_NAME="grub" -PKG_VERSION="2.04" -PKG_SHA256="a4a065f83d23e089a8086e7d0a3f86d914f884a9732a38c9a16ae2edb427fde1" +PKG_VERSION="6a34fdb76a07305b95e31659bc27b1d190101cbf" +PKG_SHA256="825328841e2e7e8654518808965afe19a421f6e272d946a5fe11bd90b8582f76" PKG_ARCH="x86_64" PKG_LICENSE="GPLv3" PKG_SITE="https://www.gnu.org/software/grub/index.html" From 203e22e1a6470d9df9c9eca837d0b3bc32e393e2 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 21 Jun 2020 10:35:47 +0100 Subject: [PATCH 17/43] xf86-video-ati: fix gcc-10 --- .../xf86-video-ati-001-fix-gcc-10.patch | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 packages/x11/driver/xf86-video-ati/patches/xf86-video-ati-001-fix-gcc-10.patch diff --git a/packages/x11/driver/xf86-video-ati/patches/xf86-video-ati-001-fix-gcc-10.patch b/packages/x11/driver/xf86-video-ati/patches/xf86-video-ati-001-fix-gcc-10.patch new file mode 100644 index 00000000000..e0375b0826c --- /dev/null +++ b/packages/x11/driver/xf86-video-ati/patches/xf86-video-ati-001-fix-gcc-10.patch @@ -0,0 +1,33 @@ +From f223035f4ffcff2a9296d1e907a5193f8e8845a3 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Tue, 4 Feb 2020 16:38:06 -0500 +Subject: [PATCH] Fix link failure with gcc 10 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Without the 'extern' this looks like a definition not just a +declaration, in every file that includes the header. gcc 10 is stricter +about this kind of multiple definition. + +Reviewed-by: Michel Dänzer +--- + src/drmmode_display.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/drmmode_display.h b/src/drmmode_display.h +index 96eaef0a..8cd8a0a6 100644 +--- a/src/drmmode_display.h ++++ b/src/drmmode_display.h +@@ -262,7 +262,7 @@ Bool drmmode_wait_vblank(xf86CrtcPtr crtc, drmVBlankSeqType type, + uint64_t *ust, uint32_t *result_seq); + + +-miPointerSpriteFuncRec drmmode_sprite_funcs; ++extern miPointerSpriteFuncRec drmmode_sprite_funcs; + + + #endif +-- +2.26.2 + From 5529aff2dbddbe4ab6964c8fff5e8bab60908bd7 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 21 Jun 2020 10:41:47 +0100 Subject: [PATCH 18/43] xf86-video-amdgpu: fix gcc-10 --- .../xf86-video-amdgpu-fix-gcc-10.patch | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 packages/x11/driver/xf86-video-amdgpu/patches/xf86-video-amdgpu-fix-gcc-10.patch diff --git a/packages/x11/driver/xf86-video-amdgpu/patches/xf86-video-amdgpu-fix-gcc-10.patch b/packages/x11/driver/xf86-video-amdgpu/patches/xf86-video-amdgpu-fix-gcc-10.patch new file mode 100644 index 00000000000..3e12b5aa93c --- /dev/null +++ b/packages/x11/driver/xf86-video-amdgpu/patches/xf86-video-amdgpu-fix-gcc-10.patch @@ -0,0 +1,25 @@ +From 1dddab35e61b9100b2cbcd3098596946c1c50b7a Mon Sep 17 00:00:00 2001 +From: MilhouseVH +Date: Sun, 21 Jun 2020 10:40:52 +0100 +Subject: [PATCH] Fix link failure with gcc 10 + +--- + src/drmmode_display.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/drmmode_display.h b/src/drmmode_display.h +index 803ac3c..9c0f25a 100644 +--- a/src/drmmode_display.h ++++ b/src/drmmode_display.h +@@ -289,7 +289,7 @@ Bool drmmode_wait_vblank(xf86CrtcPtr crtc, drmVBlankSeqType type, + uint64_t *ust, uint32_t *result_seq); + + +-miPointerSpriteFuncRec drmmode_sprite_funcs; ++extern miPointerSpriteFuncRec drmmode_sprite_funcs; + + + #endif +-- +2.20.1 + From c84005f63c7c6f0ed578ba9534fdc45c927e792d Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 21 Jun 2020 00:25:52 +0200 Subject: [PATCH 19/43] gcc: Update to 10.1.0 --- packages/lang/gcc/package.mk | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/lang/gcc/package.mk b/packages/lang/gcc/package.mk index 95ebbc1dfd7..bfef90eaeaf 100644 --- a/packages/lang/gcc/package.mk +++ b/packages/lang/gcc/package.mk @@ -3,8 +3,8 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="gcc" -PKG_VERSION="9.3.0" -PKG_SHA256="71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1" +PKG_VERSION="10.1.0" +PKG_SHA256="b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2" PKG_LICENSE="GPL" PKG_SITE="http://gcc.gnu.org/" PKG_URL="http://ftpmirror.gnu.org/gcc/$PKG_NAME-$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.xz" @@ -39,11 +39,11 @@ GCC_COMMON_CONFIGURE_OPTS="--target=$TARGET_NAME \ --disable-libquadmath \ --disable-libgomp \ --disable-libmpx \ - --disable-libssp" + --disable-libssp \ + --enable-__cxa_atexit" PKG_CONFIGURE_OPTS_BOOTSTRAP="$GCC_COMMON_CONFIGURE_OPTS \ --enable-languages=c \ - --disable-__cxa_atexit \ --disable-libsanitizer \ --enable-cloog-backend=isl \ --disable-shared \ @@ -55,7 +55,6 @@ PKG_CONFIGURE_OPTS_BOOTSTRAP="$GCC_COMMON_CONFIGURE_OPTS \ PKG_CONFIGURE_OPTS_HOST="$GCC_COMMON_CONFIGURE_OPTS \ --enable-languages=c,c++ \ - --enable-__cxa_atexit \ --enable-decimal-float \ --enable-tls \ --enable-shared \ @@ -87,7 +86,7 @@ post_makeinstall_host() { cp -PR $TARGET_NAME/libstdc++-v3/src/.libs/libstdc++.so* $SYSROOT_PREFIX/usr/lib GCC_VERSION=`$TOOLCHAIN/bin/${TARGET_NAME}-gcc -dumpversion` - DATE="0501`echo $GCC_VERSION | sed 's/\([0-9]\)/0\1/g' | sed 's/\.//g'`" + DATE="0501`echo $GCC_VERSION | sed 's/\./0/g'`" CROSS_CC=${TARGET_PREFIX}gcc-${GCC_VERSION} CROSS_CXX=${TARGET_PREFIX}g++-${GCC_VERSION} From 73ef7e285928815828fc7dfbd94ec583d0e3d963 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:06:18 +0200 Subject: [PATCH 20/43] w_scan: fix compilation with gcc10 --- .../w_scan-0001-Fix-building-with-gcc10.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 packages/addons/addon-depends/dvb-tools-depends/w_scan/patches/w_scan-0001-Fix-building-with-gcc10.patch diff --git a/packages/addons/addon-depends/dvb-tools-depends/w_scan/patches/w_scan-0001-Fix-building-with-gcc10.patch b/packages/addons/addon-depends/dvb-tools-depends/w_scan/patches/w_scan-0001-Fix-building-with-gcc10.patch new file mode 100644 index 00000000000..8c00d988566 --- /dev/null +++ b/packages/addons/addon-depends/dvb-tools-depends/w_scan/patches/w_scan-0001-Fix-building-with-gcc10.patch @@ -0,0 +1,34 @@ +From edbabcc7df6cd9e282991bd550d125d7f75bd738 Mon Sep 17 00:00:00 2001 +From: Jernej Skrabec +Date: Mon, 22 Jun 2020 19:42:17 +0200 +Subject: [PATCH] Fix building with gcc10 + +--- + si_types.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/si_types.h b/si_types.h +index 5fc7835d80c7..41ce2e1e6603 100644 +--- a/si_types.h ++++ b/si_types.h +@@ -114,7 +114,7 @@ struct service { + uint32_t logical_channel_number; + uint8_t running; + void * priv; +-} service_t, * p_service_t; ++}; + + /******************************************************************************* + /* transponder type. +@@ -201,7 +201,7 @@ struct transponder { + /*----------------------------*/ + char * network_name; + network_change_t network_change; +-} __attribute__((packed)) transponder_t, * p_transponder_t; ++} __attribute__((packed)); + + /******************************************************************************* + /* satellite channel routing type. +-- +2.27.0 + From 500d57ac9f75534f5b378e981b82c3c06a11ec28 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:07:02 +0200 Subject: [PATCH 21/43] comskip: fix compilation with gcc10 --- .../Comskip-0001-Fix-compilation-with-gcc10.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 packages/addons/addon-depends/comskip/patches/Comskip-0001-Fix-compilation-with-gcc10.patch diff --git a/packages/addons/addon-depends/comskip/patches/Comskip-0001-Fix-compilation-with-gcc10.patch b/packages/addons/addon-depends/comskip/patches/Comskip-0001-Fix-compilation-with-gcc10.patch new file mode 100644 index 00000000000..d251743d7b8 --- /dev/null +++ b/packages/addons/addon-depends/comskip/patches/Comskip-0001-Fix-compilation-with-gcc10.patch @@ -0,0 +1,12 @@ +diff --git a/mpeg2dec.c b/mpeg2dec.c +index 3013dc1..5b79227 100755 +--- a/mpeg2dec.c ++++ b/mpeg2dec.c +@@ -161,7 +161,6 @@ int64_t pev_best_effort_timestamp = 0; + + int video_stream_index = -1; + int audio_stream_index = -1; +-int width, height; + int have_frame_rate ; + int stream_index; + From 8bdb3b2f76a8aba5fafadad97ad1a1594527956b Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:08:17 +0200 Subject: [PATCH 22/43] shairport-sync: Update to 3.3.6 --- .../addon-depends/snapcast-depends/shairport-sync/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/addons/addon-depends/snapcast-depends/shairport-sync/package.mk b/packages/addons/addon-depends/snapcast-depends/shairport-sync/package.mk index 3684198defe..a51b6ce10f8 100644 --- a/packages/addons/addon-depends/snapcast-depends/shairport-sync/package.mk +++ b/packages/addons/addon-depends/snapcast-depends/shairport-sync/package.mk @@ -2,8 +2,8 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="shairport-sync" -PKG_VERSION="3.2" -PKG_SHA256="18e9343d4bd8ff70674ff3ecdaf7312dd90e716cac2826a4266c95e08ca305bc" +PKG_VERSION="3.3.6" +PKG_SHA256="a8382affd25c473fa38ead5690148c6c3902098f359f9c881eefe139e1f49f49" PKG_LICENSE="OSS" PKG_SITE="https://github.com/mikebrady/shairport-sync" PKG_URL="https://github.com/mikebrady/shairport-sync/archive/$PKG_VERSION.tar.gz" From e3369acebd0c0b90087a3115f7a35fd8eec2f206 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:08:51 +0200 Subject: [PATCH 23/43] rsyslog: fix compilation with gcc10 --- packages/addons/service/rsyslog/package.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/addons/service/rsyslog/package.mk b/packages/addons/service/rsyslog/package.mk index 2a243dfd79e..54afeb710db 100644 --- a/packages/addons/service/rsyslog/package.mk +++ b/packages/addons/service/rsyslog/package.mk @@ -29,6 +29,10 @@ PKG_CONFIGURE_OPTS_TARGET="--disable-default-tests \ export LIBGCRYPT_CONFIG="$SYSROOT_PREFIX/usr/bin/libgcrypt-config" +pre_configure_target() { + CFLAGS="$CFLAGS -fcommon" +} + addon() { mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin cp $PKG_INSTALL/usr/sbin/rsyslogd \ From ed5b9de6eae608ac739f16b4382b4d214266cb05 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:09:39 +0200 Subject: [PATCH 24/43] libretro-uae: fix compilation with gcc10 --- packages/emulation/libretro-uae/package.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/emulation/libretro-uae/package.mk b/packages/emulation/libretro-uae/package.mk index 0bc80aa0d2a..7c6f6df4b07 100644 --- a/packages/emulation/libretro-uae/package.mk +++ b/packages/emulation/libretro-uae/package.mk @@ -16,6 +16,7 @@ PKG_LIBPATH="$PKG_LIBNAME" PKG_LIBVAR="UAE_LIB" pre_configure_target() { + CFLAGS="$CFLAGS -fcommon" if [ "$TARGET_ARCH" = "arm" ]; then CFLAGS="$CFLAGS -DARM -marm" fi From 3d08af6550370372f88b94a5263d2239e29b6930 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:10:09 +0200 Subject: [PATCH 25/43] audiodecoder.timidity: fix compilation with gcc10 --- .../kodi-binary-addons/audiodecoder.timidity/package.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/mediacenter/kodi-binary-addons/audiodecoder.timidity/package.mk b/packages/mediacenter/kodi-binary-addons/audiodecoder.timidity/package.mk index 18b637e3aca..86068ccad8f 100644 --- a/packages/mediacenter/kodi-binary-addons/audiodecoder.timidity/package.mk +++ b/packages/mediacenter/kodi-binary-addons/audiodecoder.timidity/package.mk @@ -18,6 +18,10 @@ PKG_LONGDESC="audiodecoder.timidity" PKG_IS_ADDON="yes" PKG_ADDON_TYPE="kodi.audiodecoder" +pre_configure_target() { + CFLAGS="$CFLAGS -fcommon" +} + addon() { install_binary_addon $PKG_ADDON_ID From efdcf8e3fb6bc0bc0ac61dd6931f22aa3c31bb99 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:10:35 +0200 Subject: [PATCH 26/43] t2scan: fix compilation with gcc10 --- .../t2scan-0001-Fix-building-with-gcc10.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 packages/addons/addon-depends/dvb-tools-depends/t2scan/patches/t2scan-0001-Fix-building-with-gcc10.patch diff --git a/packages/addons/addon-depends/dvb-tools-depends/t2scan/patches/t2scan-0001-Fix-building-with-gcc10.patch b/packages/addons/addon-depends/dvb-tools-depends/t2scan/patches/t2scan-0001-Fix-building-with-gcc10.patch new file mode 100644 index 00000000000..cf3baac9a15 --- /dev/null +++ b/packages/addons/addon-depends/dvb-tools-depends/t2scan/patches/t2scan-0001-Fix-building-with-gcc10.patch @@ -0,0 +1,34 @@ +From edbabcc7df6cd9e282991bd550d125d7f75bd738 Mon Sep 17 00:00:00 2001 +From: Jernej Skrabec +Date: Mon, 22 Jun 2020 19:42:17 +0200 +Subject: [PATCH] Fix building with gcc10 + +--- + si_types.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/si_types.h b/si_types.h +index 5fc7835d80c7..41ce2e1e6603 100644 +--- a/si_types.h ++++ b/si_types.h +@@ -113,7 +113,7 @@ struct service { + uint32_t logical_channel_number; + uint8_t running; + void * priv; +-} service_t, * p_service_t; ++}; + + /******************************************************************************* + /* transponder type. +@@ -204,7 +204,7 @@ struct transponder { + char * signal_strength_unit; + double signal_quality; + char * signal_quality_unit; +-} __attribute__((packed)) transponder_t, * p_transponder_t; ++} __attribute__((packed)); + + /******************************************************************************* + /* satellite channel routing type. +-- +2.27.0 + From 98b944385f90664ac0f82ed3063288be68598cd8 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:10:59 +0200 Subject: [PATCH 27/43] iftop: fix compilation with gcc10 --- .../iftop-Fix-building-with-gcc10.patch | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 packages/addons/addon-depends/network-tools-depends/iftop/patches/iftop-Fix-building-with-gcc10.patch diff --git a/packages/addons/addon-depends/network-tools-depends/iftop/patches/iftop-Fix-building-with-gcc10.patch b/packages/addons/addon-depends/network-tools-depends/iftop/patches/iftop-Fix-building-with-gcc10.patch new file mode 100644 index 00000000000..0f9c895101a --- /dev/null +++ b/packages/addons/addon-depends/network-tools-depends/iftop/patches/iftop-Fix-building-with-gcc10.patch @@ -0,0 +1,54 @@ +From d9402e29486f60ea4a9b8da530c60e6c8404127b Mon Sep 17 00:00:00 2001 +From: Jernej Skrabec +Date: Mon, 22 Jun 2020 20:18:59 +0200 +Subject: [PATCH] Fix building with gcc10 + +--- + ui_common.c | 6 ++++++ + ui_common.h | 12 +++++++----- + 2 files changed, 13 insertions(+), 5 deletions(-) + +diff --git a/ui_common.c b/ui_common.c +index dcf66466fda4..b1027ec16da7 100644 +--- a/ui_common.c ++++ b/ui_common.c +@@ -17,6 +17,12 @@ + + #include "ui_common.h" + ++sorted_list_type screen_list; ++host_pair_line totals; ++int peaksent, peakrecv, peaktotal; ++hash_type* screen_hash; ++hash_type* service_hash; ++ + /* 2, 10 and 40 seconds */ + int history_divs[HISTORY_DIVISIONS] = {1, 5, 20}; + +diff --git a/ui_common.h b/ui_common.h +index 63ae5bb69886..1403d11c310c 100644 +--- a/ui_common.h ++++ b/ui_common.h +@@ -33,12 +33,14 @@ typedef struct host_pair_line_tag { + + extern options_t options; + +-sorted_list_type screen_list; +-host_pair_line totals; +-int peaksent, peakrecv, peaktotal; ++extern sorted_list_type screen_list; ++extern host_pair_line totals; ++extern int peaksent; ++extern int peakrecv; ++extern int peaktotal; + extern history_type history_totals; +-hash_type* screen_hash; +-hash_type* service_hash; ++extern hash_type* screen_hash; ++extern hash_type* service_hash; + + void analyse_data(void); + void screen_list_init(void); +-- +2.27.0 + From a8f9909a88668057acf10b88c61457100435cd4f Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:11:16 +0200 Subject: [PATCH 28/43] ncftp: fix compilation with gcc10 --- .../ncftp/patches/ncftpd-gcc10-build-fix.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 packages/addons/addon-depends/network-tools-depends/ncftp/patches/ncftpd-gcc10-build-fix.patch diff --git a/packages/addons/addon-depends/network-tools-depends/ncftp/patches/ncftpd-gcc10-build-fix.patch b/packages/addons/addon-depends/network-tools-depends/ncftp/patches/ncftpd-gcc10-build-fix.patch new file mode 100644 index 00000000000..3d43e62f988 --- /dev/null +++ b/packages/addons/addon-depends/network-tools-depends/ncftp/patches/ncftpd-gcc10-build-fix.patch @@ -0,0 +1,12 @@ +diff -Nur a/sh_util/gpshare.c b/sh_util/gpshare.c +--- a/sh_util/gpshare.c 2016-11-13 00:53:39.000000000 +0100 ++++ b/sh_util/gpshare.c 2020-06-22 20:24:08.160203885 +0200 +@@ -28,7 +28,7 @@ + + static int gIsAtty1 = 1, gIsAtty2 = 1; + extern int gLoadedBm, gBookmarkMatchMode; +-Bookmark gBm; ++extern Bookmark gBm; + + double + FileSize(double size, const char **uStr0, double *uMult0) From 8263659dcc3ccfc52723a5ce6fb0ed64e8916400 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:11:38 +0200 Subject: [PATCH 29/43] htop: fix compilation with gcc10 --- .../patches/htop-00-fix-gcc10-build.patch | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 packages/addons/addon-depends/system-tools-depends/htop/patches/htop-00-fix-gcc10-build.patch diff --git a/packages/addons/addon-depends/system-tools-depends/htop/patches/htop-00-fix-gcc10-build.patch b/packages/addons/addon-depends/system-tools-depends/htop/patches/htop-00-fix-gcc10-build.patch new file mode 100644 index 00000000000..6a2004b3cf7 --- /dev/null +++ b/packages/addons/addon-depends/system-tools-depends/htop/patches/htop-00-fix-gcc10-build.patch @@ -0,0 +1,52 @@ +From ee711740d2809e7aa3ebd57d58bfc02b1e9b034b Mon Sep 17 00:00:00 2001 +From: David Seifert +Date: Thu, 23 Jan 2020 17:27:10 +0100 +Subject: [PATCH] Fix GCC 10 switch to `-fno-common` default + +--- + CRT.h | 6 +++--- + linux/LinuxProcess.h | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/CRT.h b/CRT.h +index 933fe068..65998ac6 100644 +--- a/CRT.h ++++ b/CRT.h +@@ -140,7 +140,7 @@ extern const char **CRT_treeStr; + + extern int CRT_delay; + +-int* CRT_colors; ++extern int* CRT_colors; + + extern int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT]; + +@@ -150,13 +150,13 @@ extern int CRT_scrollHAmount; + + extern int CRT_scrollWheelVAmount; + +-char* CRT_termType; ++extern char* CRT_termType; + + // TODO move color scheme to Settings, perhaps? + + extern int CRT_colorScheme; + +-void *backtraceArray[128]; ++extern void *backtraceArray[128]; + + #if HAVE_SETUID_ENABLED + +diff --git a/linux/LinuxProcess.h b/linux/LinuxProcess.h +index 6ce3037d..cbd77be9 100644 +--- a/linux/LinuxProcess.h ++++ b/linux/LinuxProcess.h +@@ -144,7 +144,7 @@ typedef struct LinuxProcess_ { + #endif + + +-long long btime; /* semi-global */ ++extern long long btime; /* semi-global */ + + extern ProcessFieldData Process_fields[]; + From 7930ae0c576bd27a6afcc1e1fd93471334023e7e Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:12:06 +0200 Subject: [PATCH 30/43] lcdd: fix compilation with gcc10 --- .../lcdd-fix-compilation-with-gcc10.patch | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 packages/addons/service/lcdd/patches/lcdd-fix-compilation-with-gcc10.patch diff --git a/packages/addons/service/lcdd/patches/lcdd-fix-compilation-with-gcc10.patch b/packages/addons/service/lcdd/patches/lcdd-fix-compilation-with-gcc10.patch new file mode 100644 index 00000000000..53dce70bd86 --- /dev/null +++ b/packages/addons/service/lcdd/patches/lcdd-fix-compilation-with-gcc10.patch @@ -0,0 +1,42 @@ +From 084126b03f29b33ab3e657c66e8c6a439f27f8e1 Mon Sep 17 00:00:00 2001 +From: Harald Geyer +Date: Mon, 10 Feb 2020 13:15:10 +0100 +Subject: [PATCH] Fix compilation with GCC >= 10.x + +Starting with GCC >= 10.x, -fno-common is used as default +instead of -fcommon. This patch fixes the compilation. + +Closes: #148 + +Suggested-by: Conrad Kostecki +Signed-off-by: Harald Geyer +--- + clients/lcdproc/iface.c | 1 + + clients/lcdproc/iface.h | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/clients/lcdproc/iface.c b/clients/lcdproc/iface.c +index 40e50cb7..1ac355bd 100644 +--- a/clients/lcdproc/iface.c ++++ b/clients/lcdproc/iface.c +@@ -32,6 +32,7 @@ + #define UNSET_INT -1 + #define UNSET_STR "\01" + ++IfaceInfo iface[MAX_INTERFACES]; + + static int iface_count = 0; /* number of interfaces */ + static char unit_label[10] = "B"; /* default unit label is Bytes */ +diff --git a/clients/lcdproc/iface.h b/clients/lcdproc/iface.h +index cc6dbaaf..c1bd6b5b 100644 +--- a/clients/lcdproc/iface.h ++++ b/clients/lcdproc/iface.h +@@ -18,7 +18,7 @@ + /** max number of interfaces in multi-interface mode */ + #define MAX_INTERFACES 3 + +-IfaceInfo iface[MAX_INTERFACES]; /* interface info */ ++extern IfaceInfo iface[MAX_INTERFACES]; /* interface info */ + + /** Update screen content */ + int iface_screen(int rep, int display, int *flags_ptr); From d6503aaf545fe3ac02f00d1c0f97fda83d758fdb Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:12:22 +0200 Subject: [PATCH 31/43] minidlna: fix compilation with gcc10 --- .../minidlna-02-Fix-building-with-gcc10.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 packages/addons/service/minidlna/patches/minidlna-02-Fix-building-with-gcc10.patch diff --git a/packages/addons/service/minidlna/patches/minidlna-02-Fix-building-with-gcc10.patch b/packages/addons/service/minidlna/patches/minidlna-02-Fix-building-with-gcc10.patch new file mode 100644 index 00000000000..779657c509e --- /dev/null +++ b/packages/addons/service/minidlna/patches/minidlna-02-Fix-building-with-gcc10.patch @@ -0,0 +1,39 @@ +From 55d5d57a1d5a10ee2d120fad0b4c23553054b586 Mon Sep 17 00:00:00 2001 +From: Jernej Skrabec +Date: Mon, 22 Jun 2020 20:12:13 +0200 +Subject: [PATCH] Fix building with gcc10 + +--- + image_utils.c | 2 +- + metadata.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/image_utils.c b/image_utils.c +index 24cfd0841954..e8d9635dc6e0 100644 +--- a/image_utils.c ++++ b/image_utils.c +@@ -190,7 +190,7 @@ jpeg_memory_src(j_decompress_ptr cinfo, const unsigned char * buffer, size_t buf + src->pub.bytes_in_buffer = bufsize; + } + +-jmp_buf setjmp_buffer; ++static jmp_buf setjmp_buffer; + /* Don't exit on error like libjpeg likes to do */ + static void + libjpeg_error_handler(j_common_ptr cinfo) +diff --git a/metadata.c b/metadata.c +index 9cd86dc64779..4781db716d1a 100644 +--- a/metadata.c ++++ b/metadata.c +@@ -502,7 +502,7 @@ GetAudioMetadata(const char *path, const char *name) + } + + /* For libjpeg error handling */ +-jmp_buf setjmp_buffer; ++static jmp_buf setjmp_buffer; + static void + libjpeg_error_handler(j_common_ptr cinfo) + { +-- +2.27.0 + From 3ca598c4355ce5793534c6569c91c93b2afe5bef Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:12:40 +0200 Subject: [PATCH 32/43] minisatip: fix compilation with gcc10 --- ...n-and-definition-of-global-variables.patch | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 packages/addons/service/minisatip/patches/minisatip-Fix-declaration-and-definition-of-global-variables.patch diff --git a/packages/addons/service/minisatip/patches/minisatip-Fix-declaration-and-definition-of-global-variables.patch b/packages/addons/service/minisatip/patches/minisatip-Fix-declaration-and-definition-of-global-variables.patch new file mode 100644 index 00000000000..465e3263616 --- /dev/null +++ b/packages/addons/service/minisatip/patches/minisatip-Fix-declaration-and-definition-of-global-variables.patch @@ -0,0 +1,43 @@ +From b7a9982022ea54d87d310a041c38c6c69b6e49da Mon Sep 17 00:00:00 2001 +From: Klaas de Waal +Date: Sun, 17 May 2020 23:00:09 +0200 +Subject: [PATCH] Fix declaration and definition of global variables + +Definition of global variable httpc now in utils.c with declaration in utils.h. +Definition of global variable source_map now in adapter.c with declaration in adapter.h. +This fixes multiple defined symbol linking errors with linking issue with multiple defined symbols +in Fedora 32 with gcc version 10.1.1 20200507 (Red Hat 10.1.1-1) (GCC) +--- + src/adapter.c | 1 + + src/adapter.h | 2 +- + src/utils.c | 2 ++ + src/utils.h | 3 ++- + 4 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/utils.c b/src/utils.c +index 8c27954..5be35fd 100644 +--- a/src/utils.c ++++ b/src/utils.c +@@ -63,6 +63,8 @@ + int MAX_SINFO; + char pn[256]; + ++Shttp_client *httpc[MAX_HTTPC]; ++ + typedef struct tmpinfo + { + unsigned char enabled; +diff --git a/src/utils.h b/src/utils.h +index 6ef1831..efcccfa 100644 +--- a/src/utils.h ++++ b/src/utils.h +@@ -88,7 +88,8 @@ typedef struct struct_http_client + + #define get_httpc(i) ((i >= 0 && i < MAX_HTTPC && httpc[i] && httpc[i]->enabled) ? httpc[i] : NULL) + +-Shttp_client *httpc[MAX_HTTPC]; ++extern Shttp_client *httpc[MAX_HTTPC]; ++ + int http_client(char *url, char *request, void *callback, void *opaque); + + unsigned char *getItem(uint32_t key); From 530437672341594af6b1fed5b6ae86c7b0197bd5 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:13:00 +0200 Subject: [PATCH 33/43] tvheadend42: fix compilation with gcc10 --- ...nd42-04-Fix-building-with-fno-common.patch | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 packages/addons/service/tvheadend42/patches/tvheadend42-04-Fix-building-with-fno-common.patch diff --git a/packages/addons/service/tvheadend42/patches/tvheadend42-04-Fix-building-with-fno-common.patch b/packages/addons/service/tvheadend42/patches/tvheadend42-04-Fix-building-with-fno-common.patch new file mode 100644 index 00000000000..d9be78d55b9 --- /dev/null +++ b/packages/addons/service/tvheadend42/patches/tvheadend42-04-Fix-building-with-fno-common.patch @@ -0,0 +1,52 @@ +From 8a2942a361e95ccdbd30c1edc7627df3862cdbbe Mon Sep 17 00:00:00 2001 +From: James Le Cuirot +Date: Fri, 15 May 2020 17:45:30 +0100 +Subject: [PATCH] Fix building with -fno-common (default from GCC 10) + +--- + src/input.h | 4 ++-- + src/input/mpegts.c | 2 ++ + src/input/mpegts.h | 2 +- + 3 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/input.h b/src/input.h +index a9c96df048..3dce355c6a 100644 +--- a/src/input.h ++++ b/src/input.h +@@ -133,8 +133,8 @@ void tvh_hardware_delete ( tvh_hardware_t *th ); + extern const idclass_t tvh_input_class; + extern const idclass_t tvh_input_instance_class; + +-tvh_input_list_t tvh_inputs; +-tvh_hardware_list_t tvh_hardware; ++extern tvh_input_list_t tvh_inputs; ++extern tvh_hardware_list_t tvh_hardware; + + #define TVH_INPUT_FOREACH(x) LIST_FOREACH(x, &tvh_inputs, ti_link) + #define TVH_HARDWARE_FOREACH(x) LIST_FOREACH(x, &tvh_hardware, th_link) +diff --git a/src/input/mpegts.c b/src/input/mpegts.c +index e02d491f19..fca4f34296 100644 +--- a/src/input/mpegts.c ++++ b/src/input/mpegts.c +@@ -20,6 +20,8 @@ + #include "mpegts/fastscan.h" + #include "memoryinfo.h" + ++struct mpegts_listeners mpegts_listeners; ++ + extern memoryinfo_t mpegts_input_queue_memoryinfo; + extern memoryinfo_t mpegts_input_table_memoryinfo; + +diff --git a/src/input/mpegts.h b/src/input/mpegts.h +index 9dda3bacaa..9c4c57b73b 100644 +--- a/src/input/mpegts.h ++++ b/src/input/mpegts.h +@@ -1149,7 +1149,7 @@ typedef struct mpegts_listener + void (*ml_mux_delete) (mpegts_mux_t *mm, void *p); + } mpegts_listener_t; + +-LIST_HEAD(,mpegts_listener) mpegts_listeners; ++extern LIST_HEAD(mpegts_listeners, mpegts_listener) mpegts_listeners; + + #define mpegts_add_listener(ml)\ + LIST_INSERT_HEAD(&mpegts_listeners, ml, ml_link) From bfc49c9c8ed5cba5f4f56c8c8c8756bdd072feef Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:13:38 +0200 Subject: [PATCH 34/43] libretro-cap32: fix compilation with gcc10 --- ...o-cap32-Fix-declaration-of-ev_events.patch | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 packages/emulation/libretro-cap32/patches/libretro-cap32-Fix-declaration-of-ev_events.patch diff --git a/packages/emulation/libretro-cap32/patches/libretro-cap32-Fix-declaration-of-ev_events.patch b/packages/emulation/libretro-cap32/patches/libretro-cap32-Fix-declaration-of-ev_events.patch new file mode 100644 index 00000000000..47b9b0252bd --- /dev/null +++ b/packages/emulation/libretro-cap32/patches/libretro-cap32-Fix-declaration-of-ev_events.patch @@ -0,0 +1,35 @@ +From 2a00890a52ee21b63100e21dcb95940943ba6810 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Mon, 4 May 2020 18:11:21 +0200 +Subject: [PATCH] Fix declaration of ev_events + +--- + libretro/retro_events.c | 1 + + libretro/retro_events.h | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/libretro/retro_events.c b/libretro/retro_events.c +index 50f4364..0a9e3e9 100644 +--- a/libretro/retro_events.c ++++ b/libretro/retro_events.c +@@ -59,6 +59,7 @@ const uint8_t bit_values[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; + static uint8_t keyboard_translation[MAX_KEYSYMS]; + unsigned int last_input[PORTS_NUMBER] = {0,0}; + uint32_t padnum = 0; ++bool (*ev_events)(void); + + const uint8_t btnPAD[MAX_PADCFG][MAX_BUTTONS] = { + { // JOYSTICK CFG +diff --git a/libretro/retro_events.h b/libretro/retro_events.h +index 9f53d36..63e24b5 100644 +--- a/libretro/retro_events.h ++++ b/libretro/retro_events.h +@@ -154,7 +154,7 @@ typedef struct { + #define JOY_EVENT_ID_Y 1 + + void ev_joysticks(); +-bool (*ev_events)(void); ++extern bool (*ev_events)(void); + void ev_combo_set(unsigned btn); + void ev_init(); + From 29506634e5bdd55e51cb5fb0fbb1a2e940ba4c69 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:13:48 +0200 Subject: [PATCH 35/43] libretro-fuse: fix compilation with gcc10 --- .../libretro-fuse-Emscripten-fixes.patch | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 packages/emulation/libretro-fuse/patches/libretro-fuse-Emscripten-fixes.patch diff --git a/packages/emulation/libretro-fuse/patches/libretro-fuse-Emscripten-fixes.patch b/packages/emulation/libretro-fuse/patches/libretro-fuse-Emscripten-fixes.patch new file mode 100644 index 00000000000..8a4d9fa2cfe --- /dev/null +++ b/packages/emulation/libretro-fuse/patches/libretro-fuse-Emscripten-fixes.patch @@ -0,0 +1,50 @@ +From 6640ae1c834c31a776ad1d22c77ed919e8fe3c07 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Wed, 6 May 2020 02:02:59 +0200 +Subject: [PATCH] Emscripten fixes + +--- + fuse/ui/widget/widget.c | 2 +- + src/libretro.c | 2 +- + zlib/gzguts.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/fuse/ui/widget/widget.c b/fuse/ui/widget/widget.c +index 542a47f..0437cd5 100644 +--- a/fuse/ui/widget/widget.c ++++ b/fuse/ui/widget/widget.c +@@ -93,7 +93,7 @@ typedef struct widget_recurse_t { + static widget_recurse_t widget_return[10]; /* The stack to recurse on */ + + /* The settings used whilst playing with an options dialog box */ +-settings_info widget_options_settings; ++extern settings_info widget_options_settings; + + static int widget_read_font( const char *filename ) + { +diff --git a/src/libretro.c b/src/libretro.c +index ba595b7..19948c6 100644 +--- a/src/libretro.c ++++ b/src/libretro.c +@@ -476,7 +476,7 @@ static int get_joystick(unsigned device) + #ifdef GIT_VERSION + static char version[] = PACKAGE_VERSION " " GIT_VERSION; + #else +-const char *fuse_githash; ++extern const char *fuse_githash; + static char version[] = PACKAGE_VERSION " ......."; + #endif + +diff --git a/zlib/gzguts.h b/zlib/gzguts.h +index 6463b71..8e83b1d 100644 +--- a/zlib/gzguts.h ++++ b/zlib/gzguts.h +@@ -18,7 +18,7 @@ + # define ZLIB_INTERNAL + #endif + +-#ifdef _IOS_ARM64 ++#if defined(_IOS_ARM64) || defined(EMSCRIPTEN) + #include + #endif + From c434ffbe1f211ebbd8ee13309b13939a3167011d Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:14:02 +0200 Subject: [PATCH 36/43] libretro-vice: fix compilation with gcc10 --- ...vice-0001-fix-compilation-with-gcc10.patch | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 packages/emulation/libretro-vice/patches/libretro-vice-0001-fix-compilation-with-gcc10.patch diff --git a/packages/emulation/libretro-vice/patches/libretro-vice-0001-fix-compilation-with-gcc10.patch b/packages/emulation/libretro-vice/patches/libretro-vice-0001-fix-compilation-with-gcc10.patch new file mode 100644 index 00000000000..f80d7256bd3 --- /dev/null +++ b/packages/emulation/libretro-vice/patches/libretro-vice-0001-fix-compilation-with-gcc10.patch @@ -0,0 +1,32 @@ +From b72cd16bafbb8b54ae9449248d1e0d559fa6f02d Mon Sep 17 00:00:00 2001 +From: Jernej Skrabec +Date: Mon, 22 Jun 2020 23:16:41 +0200 +Subject: [PATCH] fix compilation with gcc10 + +--- + vice/src/arch/libretro/archdep.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/vice/src/arch/libretro/archdep.c b/vice/src/arch/libretro/archdep.c +index dc3491f2ace4..0465c098f031 100644 +--- a/vice/src/arch/libretro/archdep.c ++++ b/vice/src/arch/libretro/archdep.c +@@ -64,7 +64,7 @@ + #include "util.h" + #include "keyboard.h" + +-#define LIBRETROHACK 1 ++//#define LIBRETROHACK 1 + #ifdef LIBRETROHACK + //FIXME remove me! + BYTE plus4tcbm_outputa[2], plus4tcbm_outputb[2], plus4tcbm_outputc[2]; +@@ -715,4 +715,4 @@ void archdep_vice_exit(int excode) + { + exit(excode); + } +-*/ +\ No newline at end of file ++*/ +-- +2.27.0 + From 8dcf6cb9040f1d0b9493fa79c0782f132b4a6726 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:14:44 +0200 Subject: [PATCH 37/43] audiodecoder.ncsf: fix compilation with gcc10 --- ...oder.ncsf-0002-fix-build-with-gcc-10.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/mediacenter/kodi-binary-addons/audiodecoder.ncsf/patches/audiodecoder.ncsf-0002-fix-build-with-gcc-10.patch diff --git a/packages/mediacenter/kodi-binary-addons/audiodecoder.ncsf/patches/audiodecoder.ncsf-0002-fix-build-with-gcc-10.patch b/packages/mediacenter/kodi-binary-addons/audiodecoder.ncsf/patches/audiodecoder.ncsf-0002-fix-build-with-gcc-10.patch new file mode 100644 index 00000000000..c85652c8969 --- /dev/null +++ b/packages/mediacenter/kodi-binary-addons/audiodecoder.ncsf/patches/audiodecoder.ncsf-0002-fix-build-with-gcc-10.patch @@ -0,0 +1,24 @@ +From 2df5d26162b580a21489dd3e3157a9984c4c20e3 Mon Sep 17 00:00:00 2001 +From: Jernej Skrabec +Date: Mon, 22 Jun 2020 19:06:04 +0200 +Subject: [PATCH] fix build with gcc 10 + +--- + lib/SSEQPlayer/common.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/SSEQPlayer/common.h b/lib/SSEQPlayer/common.h +index 747000615dea..a447785668d0 100644 +--- a/lib/SSEQPlayer/common.h ++++ b/lib/SSEQPlayer/common.h +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + /* + * Pseudo-file data structure +-- +2.27.0 + From 2705254c14f11d8c9dd3b5c861c3a1245409da98 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 00:15:00 +0200 Subject: [PATCH 38/43] audiodecoder.wsr: fix compilation with gcc10 --- ...coder.wsr-0001-Fix-build-with-gcc-10.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/mediacenter/kodi-binary-addons/audiodecoder.wsr/patches/audiodecoder.wsr-0001-Fix-build-with-gcc-10.patch diff --git a/packages/mediacenter/kodi-binary-addons/audiodecoder.wsr/patches/audiodecoder.wsr-0001-Fix-build-with-gcc-10.patch b/packages/mediacenter/kodi-binary-addons/audiodecoder.wsr/patches/audiodecoder.wsr-0001-Fix-build-with-gcc-10.patch new file mode 100644 index 00000000000..a722aa105c9 --- /dev/null +++ b/packages/mediacenter/kodi-binary-addons/audiodecoder.wsr/patches/audiodecoder.wsr-0001-Fix-build-with-gcc-10.patch @@ -0,0 +1,24 @@ +From 88aefc6c5b8f271872d4c99355f0a7d888596d73 Mon Sep 17 00:00:00 2001 +From: Jernej Skrabec +Date: Mon, 22 Jun 2020 19:13:57 +0200 +Subject: [PATCH] Fix build with gcc 10 + +--- + lib/in_wsr/ws_audio.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/in_wsr/ws_audio.h b/lib/in_wsr/ws_audio.h +index 11d80da0b6cc..2d3d661ca498 100644 +--- a/lib/in_wsr/ws_audio.h ++++ b/lib/in_wsr/ws_audio.h +@@ -10,6 +10,6 @@ void ws_audio_port_write(BYTE port,BYTE value); + BYTE ws_audio_port_read(BYTE port); + void ws_audio_process(void); + void ws_audio_sounddma(void); +-int WaveAdrs; ++extern int WaveAdrs; + + #endif +-- +2.27.0 + From 85a599cee72394ae154f89fe363279143b2237b7 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 23 Jun 2020 20:25:40 +0200 Subject: [PATCH 39/43] stress-ng: Fix parallel build --- .../stress-ng/patches/fix-parallel-build.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 packages/addons/addon-depends/system-tools-depends/stress-ng/patches/fix-parallel-build.patch diff --git a/packages/addons/addon-depends/system-tools-depends/stress-ng/patches/fix-parallel-build.patch b/packages/addons/addon-depends/system-tools-depends/stress-ng/patches/fix-parallel-build.patch new file mode 100644 index 00000000000..c076fe11e91 --- /dev/null +++ b/packages/addons/addon-depends/system-tools-depends/stress-ng/patches/fix-parallel-build.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index 15c9e6cc828c..3b68824ce727 100644 +--- a/Makefile ++++ b/Makefile +@@ -376,7 +376,7 @@ stress-ng: $(OBJS) + + makeconfig: + @if [ ! -e config ]; then \ +- STATIC=$(STATIC) $(MAKE) -f Makefile.config; \ ++ STATIC=$(STATIC) $(MAKE) -j1 -f Makefile.config; \ + fi + + # From 8c42ca418dee4fcee994890a6df5c247e2a89620 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Wed, 24 Jun 2020 00:15:24 +0200 Subject: [PATCH 40/43] atk: update to 2.36.0 --- packages/addons/addon-depends/chrome-depends/atk/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/addons/addon-depends/chrome-depends/atk/package.mk b/packages/addons/addon-depends/chrome-depends/atk/package.mk index de27b94bd68..46833214e3f 100644 --- a/packages/addons/addon-depends/chrome-depends/atk/package.mk +++ b/packages/addons/addon-depends/chrome-depends/atk/package.mk @@ -3,8 +3,8 @@ # Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv) PKG_NAME="atk" -PKG_VERSION="2.29.1" -PKG_SHA256="1aa7707c6297c1797fe4d79a22a57ede4d5586b0f7a3b30e886d7ca9d75f20da" +PKG_VERSION="2.36.0" +PKG_SHA256="fb76247e369402be23f1f5c65d38a9639c1164d934e40f6a9cf3c9e96b652788" PKG_LICENSE="GPL" PKG_SITE="http://library.gnome.org/devel/atk/" PKG_URL="https://ftp.gnome.org/pub/gnome/sources/atk/${PKG_VERSION:0:4}/atk-$PKG_VERSION.tar.xz" From d469b4210881cb52c4b943adc21b4d6e4f17ffcb Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Wed, 24 Jun 2020 00:16:09 +0200 Subject: [PATCH 41/43] at-spi2-core: Update to 2.36.0 --- .../addon-depends/chrome-depends/at-spi2-core/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/addons/addon-depends/chrome-depends/at-spi2-core/package.mk b/packages/addons/addon-depends/chrome-depends/at-spi2-core/package.mk index 1add64aed13..0e8f707fc8f 100644 --- a/packages/addons/addon-depends/chrome-depends/at-spi2-core/package.mk +++ b/packages/addons/addon-depends/chrome-depends/at-spi2-core/package.mk @@ -3,8 +3,8 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="at-spi2-core" -PKG_VERSION="2.28.0" -PKG_SHA256="42a2487ab11ce43c288e73b2668ef8b1ab40a0e2b4f94e80fca04ad27b6f1c87" +PKG_VERSION="2.36.0" +PKG_SHA256="88da57de0a7e3c60bc341a974a80fdba091612db3547c410d6deab039ca5c05a" PKG_LICENSE="OSS" PKG_SITE="http://www.gnome.org/" PKG_URL="https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/${PKG_VERSION:0:4}/at-spi2-core-$PKG_VERSION.tar.xz" From 731f5fbcc00a994978a746d0bc98a3a4910ab191 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Wed, 24 Jun 2020 00:16:37 +0200 Subject: [PATCH 42/43] at-spi2-atk: Update to 2.34.2 --- .../addon-depends/chrome-depends/at-spi2-atk/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/addons/addon-depends/chrome-depends/at-spi2-atk/package.mk b/packages/addons/addon-depends/chrome-depends/at-spi2-atk/package.mk index 4dfa6e5d8af..06da8d14a3b 100644 --- a/packages/addons/addon-depends/chrome-depends/at-spi2-atk/package.mk +++ b/packages/addons/addon-depends/chrome-depends/at-spi2-atk/package.mk @@ -3,8 +3,8 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="at-spi2-atk" -PKG_VERSION="2.26.2" -PKG_SHA256="61891f0abae1689f6617a963105a3f1dcdab5970c4a36ded9c79a7a544b16a6e" +PKG_VERSION="2.34.2" +PKG_SHA256="901323cee0eef05c01ec4dee06c701aeeca81a314a7d60216fa363005e27f4f0" PKG_LICENSE="OSS" PKG_SITE="http://www.gnome.org/" PKG_URL="https://ftp.gnome.org/pub/gnome/sources/at-spi2-atk/${PKG_VERSION:0:4}/at-spi2-atk-$PKG_VERSION.tar.xz" From 53a85c08ad155da42de7a31de19b6c01df054d82 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Fri, 26 Jun 2020 15:20:37 +0200 Subject: [PATCH 43/43] efivar: fix build with gcc10 --- .../system-tools-depends/depends/efivar/package.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/addons/addon-depends/system-tools-depends/depends/efivar/package.mk b/packages/addons/addon-depends/system-tools-depends/depends/efivar/package.mk index a2fbdf1ff14..6f4d46450bf 100644 --- a/packages/addons/addon-depends/system-tools-depends/depends/efivar/package.mk +++ b/packages/addons/addon-depends/system-tools-depends/depends/efivar/package.mk @@ -16,6 +16,10 @@ make_host() { make -C src/ include/efivar/efivar-guids.h } +pre_make_target() { + sed -e 's/-Werror//' -i gcc.specs +} + make_target() { make -C src/ libefivar.a libefiboot.a efivar.h efivar }