homebrew-mspgcc icon indicating copy to clipboard operation
homebrew-mspgcc copied to clipboard

msp430-gcc "/lib/cpp" fails sanity check

Open ckalas opened this issue 9 years ago • 11 comments

Below is the error I get on OSX 10.11 when installing msp430-gcc.

checking whether we are using the GNU C compiler... yes
checking whether /private/tmp/msp430-gcc20151020-38772-h11hf8/gcc-4.7.0/build/./gcc/xgcc -B/private/tmp/msp430-gcc20151020-38772-h11hf8/gcc-4.7.0/build/./gcc/ -B/usr/local/Cellar/msp430-gcc/4.7.0/msp430/bin/ -B/usr/local/Cellar/msp430-gcc/4.7.0/msp430/lib/ -isystem /usr/local/Cellar/msp430-gcc/4.7.0/msp430/include -isystem /usr/local/Cellar/msp430-gcc/4.7.0/msp430/sys-include    accepts -g... yes
checking for /private/tmp/msp430-gcc20151020-38772-h11hf8/gcc-4.7.0/build/./gcc/xgcc -B/private/tmp/msp430-gcc20151020-38772-h11hf8/gcc-4.7.0/build/./gcc/ -B/usr/local/Cellar/msp430-gcc/4.7.0/msp430/bin/ -B/usr/local/Cellar/msp430-gcc/4.7.0/msp430/lib/ -isystem /usr/local/Cellar/msp430-gcc/4.7.0/msp430/include -isystem /usr/local/Cellar/msp430-gcc/4.7.0/msp430/sys-include    option to accept ISO C89... unsupported
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/private/tmp/msp430-gcc20151020-38772-h11hf8/gcc-4.7.0/build/msp430/libgcc':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make: *** [all] Error 2

ckalas avatar Oct 20 '15 19:10 ckalas

See `config.log' for more details.

Perhaps those details would help.

sampsyo avatar Oct 20 '15 20:10 sampsyo

I can't find a log file ~/Library/Logs/Homebrew/msp430-gcc$ ls 01.configure 02.make

Nothing new in those files that isn't put out to terminal.

ckalas avatar Oct 21 '15 16:10 ckalas

OK; please do keep the issue updated if your investigation reveals anything that could help.

sampsyo avatar Oct 21 '15 16:10 sampsyo

I think maybe this is related to it not being able to find cc1 or cc1plus, which I can't find on my system but when compiling a test with -v, I can see its done with clang -cc1.

ckalas avatar Oct 21 '15 16:10 ckalas

any particular details that would help in config.log? i found it with debug mode turned for brew.

i found that CPP is set to /lib/cpp which isn't a thing, but changing that environment variable doesn't seem to change all the instances of it. After setting CPP="gcc -E" like suggested in some other posts, /lib/cpp/ is still used by some part of the make.

./msp430/libgcc/config.log:ac_cv_prog_CPP=/lib/cpp ./msp430/libgcc/config.log:CPP='/lib/cpp/'

ckalas avatar Oct 21 '15 18:10 ckalas

That's quite strange. Perhaps the configure script needs some special arguments to point it toward the right C compiler?

sampsyo avatar Oct 22 '15 00:10 sampsyo

created a symlink out of curiosity from /usr/bin/cpp to /lib/cpp (which /lib of course doesn't actually exist on OS X), and I get some other error related to a darwin definition.

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_types/_size_t.h:30:1: error: unknown type name '__darwin_size_t'
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stddef.h:79:0,
                 from ../../../../libgcc/../gcc/tsystem.h:45,
                 from ../../../../libgcc/libgcc2.c:29:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_types/_wchar_t.h:33:1: error: unknown type name '__darwin_wchar_t'
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stddef.h:82:0,
                 from ../../../../libgcc/../gcc/tsystem.h:45,
                 from ../../../../libgcc/libgcc2.c:29:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_types/_wint_t.h:31:1: error: unknown type name '__darwin_wint_t'
make[4]: *** [_addvsi3.o] Error 1
make[4]: *** [_addvdi3.o] Error 1
make[3]: *** [multi-do] Error 1
make[2]: *** [all-multi] Error 2
make[1]: *** [all-target-libgcc] Error 2
make: *** [all] Error 2

ckalas avatar Oct 22 '15 19:10 ckalas

Well, that's getting quite convoluted. My best guess is that you have (real) GCC installed, and the compilation is using that instead of OS X's Clang. Could that be the case? If so, maybe it's trying to use Apple's headers anyway and isn't compatible.

sampsyo avatar Oct 23 '15 02:10 sampsyo

I had a similar issue (months ago) on another machine, if I recall correctly using ENV.delete('CFLAGS') in msp430-gcc.rb#L26 solved the issue for me.

tsparber avatar Aug 01 '16 11:08 tsparber

I managed to get around these errors by using the other brew repo: tgtakaoka/homebrew-mspgcc [ https://github.com/tgtakaoka/homebrew-mspgcc ] (in case anyone still gets here), on mojave.

AndrewMohawk avatar Jan 13 '19 20:01 AndrewMohawk

Do you find a solution for this ? since I have the same issue on Mac M1.

enchantessss avatar May 08 '22 10:05 enchantessss