[llvm-bugs] [Bug 41035] Linux kernel build: Regression due memcmp to bcmp optimization

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 12 09:50:58 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41035

James Y Knight <jyknight at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #13 from James Y Knight <jyknight at google.com> ---
This is working as intended.

When a compile doesn't specify -ffreestanding, the compiler assumes that the
functions provided by the environment's normal libc will be available to the
link. (And in this case, glibc provides bcmp, so the compiler may assume bcmp's
availability.)

I do understand *why* the kernel is not using -ffreestanding -- it wants to get
the typical compiler optimizations based on the semantics of the standard
string/mem functions.

But, as happened here, building in that way may periodically require
implementing some additional function, or providing additional -fno-builtin
flags.

We could discuss adding support in the compiler for doing the reverse --
starting with -ffreestanding, and then explicitly enabling all of the builtins
that the kernel DOES provide and want optimizations for. That seems a
potentially reasonable compiler enhancement, if kernel folks want to go that
way, but I'm not really sure it's worth it, given how infrequently this sort of
situation pops up.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190312/a18d2699/attachment.html>


More information about the llvm-bugs mailing list