Web lists-archives.com

Re: [Mingw-users] Internal compiler error with custom specs file

On Thursday, May 25, 2017 7:43 AM, Keith Marshall wrote:

> I can't see anything obvious, but your hello.c compiles and links fine,
> for me, both with and without -specs=msvcr80, and with both my GCC-5.3.0
> mingw32-gcc cross-compiler, and the GCC-6.3.0 variant, with which I am
> currently experimenting.  Clutching at straws: check that your blank
> lines are REALLY blank ... no stray white space, and no rogue CR from
> CRLF line endings, (which I believe should be LF, as $DEITY mandates).
> Did you try adding -v to the GCC command line, to verify that your specs
> file modifications are being interpreted correctly?

$ gcc -v -specs=msvcr80 -o hello 2>&1  /tmp/hello.c |  grep specs
Reading specs from c:/mingw/bin/../lib/gcc/mingw32/5.3.0/specs
Reading specs from c:/mingw/bin/../lib/gcc/mingw32/5.3.0/msvcr80

The problem was a space (0x20)  at byte offsets 0x11 and 0x57.

Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000  2A 6D 73 76 63 72 74 3A 0A 6D 73 76 63 72 38 30  *msvcrt:.msvcr80
00000010  0A 20 0A 2A 6D 73 76 63 72 74 5F 76 65 72 73 69  . .*msvcrt_versi
00000020  6F 6E 3A 0A 2D 44 5F 5F 4D 53 56 43 52 54 5F 56  on:.-D__MSVCRT_V
00000030  45 52 53 49 4F 4E 5F 5F 3D 30 78 30 38 30 30 0A  ERSION__=0x0800.
00000040  0A 2A 6D 6F 6C 64 6E 61 6D 65 3A 0A 6D 6F 6C 64  .*moldname:.mold
00000050  6E 61 6D 65 38 30 0A 20 0A                       name80. .

Unfortunately these spaces (before a LF character) are not visible in
vim. Consider a file <LF><SPACE><LF>. Vim will tell you that it has 2 lines and
3 characters when you open it. If you move the cursor to the start of the 2nd
line (where the space is), vim will not let you move the cursor to the right,
leading you (or maybe just me) to believe that nothing is there. The space *is*
there, above the cursor. WordPad, Notepad++, emacs and no doubt most other
editors let you move to the right in that situation.

Using a custom specs file may be overkill for one function, but once I have set
it up, it is easier than modifying the source (which I didn't write), especially
if I need more than one function that is not in MSVCRT.DLL. By the way, my
Windows 10 Version 1607 MSVCRT.DLL (7.0.14393.0) also does not have


John Brown.

Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
MinGW-users mailing list

This list observes the Etiquette found at 
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

You may change your MinGW Account Options or unsubscribe at:
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe