How to track down which makefile is setting a CC switch? [solved]

I'm adding a package for a DNSSD relay implementation I'm working on, and I got a decent way into it when suddenly I started getting a compile error:

arm-openwrt-linux-muslgnueabi-gcc -I../mDNSCore -I../mDNSShared -Iobjects/debug -fwrapv -W -Wall -DPID_FILE="/var/run/" -DMDNS_UDS_SERVERPATH="/var/run/mdnsd" -D_GNU_SOURCE -DHAVE_IPV6 -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -fno-strict-aliasing -Wall -Werror -Wno-error=no-array-bounds -Wno-error=implicit-fallthrough -Os -pipe -mcpu=cortex-a15 -mfpu=neon-vfpv4 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -iremap/home/mellon/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/dnssd-relay:dnssd-relay -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/mellon/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/home/mellon/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/include -I/home/mellon/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.3.0_musl_eabi/usr/include -I/home/mellon/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.3.0_musl_eabi/include/fortify -I/home/mellon/openwrt/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.3.0_musl_eabi/include -Wno-error -D__OPEN_SOURCE__ -c -o objects/debug/mDNSPosix.c.o mDNSPosix.c
cc1: error: -Werror=no-array-bounds: no option -Wno-array-bounds
Makefile:534: recipe for target 'objects/debug/mDNSPosix.c.o' failed

This seems like it ought to be a really easy thing to fix, but I have grepped everywhere and I can't find the file that's setting -Werror=no-array-bounds. It's not in my source tree. It doesn't appear to be in any of the Makefiles in includes/. Has anybody else ever run into this problem? What do you do when this happens to you? I feel like I must be missing something obvious, but the build system is so intricate that I can't even tell which makefile is invoking the makefile that's calling CC with the wrong options.

The issue here was that the switch had been in the source Makefile, and I was doing a custom Prepare step, which didn't notice that the origin had changed. So now I need to figure out how to make the Prepare step notice that the origin has changed, but that's a relatively minor issue that actually isn't very relevant since in the long run this will not be building out of my source tree anyway.