From b34d0665b790016165b4a9b565f462712057b2b5 Mon Sep 17 00:00:00 2001 From: "deepan.shivap" Date: Wed, 13 Nov 2024 21:30:38 +0900 Subject: [PATCH] fix build on GCC 14 for yocto GCC 14 compiler uses -fvisibility-inlines-hidden by default and it creates visibility conflicts. Compilation error: error: 'ot::BorderRouter::RoutingManager::RxRaTracker' declared with greater visibility than the type of its field 'ot::BorderRouter:: RoutingManager::RxRaTracker::mSignalTask' [-Werror=attributes] | 814 | class RxRaTracker : public InstanceLocator | | ^~~~~~~~~~~ | compilation terminated due to -Wfatal-errors. | cc1: all warnings being treated as errors In addition, for below error I have added changes refering - https://github.com/openwrt/openwrt/blob/main/package/libs/mbedtls/patches/100-fix-gcc14-build.patch error: array subscript 48 is outside array bounds of 'unsigned char[48]' [-Werror=array-bounds=] | 235 | r[i] = a[i] ^ b[i]; | | ~^~~ | compilation terminated due to -Wfatal-errors. | cc1: all warnings being treated as errors --- Upstream-Status: Denied [Reason - https://github.com/openthread/openthread/pull/10925] Signed-off-by: deepan.shivap src/core/border_router/routing_manager.cpp | 58 ++++++++++++++++++++++ src/core/border_router/routing_manager.hpp | 18 +++---- src/core/mac/data_poll_sender.cpp | 5 ++ src/core/mac/data_poll_sender.hpp | 2 +- src/core/net/srp_client.cpp | 2 + src/core/net/srp_client.hpp | 2 +- src/core/thread/mle.cpp | 10 ++++ src/core/thread/mle.hpp | 4 +- third_party/mbedtls/repo/library/common.h | 2 +- 9 files changed, 89 insertions(+), 14 deletions(-) diff --git a/src/core/border_router/routing_manager.cpp b/src/core/border_router/routing_manager.cpp index 5f7916ba4..664963757 100644 --- a/src/core/border_router/routing_manager.cpp +++ b/src/core/border_router/routing_manager.cpp @@ -806,6 +806,64 @@ bool RoutingManager::NetworkDataContainsUlaRoute(void) const return contains; } +void RoutingManager::HandleRxRaTrackerSignalTask(void) +{ + mRxRaTracker.HandleSignalTask(); +} + +void RoutingManager::HandleRxRaTrackerExpirationTimer(void) +{ + mRxRaTracker.HandleExpirationTimer(); +} + +void RoutingManager::HandleRxRaTrackerStaleTimer(void) +{ + mRxRaTracker.HandleStaleTimer(); +} + +void RoutingManager::HandleRxRaTrackerRouterTimer(void) +{ + mRxRaTracker.HandleRouterTimer(); +} + +void RoutingManager::HandleOnLinkPrefixManagerTimer(void) +{ + mOnLinkPrefixManager.HandleTimer(); +} + +void RoutingManager::HandleRioAdvertiserimer(void) +{ + mRioAdvertiser.HandleTimer(); +} + +#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE + +void RoutingManager::HandleNat64PrefixManagerTimer(void) +{ + mNat64PrefixManager.HandleTimer(); +} + +#endif // OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE + +void RoutingManager::HandleRoutePublisherTimer(void) +{ + mRoutePublisher.HandleTimer(); +} + +void RoutingManager::HandleRsSenderTimer(void) +{ + mRsSender.HandleTimer(); +} + +#if OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_ENABLE + +void HandlePdPrefixManagerTimer(void) +{ + mPdPrefixManager.HandleTimer(); +} + +#endif // OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_ENABLE + #if OPENTHREAD_CONFIG_BORDER_ROUTING_REACHABILITY_CHECK_ICMP6_ERROR_ENABLE void RoutingManager::CheckReachabilityToSendIcmpError(const Message &aMessage, const Ip6::Header &aIp6Header) diff --git a/src/core/border_router/routing_manager.hpp b/src/core/border_router/routing_manager.hpp index bfc138957..cc866e308 100644 --- a/src/core/border_router/routing_manager.hpp +++ b/src/core/border_router/routing_manager.hpp @@ -804,10 +804,10 @@ private: //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void HandleRxRaTrackerSignalTask(void) { mRxRaTracker.HandleSignalTask(); } - void HandleRxRaTrackerExpirationTimer(void) { mRxRaTracker.HandleExpirationTimer(); } - void HandleRxRaTrackerStaleTimer(void) { mRxRaTracker.HandleStaleTimer(); } - void HandleRxRaTrackerRouterTimer(void) { mRxRaTracker.HandleRouterTimer(); } + void HandleRxRaTrackerSignalTask(void); + void HandleRxRaTrackerExpirationTimer(void); + void HandleRxRaTrackerStaleTimer(void); + void HandleRxRaTrackerRouterTimer(void); class RxRaTracker : public InstanceLocator { @@ -1144,7 +1144,7 @@ private: //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void HandleOnLinkPrefixManagerTimer(void) { mOnLinkPrefixManager.HandleTimer(); } + void HandleOnLinkPrefixManagerTimer(void); class OnLinkPrefixManager : public InstanceLocator { @@ -1215,7 +1215,7 @@ private: //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void HandleRioAdvertiserimer(void) { mRioAdvertiser.HandleTimer(); } + void HandleRioAdvertiserimer(void); class RioAdvertiser : public InstanceLocator { @@ -1278,7 +1278,7 @@ private: #if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE - void HandleNat64PrefixManagerTimer(void) { mNat64PrefixManager.HandleTimer(); } + void HandleNat64PrefixManagerTimer(void); class Nat64PrefixManager : public InstanceLocator { @@ -1326,7 +1326,7 @@ private: //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void HandleRoutePublisherTimer(void) { mRoutePublisher.HandleTimer(); } + void HandleRoutePublisherTimer(void); class RoutePublisher : public InstanceLocator // Manages the routes that are published in net data { @@ -1411,7 +1411,7 @@ private: //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void HandleRsSenderTimer(void) { mRsSender.HandleTimer(); } + void HandleRsSenderTimer(void); class RsSender : public InstanceLocator { diff --git a/src/core/mac/data_poll_sender.cpp b/src/core/mac/data_poll_sender.cpp index c21bbacfe..6b974e164 100644 --- a/src/core/mac/data_poll_sender.cpp +++ b/src/core/mac/data_poll_sender.cpp @@ -517,6 +517,11 @@ uint32_t DataPollSender::CalculatePollPeriod(void) const return period; } +void DataPollSender::HandlePollTimer(void) +{ + IgnoreError(SendDataPoll()); +} + uint32_t DataPollSender::GetDefaultPollPeriod(void) const { uint32_t pollAhead = static_cast(kRetxPollPeriod) * kMaxPollRetxAttempts; diff --git a/src/core/mac/data_poll_sender.hpp b/src/core/mac/data_poll_sender.hpp index 1c532ab51..4db8e5923 100644 --- a/src/core/mac/data_poll_sender.hpp +++ b/src/core/mac/data_poll_sender.hpp @@ -257,7 +257,7 @@ private: void ScheduleNextPoll(PollPeriodSelector aPollPeriodSelector); uint32_t CalculatePollPeriod(void) const; const Neighbor &GetParent(void) const; - void HandlePollTimer(void) { IgnoreError(SendDataPoll()); } + void HandlePollTimer(void); #if OPENTHREAD_CONFIG_MULTI_RADIO Error GetPollDestinationAddress(Mac::Address &aDest, Mac::RadioType &aRadioType) const; #else diff --git a/src/core/net/srp_client.cpp b/src/core/net/srp_client.cpp index b7150ff7f..12b8f0b4f 100644 --- a/src/core/net/srp_client.cpp +++ b/src/core/net/srp_client.cpp @@ -2444,6 +2444,8 @@ exit: return error; } +void Client::HandleGuardTimer(void){} + #if OPENTHREAD_CONFIG_SRP_CLIENT_SWITCH_SERVER_ON_FAILURE void Client::SelectNextServer(bool aDisallowSwitchOnRegisteredHost) { diff --git a/src/core/net/srp_client.hpp b/src/core/net/srp_client.hpp index 8f5891bd0..367b1d280 100644 --- a/src/core/net/srp_client.hpp +++ b/src/core/net/srp_client.hpp @@ -1052,7 +1052,7 @@ private: void ApplyAutoStartGuardOnAttach(void); void ProcessAutoStart(void); Error SelectUnicastEntry(DnsSrpUnicastType aType, DnsSrpUnicastInfo &aInfo) const; - void HandleGuardTimer(void) {} + void HandleGuardTimer(void); #if OPENTHREAD_CONFIG_SRP_CLIENT_SWITCH_SERVER_ON_FAILURE void SelectNextServer(bool aDisallowSwitchOnRegisteredHost); #endif diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index 4de4705be..2e07222fc 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -3853,6 +3853,11 @@ exit: #if OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE +void Mle::HandleParentSearchTimer(void) +{ + mParentSearch.HandleTimer(); +} + void Mle::ParentSearch::SetEnabled(bool aEnabled) { VerifyOrExit(mEnabled != aEnabled); @@ -4423,6 +4428,11 @@ void Mle::TlvList::AddElementsFrom(const TlvList &aTlvList) //--------------------------------------------------------------------------------------------------------------------- // DelayedSender +void Mle::HandleDelayedSenderTimer(void) +{ + mDelayedSender.HandleTimer(); +} + Mle::DelayedSender::DelayedSender(Instance &aInstance) : InstanceLocator(aInstance) , mTimer(aInstance) diff --git a/src/core/thread/mle.hpp b/src/core/thread/mle.hpp index 58dcea1e7..613334896 100644 --- a/src/core/thread/mle.hpp +++ b/src/core/thread/mle.hpp @@ -1087,7 +1087,7 @@ private: //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void HandleDelayedSenderTimer(void) { mDelayedSender.HandleTimer(); } + void HandleDelayedSenderTimer(void); class DelayedSender : public InstanceLocator { @@ -1210,7 +1210,7 @@ private: //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #if OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE - void HandleParentSearchTimer(void) { mParentSearch.HandleTimer(); } + void HandleParentSearchTimer(void); class ParentSearch : public InstanceLocator { diff --git a/third_party/mbedtls/repo/library/common.h b/third_party/mbedtls/repo/library/common.h index 3936ffdfe..ce4dc1130 100644 --- a/third_party/mbedtls/repo/library/common.h +++ b/third_party/mbedtls/repo/library/common.h @@ -199,7 +199,7 @@ static inline void mbedtls_xor(unsigned char *r, uint8x16_t x = veorq_u8(v1, v2); vst1q_u8(r + i, x); } -#if defined(__IAR_SYSTEMS_ICC__) +#if defined(__IAR_SYSTEMS_ICC__) || (defined(MBEDTLS_COMPILER_IS_GCC) && MBEDTLS_GCC_VERSION >= 140100) /* This if statement helps some compilers (e.g., IAR) optimise out the byte-by-byte tail case * where n is a constant multiple of 16. * For other compilers (e.g. recent gcc and clang) it makes no difference if n is a compile-time