Undefined reference to __builtin_ctzll

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear GIT community,


I found myself in situation where I had to install GIT on Debian 3.1
sarge.  It comes with GCC 3.3.5. I tried to built from source but the
libgcc was not providing the ctzll function, thus I decided to put an
implementation.


I do not know how to post and do a nice patch (and whether somebody
will care), but I guess, for reference I can post my solution. Just
appended in compat/strlcpy.c the following:


int __builtin_ctzll (long long x)
{
        int i;
        for (i = 0; i < 8 * sizeof (long long); ++i)
                if (x & ((long long) 1  << i))
                        break;
        return i;
}


I guess that some ifdef macro can be used to detect compiler version
or missing __builtin_ctzll.


With best regards and hopes that this can help somebody in similar situation,
Radoslav.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]