https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117478

            Bug ID: 117478
           Summary: -ObjC is not accepted: error: argument to '-O' should
                    be a non-negative integer, 'g', 's', 'z' or 'fast'
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: objc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vital.had at gmail dot com
                CC: iains at gcc dot gnu.org
  Target Milestone: ---
            Target: *-apple-darwin

This is not the first time building something fails because clang-specific flag
is passed unconditionally. Now it is gegl:

FAILED: libs/npd/libgegl-npd-0.4.dylib.p/graphics.c.o 
ccache /opt/local/bin/gcc-mp-14 -Ilibs/npd/libgegl-npd-0.4.dylib.p -Ilibs/npd
-I../gegl-0.4.50/libs/npd -Igegl -I../gegl-0.4.50/gegl -Igegl/buffer
-I../gegl-0.4.50/gegl/buffer -Igegl/graph -I../gegl-0.4.50/gegl/graph
-Igegl/module -I../gegl-0.4.50/gegl/module -Igegl/opencl
-I../gegl-0.4.50/gegl/opencl -Igegl/operation -I../gegl-0.4.50/gegl/operation
-Igegl/process -I../gegl-0.4.50/gegl/process -Igegl/property-types
-I../gegl-0.4.50/gegl/property-types -I/opt/local/include/glib-2.0
-I/opt/local/lib/glib-2.0/include -I/opt/local/include/babl-0.1
-I/opt/local/include -fdiagnostics-color=always -Wall -Winvalid-pch -std=gnu11
-O2 -g -DHAVE_CONFIG_H -DGEGL_ENABLE_DEBUG -Winit-self -Wmissing-declarations
-Wpointer-arith -Wno-unused-parameter -Wno-cast-function-type -ftree-vectorize
-Wmissing-prototypes -Wold-style-definition -ObjC -pipe -Os -arch ppc -MD -MQ
libs/npd/libgegl-npd-0.4.dylib.p/graphics.c.o -MF
libs/npd/libgegl-npd-0.4.dylib.p/graphics.c.o.d -o
libs/npd/libgegl-npd-0.4.dylib.p/graphics.c.o -c
../gegl-0.4.50/libs/npd/graphics.c
cc1: error: argument to '-O' should be a non-negative integer, 'g', 's', 'z' or
'fast'

While this is of course an upstream bug, there are quite a number of such
instances, and not every upstream will bother fixing their build system for
what they may consider a minority case (using GCC on macOS).
AFAICT, this flag is redundant with GCC, and just dropping it works fine.
Perhaps if it cannot be supported in a meaningful way, at least ignore it
instead of failing?

Reply via email to