Re: Linux 4.19 in Debian FTBFS with "undefined reference to `strcmp'"

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

 



Hi!

On 12/21/18 7:21 AM, Finn Thain wrote:
There are various patches to choose from.

1) As Andreas said, "strncmp doesn't make sense here." I agree, it's 
inefficient to use strncmp(a, b, strlen(a)) or strncmp(&a[0], b, sizeof(a))
etc.

We can find and fix these call sites as and when they break the build. I 
sent an incomplete patch to fix some of them -- 
https://lore.kernel.org/lkml/alpine.LNX.2.21.1807241423000.8@nippy.intranet/

2) We can use -ffreestanding, to avoid risky optimizations involving libc.

Opened a pull request on salsa.debian.org for that now:

https://salsa.debian.org/kernel-team/linux/merge_requests/94

Also one for kernel 4.20:

https://salsa.debian.org/kernel-team/linux/merge_requests/94

3) As Arnd said, we can provide strcmp. That's what my #if 0 workaround 
did. I've not sent that upstream because a strcmp function (besides 
__builtin_strcmp) is not needed given either of the above solutions.

Any or all of these approaches will avoid the link error. Option (1) seems 
to be approved by maintainers. So if you want a patch that can be sent 
upstream, that would be it. That solution might be a lot more maintainable 
if it took the form of a Coccinelle script that could be included in the 
kernel tree.

I don't mind either version. But it would be great if it could be fixed
upstream soonish so we don't have to continue carrying the patch in Debian.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@xxxxxxxxxx
`. `'   Freie Universitaet Berlin - glaubitz@xxxxxxxxxxxxxxxxxxx
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux