Linking errors when compiling with debug symbols

Denys Vlasenko vda.linux at googlemail.com
Tue Aug 25 14:25:50 UTC 2015


No, it's my fault.
Without optimization, this code

        sockopt = offsetof(struct icmp6_hdr, icmp6_cksum);
        if (sockopt != 2)
                BUG_bad_offsetof_icmp6_cksum();

will not optimize out the comparison. So the generated code
will contain the call, even though it will never execute.

Fixing it...


On Tue, Aug 25, 2015 at 3:17 PM, Bartosz Gołaszewski
<bartekgola at gmail.com> wrote:
> I'm unable to compile current git with debugging symbols.
>
> networking/lib.a(ping.o): In function `ping6':
> /home/brgl/workspace/gitbook/busybox/networking/ping.c:773: undefined
> reference to `BUG_bad_offsetof_icmp6_cksum'
> collect2: error: ld returned 1 exit status
>
> Bisect points at commit c52cbea2.
>
> BUG_bad_offsetof_icmp6_cksum is declared at ./networking/ping.c:735
> but not defined. Has been for some time apparently but said commit
> seems to have triggered this failure.
>
> --
> Best regards,
> Bartosz Golaszewski


More information about the busybox mailing list