[PATCH] Introduce the idea of a minimum libc version

Saleem Abdulrasool compnerd at compnerd.org
Sat Feb 14 09:23:38 PST 2015


Hi rnk,

Add the -mmin-libc-version= flag to the driver and encode this into the module
level metadata.  This will permit the backend to make certain code generation
choices with the knowledge that the target code will run on a minimum libc
version.

On Windows, this will enable us to enable a number of C99 math routines that are
available in MSVCRT 12.0+, though this is certainly not limited to Windows.
There have been cases where code generation on the Linux targets could do
something slightly different if it knew what version of libc it was targeting.

The module level metadata is needed to ensure that LTO does not break down.
When combining modules targeting differing minimum version, the selection of the
highest version should prevail (since older versions should work on newer, but
not vice-versa).

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7642

Files:
  include/clang/Driver/Options.td
  include/clang/Frontend/CodeGenOptions.def
  lib/CodeGen/CodeGenModule.cpp
  lib/Driver/Tools.cpp
  lib/Frontend/CompilerInvocation.cpp
  test/CodeGen/libc-version.c

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7642.19966.patch
Type: text/x-patch
Size: 4461 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150214/268045c2/attachment.bin>


More information about the cfe-commits mailing list