Mail Archives: djgpp/2013/12/15/09:50:07
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 -