Pull in r270240 from upstream clang trunk (by me):
Make __FreeBSD_cc_version predefined macro configurable at build time The `FreeBSDTargetInfo` class has always set the `__FreeBSD_cc_version` predefined macro to a rather static value, calculated from the major OS version. In the FreeBSD base system, we will start incrementing the value of this macro whenever we make any signifant change to clang, so we need a way to configure the macro's value at build time. Use `FREEBSD_CC_VERSION` for this, which we can define in the FreeBSD build system using either the `-D` command line option, or an include file. Stock builds will keep the earlier value. Differential Revision: http://reviews.llvm.org/D20037 Follow-up commits will start using the __FreeBSD_cc_version to determine whether a bootstrap compiler has to be built during buildworld.
This commit is contained in:
parent
e48f47ddc1
commit
dd8214827f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=300314
@ -296,6 +296,10 @@ class DragonFlyBSDTargetInfo : public OSTargetInfo<Target> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef FREEBSD_CC_VERSION
|
||||||
|
#define FREEBSD_CC_VERSION 0U
|
||||||
|
#endif
|
||||||
|
|
||||||
// FreeBSD Target
|
// FreeBSD Target
|
||||||
template<typename Target>
|
template<typename Target>
|
||||||
class FreeBSDTargetInfo : public OSTargetInfo<Target> {
|
class FreeBSDTargetInfo : public OSTargetInfo<Target> {
|
||||||
@ -306,10 +310,13 @@ class FreeBSDTargetInfo : public OSTargetInfo<Target> {
|
|||||||
|
|
||||||
unsigned Release = Triple.getOSMajorVersion();
|
unsigned Release = Triple.getOSMajorVersion();
|
||||||
if (Release == 0U)
|
if (Release == 0U)
|
||||||
Release = 8;
|
Release = 8U;
|
||||||
|
unsigned CCVersion = FREEBSD_CC_VERSION;
|
||||||
|
if (CCVersion == 0U)
|
||||||
|
CCVersion = Release * 100000U + 1U;
|
||||||
|
|
||||||
Builder.defineMacro("__FreeBSD__", Twine(Release));
|
Builder.defineMacro("__FreeBSD__", Twine(Release));
|
||||||
Builder.defineMacro("__FreeBSD_cc_version", Twine(Release * 100000U + 1U));
|
Builder.defineMacro("__FreeBSD_cc_version", Twine(CCVersion));
|
||||||
Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
|
Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
|
||||||
DefineStd(Builder, "unix", Opts);
|
DefineStd(Builder, "unix", Opts);
|
||||||
Builder.defineMacro("__ELF__");
|
Builder.defineMacro("__ELF__");
|
||||||
|
Loading…
Reference in New Issue
Block a user