View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015741CMakeCMakepublic2015-09-13 14:142016-02-01 09:10
ReporterRaphael Kubo da Costa 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSFreeBSDOS Version
Product VersionCMake 3.3.1 
Target VersionCMake 3.4Fixed in VersionCMake 3.4 
Summary0015741: GCC < 4.9 does not have full C11 support
DescriptionAs of version 3.3.1, CMake sets CMAKE_C11_{STANDARD,EXTENSION}_COMPILE_OPTION for GCC >= 4.7, and checks for C11 features for GCC >= 4.6. Additionally, it means CMake itself will be built with -std=gnu11 if GCC >= 4.7 is used.

However, GCC only has full C11 support with the 4.9 release (https://gcc.gnu.org/wiki/C11Status [^]). Specifically, support for C11's _Thread_local is only present on GCC >= 4.9. This combination makes CMake fail to build with GCC 4.7 and 4.8 on FreeBSD, as runetype.h uses _Thread_local and the fact that -std=gnu11 is passed makes it not be a typedef or define for something else that would work. In https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203066, [^] it was argued that this is GCC's fault for advertising C11 support in 4.7 and 4.8 before it was fully ready.

Before sending a patch to GNU-C.cmake, I'd like to check if it makes sense or what the best approach would be.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0039411)
Brad King (manager)
2015-09-14 08:57

I think we should simply change CMake's table to not expect C11 support until GCC 4.9.
(0039417)
Raphael Kubo da Costa (reporter)
2015-09-14 09:57

Alright, I'll send the patch I've prepared to the list then.
(0039421)
Brad King (manager)
2015-09-14 13:19

Relevant mailing list thread:

 [PATCH] Features: Only enable C11 support on GCC >= 4.9
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/14367 [^]
(0039426)
Brad King (manager)
2015-09-15 10:54

Relevant mailing list thread:

 [PATCH] Do not build CMake in C11 mode if _Thread_local support is broken.
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/14394 [^]
(0039427)
Brad King (manager)
2015-09-15 16:06

Patch from 0015741:0039426 applied:

 Avoid using C11 to build CMake if _Thread_local support is broken
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ffa6f057 [^]
(0040405)
Robert Maynard (manager)
2016-02-01 09:10

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2015-09-13 14:14 Raphael Kubo da Costa New Issue
2015-09-14 08:57 Brad King Note Added: 0039411
2015-09-14 09:57 Raphael Kubo da Costa Note Added: 0039417
2015-09-14 13:19 Brad King Note Added: 0039421
2015-09-15 10:54 Brad King Note Added: 0039426
2015-09-15 16:06 Brad King Note Added: 0039427
2015-09-15 16:06 Brad King Assigned To => Brad King
2015-09-15 16:06 Brad King Status new => resolved
2015-09-15 16:06 Brad King Resolution open => fixed
2015-09-15 16:06 Brad King Fixed in Version => CMake 3.4
2015-09-15 16:06 Brad King Target Version => CMake 3.4
2016-02-01 09:10 Robert Maynard Note Added: 0040405
2016-02-01 09:10 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team