[llvm] r201679 - Disable override and final C++ keyword in gcc 4.6.

Logan Chien tzuhsiang.chien at gmail.com
Sat Feb 22 06:47:39 PST 2014


Hi David,

Thanks for your reply.  I am aware of the migration toward C++11.  In fact,
I build LLVM with various compiler including GCC 4.8 and Clang everyday.
However, for some reason, I have to release LLVM prebuilt binaries for some
user with old operating system, although I wish to deprecate them ASAP.  I
know that I am taking risk.  I will give up when that day really comes.
Thanks.

Logan


On Sat, Feb 22, 2014 at 12:32 AM, David Blaikie <dblaikie at gmail.com> wrote:

>
>
>
> On Fri, Feb 21, 2014 at 7:51 AM, Logan Chien <tzuhsiang.chien at gmail.com>wrote:
>
>> Hi Gordon,
>>
>> I have tried to use cmake as well.  I can build and test without problem
>> as well.  These are the commands which I am using:
>>
>> $ cmake ../llvm -DCMAKE_CXX_FLAGS=-std=c++0x
>> -DLLVM_FORCE_USE_OLD_TOOLCHAIN=1
>>
>
> Here
>
>
>>  $ make -j4
>> $ make check-all
>>
>> Sincerely,
>> Logan
>>
>>
>> On Fri, Feb 21, 2014 at 10:20 PM, Logan Chien <tzuhsiang.chien at gmail.com>wrote:
>>
>>> Hi Gordon,
>>>
>>> I am using autoconf.  I can build without problem with following
>>> commands:
>>>
>>> $ export CXXFLAGS=-std=c++0x
>>> $ ./configure --enable-optimized --disable-compiler-version-checks
>>>
>>
> And here.
>
> You've disabled the build system's version checks that are there to help
> you - within the next few weeks it's likely that those version checks won't
> be the only thing that breaks your build. They're there to warn you that
> you'll need to update your toolchain to a level that passes those checks or
> your build will be broken soon. (these versions are the minimum agreed
> versions we'll support when we start allowing C++11 code in the codebase -
> it won't take long for someone to commit some code that compiles/passes
> with these versions but is broken on older compilers such as the one you
> are running)
>
>
>>  $ make -j4
>>> $ make check-all
>>>
>>> The revision which I am using are LLVM/r201841, clang/r201849, and
>>> compiler-rt/r201845.
>>>
>>> The gcc version I am using is:
>>>
>>> $ gcc --version
>>> gcc-4.6.real (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
>>>
>>> Sincerely,
>>> Logan
>>>
>>>
>>> On Fri, Feb 21, 2014 at 2:45 AM, Gordon Keiser <gkeiser at arxan.com>wrote:
>>>
>>>> I pulled down trunk on Tuesday night, and it errors in CMake on linux
>>>> if GCC < 4.7, so I'm not really sure what purpose this serves.
>>>>
>>>>
>>>>
>>>> -Gordon
>>>>
>>>>
>>>>
>>>> *From:* llvm-commits-bounces at cs.uiuc.edu [mailto:
>>>> llvm-commits-bounces at cs.uiuc.edu] *On Behalf Of *Logan Chien
>>>> *Sent:* Wednesday, February 19, 2014 12:11 PM
>>>> *To:* Aaron Ballman
>>>> *Cc:* llvm-commits
>>>> *Subject:* Re: [llvm] r201679 - Disable override and final C++ keyword
>>>> in gcc 4.6.
>>>>
>>>>
>>>>
>>>> Hi Aaron,
>>>>
>>>> I know that GCC 4.7 is the minimum support compiler.  However, since
>>>> the change is limited to the compiler compatibility header (there are even
>>>> some checks for GCC 3.1 in this header) and this change fixes the build and
>>>> passes all test cases, I feel it is acceptable in this case.
>>>>
>>>> Although I know the code base might be incompatible with GCC 4.6 in the
>>>> near future, I wish to keep the backward compatibility as long as possible
>>>> given that only some simple change to compiler compatibility header is
>>>> required.  I agree that it won't make sense to stick with old syntax or
>>>> prohibit the usage of new language feature just for the backward
>>>> compatibility of the unsupported GCC 4.6.
>>>>
>>>> Sincerely,
>>>>
>>>> Logan
>>>>
>>>>
>>>>
>>>> On Wed, Feb 19, 2014 at 11:27 PM, Aaron Ballman <aaron at aaronballman.com>
>>>> wrote:
>>>>
>>>> Since our min supported compiler version is 4.7 (as of llvm 3.4), I
>>>> don't believe this commit really makes sense. Since we're trying to
>>>> make the switch to using C++11 functionality, I don't think we want to
>>>> add support for older compilers which will fail in other ways.
>>>>
>>>> ~Aaron
>>>>
>>>>
>>>> On Wed, Feb 19, 2014 at 10:04 AM, Logan Chien <
>>>> tzuhsiang.chien at gmail.com> wrote:
>>>> > Author: logan
>>>> > Date: Wed Feb 19 09:04:29 2014
>>>> > New Revision: 201679
>>>> >
>>>> > URL: http://llvm.org/viewvc/llvm-project?rev=201679&view=rev
>>>> > Log:
>>>> > Disable override and final C++ keyword in gcc 4.6.
>>>> >
>>>> > According to http://gcc.gnu.org/projects/cxx0x.html,
>>>> > override and final keyword was added in gcc 4.7.  Thus,
>>>> > we should not use these keywords in gcc 4.6 even when
>>>> > __GXX_EXPERIMENTAL_CXX0X__ is available.
>>>> >
>>>> > Modified:
>>>> >     llvm/trunk/include/llvm/Support/Compiler.h
>>>> >
>>>> > Modified: llvm/trunk/include/llvm/Support/Compiler.h
>>>> > URL:
>>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=201679&r1=201678&r2=201679&view=diff
>>>> >
>>>> ==============================================================================
>>>> > --- llvm/trunk/include/llvm/Support/Compiler.h (original)
>>>> > +++ llvm/trunk/include/llvm/Support/Compiler.h Wed Feb 19 09:04:29
>>>> 2014
>>>> > @@ -152,7 +152,8 @@
>>>> >  /// LLVM_FINAL - Expands to 'final' if the compiler supports it.
>>>> >  /// Use to mark classes or virtual methods as final.
>>>> >  #if __has_feature(cxx_override_control) || \
>>>> > -    defined(__GXX_EXPERIMENTAL_CXX0X__) || LLVM_MSC_PREREQ(1700)
>>>> > +    (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC_PREREQ(4, 7)) || \
>>>> > +    LLVM_MSC_PREREQ(1700)
>>>> >  #define LLVM_FINAL final
>>>> >  #else
>>>> >  #define LLVM_FINAL
>>>> > @@ -161,7 +162,8 @@
>>>> >  /// LLVM_OVERRIDE - Expands to 'override' if the compiler supports
>>>> it.
>>>> >  /// Use to mark virtual methods as overriding a base class method.
>>>> >  #if __has_feature(cxx_override_control) || \
>>>> > -    defined(__GXX_EXPERIMENTAL_CXX0X__) || LLVM_MSC_PREREQ(1700)
>>>> > +    (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC_PREREQ(4, 7)) || \
>>>> > +    LLVM_MSC_PREREQ(1700)
>>>> >  #define LLVM_OVERRIDE override
>>>> >  #else
>>>> >  #define LLVM_OVERRIDE
>>>> >
>>>> >
>>>> > _______________________________________________
>>>> > llvm-commits mailing list
>>>> > llvm-commits at cs.uiuc.edu
>>>> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>>
>>>>
>>>>
>>>
>>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140222/4d165a7b/attachment.html>


More information about the llvm-commits mailing list