delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/09/16/19:15:57

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <022101bf0099$458f2ab0$656aadcf@qsicorp.com>
Reply-To: "Michael K. Elwood" <mkelwood AT qsicorp DOT com>
From: "Michael K. Elwood" <mkelwood AT qsicorp DOT com>
To: "cygwin cygwin" <cygwin AT sourceware DOT cygnus DOT com>,
<crossgcc AT sourceware DOT cygnus DOT com>
Subject: Building mingw32-x-h8300 tools
Date: Thu, 16 Sep 1999 17:14:48 -0600
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300

Well, since nobody wanted to solve my problem for me, I had to go solve it
myself. But the problem (and solution) may be interesting to people trying
to build mingw32-hosted cross tools, or to mingw32 people in general.

To recap, after Mumit pointed out that collect2 should never get built when
compiling mingw32-hosted tools, I justed edited the makefile in the gcc
directory to empty the USE_COLLECT2 variable. The tools then built without
complaint. I installed the compiler on my WinNT partition and fired it up
with some simple code (known be build properly). CPP.EXE kept puking with
the message "Too many arguments".

If all else fails...try GDB, right?

It turns out that the specs file for the h8300 target (which, as of GCC
2.95, apparently lives outside the compiler in the
lib/gcc-lib/h8300-hms/2.95/ directory) contains some cpp arguments like

-D__SIZE_TYPE__=unsigned\ int

cpp hates that space in the value, so you really need double quotes around
the "unsigned\ int" part. So I fixed the specs file by surrounding these
values with double quotes. Everything seemed great...only it didn't fix the
problem. Back to GDB.

When gcc goes to spawn cpp, it calls pexecute() in libiberty, which in turn
calls the Win32 _spawnv or _spawnvp function. Just before it does this, the
mingw32 pexecute() calls fix_argv(), which scans every string in the argv
array and escapes any double quotes with a preceding \. Instead of helping,
though, this just confused cpp. So i took out the call to fix_argv().
Presto! Everything worked. :)

I now have a working mingw32-hosted h8300-targeted GNU cross compiler
(version 2.95). Many thanks to Mumit Khan and others who have helped along
the way. I can provide a patch for the changed files if anybody is
interested.

Now a question: Is fix_argv() still necessary? It seems to be causing more
harm than good.

Best regards,

MKE


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019