1 post tagged “gcc-4.0: -e -s -save-temps and -m options are not allowed with multiple -arch flags”
This morning while setting up a cross compilation environment for my new netbook I was greeted with this lovely error message:
# port install distcc
...
gcc-4.0: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
error: command 'gcc' failed with exit status 1
make: *** [include-server] Error 1
Error: Status 1 encountered during processing.
After some short searching I found this conversation on the distcc mailing list
...
This is a tricky one to solve. I think the right fix is to make gcc support
-M options even when multiple -arch flags are specified.
(gcc would need to produce several .d files and then merge them into a
single one.)
> I simply removed -MD from the CFLAGS in the Makefile.
Yes, that's what I did too. That seems like a fine work-around in the mean
time.
I would be happy to accept a patch to make distcc do this automatically (or
even just a patch to the INSTALL file to describe the work-around).
...
So it seems as if this bug is with GCC and not with The MacPorts Project nor distcc. At this point, I believe the best intermediate solution is to simply patch the Makefile as mentioned on the mailing list.
Here's a shell script I wrote that integrates patching along with installation while retaining manageability through macports:
#!/bin/sh
makefile=/opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/distcc/work/distcc-3.1/Makefile
if test -e $makefile; then # user has a half completed installation
break
else # user has not previously attempted installation
port configure distcc
fi
# if the makefile still does not exist there's a problem
if ! test -e $makefile; then echo "The makefile does not exist. Are you sure distcc isn't already installed?" && exit 1; fi
# patch makefile and install
echo "\e[1m---> Patching Makefile\e[0m"
sed -i.bak -e 's/\-MD\ \-W/\-W/g' $makefile && port install distcc