Changeset 154008 in webkit
- Timestamp:
- Aug 13, 2013 9:58:17 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r154007 r154008 1 2013-08-13 Zan Dobersek <zdobersek@igalia.com> 2 3 [Autotools] Unicode's CFLAGS enforce -D_FORTIFY_SOURCE=2, -D_REENTRANT=1, causing faulty Clang builds 4 https://bugs.webkit.org/show_bug.cgi?id=119685 5 6 Reviewed by Gustavo Noronha Silva. 7 8 icu-config includes '-D_FORTIFY_SOURCE=2 -D_REENTRANT=1' when printing out C preprocessor flags that are used 9 as the C compiler flags to avoid other unwanted compiler options. This causes problems when building optimized 10 builds with Clang because of a bug in that compiler: 11 http://llvm.org/bugs/show_bug.cgi?id=16821 12 13 To avoid that, the C preprocessor search flags, as printed by `icu-config --cppflags-searchpath` are now used 14 the Unicode dependency's C compiler flags, avoiding unconditionally specifying the two macros. 15 16 To adjust for that, the `-pthread` flag is added to the global CFLAGS and CXXFLAGS variables, ensuring 17 the _REENTRANT define is set to 1 and declaring the flag globally instead of relying on Glib dependency's 18 C compiler flags to do so for us. -D_FORTIFY_SOURCE=2 is only added to the CFLAGS and CXXFLAGS variables if 19 the compiler in use is gcc or g++, preventing the Clang builds to malfunction. 20 21 * Source/autotools/FindDependencies.m4: 22 * Source/autotools/SetupCompilerFlags.m4: 23 1 24 2013-08-13 Zan Dobersek <zdobersek@igalia.com> 2 25 -
trunk/Source/autotools/FindDependencies.m4
r153885 r154008 126 126 # We don't use --cflags as this gives us a lot of things that we don't necessarily want, 127 127 # like debugging and optimization flags. See man (1) icu-config for more info. 128 UNICODE_CFLAGS=`$icu_config --cppflags `128 UNICODE_CFLAGS=`$icu_config --cppflags-searchpath` 129 129 UNICODE_LIBS=`$icu_config --ldflags-libsonly` 130 130 ;; -
trunk/Source/autotools/SetupCompilerFlags.m4
r154007 r154008 1 1 # Use C99 as the language standard for C code. 2 CFLAGS="$CFLAGS - std=c99"2 CFLAGS="$CFLAGS -pthread -std=c99" 3 3 # Use the C++11 standard. Do not warn about C++11 incompatibilities. 4 CXXFLAGS="$CXXFLAGS - std=c++11 -Wno-c++11-compat"4 CXXFLAGS="$CXXFLAGS -pthread -std=c++11 -Wno-c++11-compat" 5 5 6 6 # Clang requires suppression of unused arguments warnings. … … 14 14 if test "$cxx_compiler" = "clang++"; then 15 15 CXXFLAGS="$CXXFLAGS -stdlib=libstdc++ -Wno-c++11-extensions -Qunused-arguments" 16 fi 17 18 if test "$c_compiler" = "gcc"; then 19 CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2" 20 fi 21 if test "$cxx_compiler" = "g++"; then 22 CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2" 16 23 fi 17 24
Note: See TracChangeset
for help on using the changeset viewer.