Skip to content

Commit fa3509e

Browse files
authored
[tcplp] fix an issue that occurs when using LTO and TCP is not enabled (openthread#10726)
When building and linking with link time optimizations and TCP is not enabled (OPENTHREAD_CONFIG_TCP_ENABLE = 0) the following error occurs: tcp_subr.c:96: undefined reference to tcplp_sys_get_ticks' To address the problem we are removing the __attribute__((used)) annotation on the initialize_tcb function which will prevent the function from being retained when no one references it.
1 parent ba3bce2 commit fa3509e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

third_party/tcplp/bsdtcp/tcp_subr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ tcp_state_change(struct tcpcb *tp, int newstate)
9292
}
9393

9494
/* samkumar: Based on tcp_newtcb in tcp_subr.c, and tcp_usr_attach in tcp_usrreq.c. */
95-
__attribute__((used)) void initialize_tcb(struct tcpcb* tp) {
95+
void initialize_tcb(struct tcpcb* tp) {
9696
uint32_t ticks = tcplp_sys_get_ticks();
9797

9898
/* samkumar: Clear all fields starting laddr; rest are initialized by the host. */

0 commit comments

Comments
 (0)