Blob Blame History Raw
The following error...

  In file included from /usr/include/string.h:25:0,
                   from ../../../source/include/platform/aclinux.h:80,
                   from ../../../source/include/platform/acenv.h:149,
                   from ../../../source/include/acpi.h:56,
                   from ../../../source/common/adfile.c:45:
  /usr/include/features.h:330:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]

results from running the following (see acpica-tools.spec's %check section)...

  %check
  cd tests

  # ASL tests
  ./aslts.sh                         # relies on non-zero exit

when the bash script aslts.sh's function build_acpi_tools() does a 'make iasl'.

And as noted in the error message, when a '-D_FORTIFY_SOURCE' is present on
the gcc command line, an optimization option also needs to be present. At
least a '-O', but '-O2' would seem more appropriate here because of the
'-D_FORTIFY_SOURCE=2'.

Note that prior to this patch, global optimization options were not used
because of issues that resulted on some compilers (like gcc 4.4). But
building this package via RH's Brew appears to be safe with the '-O2' option.

diff -urN a/generate/unix/Makefile.config b/generate/unix/Makefile.config
--- a/generate/unix/Makefile.config	2013-08-23 11:50:53.000000000 -0500
+++ b/generate/unix/Makefile.config	2013-10-18 08:05:04.402569754 -0500
@@ -120,12 +120,12 @@
 # Common compiler flags
 #
 # Flags/option notes:
-#   Global optimization flags (such as -O2, -Os) are not used,
-#       since they cause issues on some compilers (such as gcc 4.4)
+#   Note that global optimization flags (such as -O2, -Os) can
+#     cause issues on some compilers (such as gcc 4.4)
 #   The _GNU_SOURCE symbol is required for many hosts.
 #
 OPT_CFLAGS ?= \
-    -D_FORTIFY_SOURCE=2\
+    -O2 -D_FORTIFY_SOURCE=2\
     $(CWARNINGFLAGS)

 CFLAGS += \