Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-16-2017, 09:26 AM   #1
LQ Newbie
Registered: Dec 2017
Posts: 1

Rep: Reputation: Disabled
Error while building mingw-w64 from source for Windows: preprocessor /lib/cpp fails sanity check

I've already built the cross compiler from the mingw-w64 source and the newest gcc and binutils tarballs. It seems to be working fine because there are some i686-w64-mingw32-prefixed executables in my path, and simple hello world that i've compiled on my linux machine using them ran well on my winxp virtual machine. Now I need to use it all to build mingw-w64 again but for windows.

I was using this file found in mingw-w64-doc directory as a base tutorial:
Here's the approximate list of commands that i've used:
export WD=$HOME/mingw-build
export TGT=i686-w64-mingw32

cd ~/binutils/tmp
../configure --prefix=$WD --with-sysroot=$WD --host=$TGT --disable-multilib --disable-nls
make && make install

cd ~/mingw/mingw-w64-headers/tmp
../configure --prefix=$WD/$TGT --host=$TGT
make install

ln -s $WD/{$TGT,mingw}

(copy gmp, mpc and mpfr into ~/gcc here)

cd ~/gcc/tmp
../configure --prefix=$WD --with-sysroot=$WD --host=$TGT --disable-multilib --disable-nls --enable-languages=c,c++
make all-gcc && make install-gcc

cd ~/mingw/mingw-w64-crt
../configure --prefix=$WD/$TGT --with-sysroot=$WD --host=$TGT
make && make install

cd ~/gcc/tmp
The problem appears on the last make command. Here are last lines of the output:

checking how to run the C preprocessor... /lib/cpp
configure: error: in `/home/alpha/work/tmp/gcc-7.2.0/bin/i686-w64-mingw32/libgcc':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
I guess it means that my toolchain is broken, but I can't figure out why. Is that something wrong with my ../configures? Or maybe i have to redefine my $PATH after some point? I dunno, that's my first experience building gcc. Halp pls

I'm using gcc 7.2.1 on archlinux.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
error: C++ preprocessor "/lib/cpp" fails sanity check marek345 Linux - Software 4 11-06-2008 10:49 AM
error: C++ preprocessor "/lib/cpp" fails sanity check watcher69b Linux - Software 1 07-03-2008 05:09 AM
error: C preprocessor "/lib/cpp" fails sanity check Virtuality Debian 13 01-12-2008 05:37 AM
error: C++ preprocessor "/lib/cpp" fails sanity check Linux - Software 3 03-06-2007 03:24 AM
error: C preprocessor "/lib/cpp" fails sanity check Master Fox Linux - Software 0 10-14-2004 04:39 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:22 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration