gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Partial success building the trunk on MSYS2/Windows platform


From: Gaius Mulley
Subject: Re: Partial success building the trunk on MSYS2/Windows platform
Date: Sun, 23 Oct 2022 13:48:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Runar Tenfjord <rtenf74@gmail.com> writes:

> Greetings,
>
> I like to report a partial success building the trunk on  MSYS2/MINGW
> Windows 10 64Bit  platform.

Hello,

this is great news - well done!

> The mc compiler works fine.
> Probably due to the failed linking the 'gmc' binary does not work.
>
> There where some changes I had to do in order to get to this stage.
> The nature of these could perhaps be implemented as these could improve
> the porting to other target also.
>
>  1. Cast of pointer loosing precession error.
>     Message : error cast from 'void*' to 'long unsigned int' loses precision
>     File1 : m2/mc-boot/GDynamicStrings.c:908:18
>     Line1 : 908 |   writeLongcard ((long unsigned int ) (a));
>     File2 : mc-boot/Gdecl.c:8213:28:
>     File3 : m2/mc-boot/Gdecl.c:19726:24:
>
>     I believe ' long unsigned int  ' is 32 bit.
>     Propose to use 'uintptr_t'?

ok will fix this.

> 2.  BSD function 'index'
>     Message : error: 'index' was not declared in this scope
>     File1 : m2/mc-boot-ch/Glibc.c:93:11:
>     Line1 :   93 |       c = index (&_format[i], '\\');
>
>     Propose to change this to the 'strchr' function.
>     Believe index is not part of posix and comes from BSD.
>     This function is not found in MSYS2/MINGW
>     Found at many places in the code base.

yes will fix this

> 3.  Use of obsolete function 'creat'
>     File1 : m2/tools-src/mklink.c
>     Change
>         OutputFile = creat (NameOfFile, 0666);
>     To :
>         OutputFile = open (NameOfFile, O_WRONLY | O_CREAT | O_TRUNC, 0666);
>
>     Also in mc-boot & pge-boot the libc_creat procedure is used in several 
> locations.
>
>     Ref : 
> https://www.gnu.org/software/libc/manual/html_node/Opening-and-Closing-Files.html
>
>     This compiles OK, but somehow this function is not properly
>     implemented in  MSYS2/MINGW .
>      I changes this to use the replacement above and then mc works
>     properly.

thanks will change this

>
> 4.  Reference to 'termios' commented out in several locations
>     due to missing functinallity on the MSYS platform.
>     This should probably be handled on the Makefile level.

will look into this

> 5.  Reference to 'signal.h' commented out in several locations
>     due to missing functinallity on the MSYS platform.
>     This should probably be handled on the Makefile level.

and signal as well

> 6.  Failure to link plugin
>     Error : 
> /m2rte.o:m2rte.cc:(.rdata$.refptr._ZTV8opt_pass[.refptr._ZTV8opt_pass]+0x0): 
> undefined refere nce to `vtable for opt_pass'
>     
>     No solution currently found.
>     Skipped with make -k to continue

I've not seen that error before and will look at the plugin build rules
(double check against other language plugins).

> Testing gm2 yields:
>
>     ./gm2.exe -g hello.mod
>     cc1gm2.exe: error: plugin support is disabled; configure with
>     '--enable-plugin'

you can disable the plugin from on gm2 command line for testing:

  gm2 -fno-m2-plugin hello.mod

> It is very close to working correctly and with some further
> investigation is should be solved.

yes indeed and thanks for the report - it will be great to have it
working on a different platform.

> Is see there is adaptation for MINGW/MSYS platform in several places
> in the GCC code base: Line 2028 in 'gcc\ada\Makefile.rtl'. Probably
> this could be reused.

thanks for the pointer I'll check it out
>
> Hope this information can be useful.

very helpful!

regards,
Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]