delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2013/12/15/09:50:07

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Message-ID: <52ADC193.2080101@iki.fi>
Date: Sun, 15 Dec 2013 16:49:55 +0200
From: Andris Pavenis <andris DOT pavenis AT iki DOT fi>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Watt32 crashing on i386
References: <52a72357$0$3635$426a74cc AT news DOT free DOT fr> <8ab75766-10f6-4999-bd48-34e812c6c3bd AT googlegroups DOT com> <52ad7122$0$2914$426a34cc AT news DOT free DOT fr> <52ADA6C1 DOT 2050209 AT gmx DOT de>
In-Reply-To: <52ADA6C1.2050209@gmx.de>
Reply-To: djgpp AT delorie DOT com

On 12/15/2013 02:55 PM, Juan Manuel Guerrero wrote:
> Am 15.12.2013 10:06, schrieb Mateusz Viste:
>> Hi,
>>
>> Just to say thanks :) The latest "386libwatt" port you did recently works fine on a pre-pentium 
>> machine. I see it wasn't enough to just recompile it with -march=i386 as I did it, because 
>> watt32 itself seems to be buggy itself in regard of older (386/486) CPUs... Thanks!
>>
>> I am still not sure however about the need of compiling it under an older gcc.. What makes me 
>> wonder, is that I use the stock gcc as packaged with DJGPP 2.03 (gcc v4.7.1), I compile my 
>> program with it (just passing -march=i386), and still it works fine on old CPUs.. Is there any 
>> way I could verify myself the opcodes present in a binary file outputted by DJGPP (other than 
>> analyzing it for hours in a debugger of course)?
>>
>> cheers,
>> Mateusz
>>
>>
>>
> I do not know if it is really necessary to use a pre gcc4NN compiler
> to get clean 386 code.  I simply wanted to be sure that to code was
> OK, so I used the oldest compiler from the /beta directory (DJGPP 2.04).
> Feel free to recompile the sources using gcc 4.7.1 together with -march=i386
> and see what happens.  Anyway you are the only one that can check
> if your application works on i386/i486 hardware.  I no longer have
> access to this type of computer.
> I am not familiar enough with gcc to tell you if there is a way to
> certainly determinate if a gcc version is still able to generate clean
> 386 code.  Ask Andris or ask the on a gcc mailing list directly.

There are 2 different things:
- instructions which GCC emits when -march=i386 is specified. I guess that
   it should be OK (gcc should obey specified parameter)
- another thing is what inline assembler is used in libraries (including
   libstdc++). Instruction set of 80386 does not allow to implement atomic
   operations without locking. Therefore for most targets i486 instructions
   are being used. This would not mater for DJGPP, but the libstdc++
   modifications are however kept to the minimum. The same question
   (failure of libstdc++ for 80386) was discussed rather long time ago
   for Linux and all was left as it is (libstdc++ does not work for 80386
   any more). For DJGPP one could build GCC specifically for 30386 and
   it could perhaps work.

Andris



- Raw text -


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