LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 12-16-2017, 08:26 AM   #1
gtkrwn
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: https://pastebin.com/9rtrrkmw
Here's the approximate list of commands that i've used:
Code:
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
make
The problem appears on the last make command. Here are last lines of the output:

Code:
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.
 
  


Reply



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 09:49 AM
error: C++ preprocessor "/lib/cpp" fails sanity check watcher69b Linux - Software 1 07-03-2008 04:09 AM
error: C preprocessor "/lib/cpp" fails sanity check Virtuality Debian 13 01-12-2008 04:37 AM
error: C++ preprocessor "/lib/cpp" fails sanity check i.you Linux - Software 3 03-06-2007 02:24 AM
error: C preprocessor "/lib/cpp" fails sanity check Master Fox Linux - Software 0 10-14-2004 03:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:38 AM.

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