Skip to content

Commit

Permalink
Fix an issue that occurs when using LTO and TCP is not enabled.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
romacdon committed Sep 18, 2024
1 parent f07bcc2 commit 9809998
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion third_party/tcplp/bsdtcp/tcp_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ tcp_state_change(struct tcpcb *tp, int newstate)
}

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

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

0 comments on commit 9809998

Please sign in to comment.