Blame SOURCES/_FORTIFY_SOURCE-warning.patch

32dd66
The following error...
32dd66
32dd66
  In file included from /usr/include/string.h:25:0,
32dd66
                   from ../../../source/include/platform/aclinux.h:80,
32dd66
                   from ../../../source/include/platform/acenv.h:149,
32dd66
                   from ../../../source/include/acpi.h:56,
32dd66
                   from ../../../source/common/adfile.c:45:
32dd66
  /usr/include/features.h:330:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
32dd66
32dd66
results from running the following (see acpica-tools.spec's %check section)...
32dd66
32dd66
  %check
32dd66
  cd tests
32dd66
32dd66
  # ASL tests
32dd66
  ./aslts.sh                         # relies on non-zero exit
32dd66
32dd66
when the bash script aslts.sh's function build_acpi_tools() does a 'make iasl'.
32dd66
32dd66
And as noted in the error message, when a '-D_FORTIFY_SOURCE' is present on
32dd66
the gcc command line, an optimization option also needs to be present. At
32dd66
least a '-O', but '-O2' would seem more appropriate here because of the
32dd66
'-D_FORTIFY_SOURCE=2'.
32dd66
32dd66
Note that prior to this patch, global optimization options were not used
32dd66
because of issues that resulted on some compilers (like gcc 4.4). But
32dd66
building this package via RH's Brew appears to be safe with the '-O2' option.
32dd66
32dd66
diff -urN a/generate/unix/Makefile.config b/generate/unix/Makefile.config
32dd66
--- a/generate/unix/Makefile.config	2013-08-23 11:50:53.000000000 -0500
32dd66
+++ b/generate/unix/Makefile.config	2013-10-18 08:05:04.402569754 -0500
32dd66
@@ -120,12 +120,12 @@
32dd66
 # Common compiler flags
32dd66
 #
32dd66
 # Flags/option notes:
32dd66
-#   Global optimization flags (such as -O2, -Os) are not used,
32dd66
-#       since they cause issues on some compilers (such as gcc 4.4)
32dd66
+#   Note that global optimization flags (such as -O2, -Os) can
32dd66
+#     cause issues on some compilers (such as gcc 4.4)
32dd66
 #   The _GNU_SOURCE symbol is required for many hosts.
32dd66
 #
32dd66
 OPT_CFLAGS ?= \
32dd66
-    -D_FORTIFY_SOURCE=2\
32dd66
+    -O2 -D_FORTIFY_SOURCE=2\
32dd66
     $(CWARNINGFLAGS)
32dd66
32dd66
 CFLAGS += \