Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ckalas opened this issue Oct 20, 2015 · 11 comments
Open

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

ckalas opened this issue Oct 20, 2015 · 11 comments

Comments

@ckalas
Copy link

ckalas commented Oct 20, 2015

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
@sampsyo
Copy link
Owner

sampsyo commented Oct 20, 2015

See `config.log' for more details.

Perhaps those details would help.

@ckalas
Copy link
Author

ckalas commented Oct 21, 2015

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.

@sampsyo
Copy link
Owner

sampsyo commented Oct 21, 2015

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

@ckalas
Copy link
Author

ckalas commented Oct 21, 2015

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
Copy link
Author

ckalas commented Oct 21, 2015

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/'

@sampsyo
Copy link
Owner

sampsyo commented Oct 22, 2015

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

@ckalas
Copy link
Author

ckalas commented Oct 22, 2015

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

@sampsyo
Copy link
Owner

sampsyo commented Oct 23, 2015

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.

@tsparber
Copy link
Collaborator

tsparber commented Aug 1, 2016

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.

@AndrewMohawk
Copy link

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.

@enchantessss
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants