[M3devel] NT386GNU status

Tony Hosking hosking at cs.purdue.edu
Tue Jan 15 14:54:50 CET 2008


On Jan 15, 2008, at 8:34 AM, Jay wrote:

> I can build a lot of std, at least up to m3ui.
>
> However..nothing works.
>
> Everything crashes.
>
> In order to build std, I copied back the NT386 cm3 and mklib,
>  though the config sets TARGET=NT386GNU and runs cm3cg.
>  (i.e. I'm not just using the NT386 backend!)
>
> The crash is what I mentioned the other day:
>
> D:\>\cygwin\bin\gdb \dev2\cm3.2\m3-sys\cm3\NT386GNU\cm3.exe
> GNU gdb 6.5.50.20060706-cvs (cygwin-special)
> Copyright (C) 2006 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License,  
> and you are
> welcome to change it and/or distribute copies of it under certain  
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for  
> details.
> This GDB was configured as "i686-pc-cygwin"...
> (gdb) run
> Starting program: D:/dev2/cm3.2/m3-sys/cm3/NT386GNU/cm3.exe
> Loaded symbols for /cygdrive/d/WINDOWS/system32/ntdll.dll
> Loaded symbols for /cygdrive/d/WINDOWS/system32/kernel32.dll
> Loaded symbols for /cygdrive/d/WINDOWS/system32/advapi32.dll
> Loaded symbols for /cygdrive/d/WINDOWS/system32/rpcrt4.dll
> Loaded symbols for /cygdrive/d/WINDOWS/system32/gdi32.dll
> Loaded symbols for /cygdrive/d/WINDOWS/system32/user32.dll
> Loaded symbols for /cygdrive/d/WINDOWS/system32/msvcrt.dll
> Loaded symbols for /cygdrive/d/WINDOWS/system32/wsock32.dll
> Loaded symbols for /cygdrive/d/WINDOWS/system32/ws2_32.dll
> Loaded symbols for /cygdrive/d/WINDOWS/system32/ws2help.dll
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000000 in ?? ()
> (gdb) bt
> #0  0x00000000 in ?? ()
> #1  0x005de831 in RTLinker__FindModules (M3_DjPxE3_m=0x682340)
>     at RTLinker.m3:182
> #2  0x005de5fb in RTLinker__AddUnitI (M3_DjPxE3_m=0x682340) at  
> RTLinker.m3:111
> #3  0x005de6b0 in RTLinker__AddUnit (M3_DjPxE5_b=0x603fd0) at  
> RTLinker.m3:122
> #4  0x005de34d in RTLinker__InitRuntime (M3_AcxOUs_p_argc=0,
>     M3_AJWxb1_p_argv=0x3f2bf0, M3_AJWxb1_p_envp=0x3f24c0,
>     M3_AJWxb1_p_instance=0x1) at RTLinker.m3:42
> #5  0x00401315 in main (argc=1, argv=0x3f24c0, envp=0x3f2bf0) at  
> _m3main.mc:3
> (gdb) q
> The program is running.  Exit anyway? (y or n) y
> D:\>

Looks like a problem with the run-time linker.  Something must be  
broken in the compiler-generated link info.  Not sure why...

> Oh, m3ui and related are broken due to:
>
> D:\dev2\cm3.2\m3-tools\m3bundle\NT386GNU\m3bundle -name  
> formseditBundle -FD:\DOC
> UME~1\Jay\LOCALS~1\Temp\qk
> new source -> compiling FormsEditVBT.i3
> new source -> compiling formseditBundle.i3
> new source -> compiling FormsEditVBT.m3
> new source -> compiling FormsEdit.m3
> new source -> compiling formseditBundle.m3
>  -> linking formsedit.exe
> D:\dev2\cm3.2/m3-ui\ui\NT386GNU\m3ui.lib.sa(WinTrestle.mo): In  
> function `WinTres
> tle__ButtonEvent':
> WinTrestle.m3:1843: undefined reference to `WindowFromPoint at 4'
> collect2: ld returned 1 exit status
> "D:\\dev2\\cm3.2\m3-sys\cminstall\src\config\NT386GNU", line 583:  
> quake runtime
> error: link failed, see D:\dev2\cm3.2\m3-ui\formsedit\NT386GNU 
> \formsedit.lst for
>  more information
>
> \mingw\bin\nm \MinGW\lib\libuser32.a | findstr WindowFromPoint
> 00000000 T _WindowFromPoint at 8
> 00000000 I __imp__WindowFromPoint at 8
>
> Maybe Tony will fix my __stdcall work. :)

Yes, I know what needs doing to m3cc(cm3cg).  Just need to do it.

> Or maybe the problem is the declaration.
> Or maybe I can confirm it is passing a small struct by pointer  
> instead of by reference
> and just write a little translation thunk. But also see why NT386  
> works.
> Not a big deal. Trestle can wait.
>
> If anyone wants to try this stuff out, debug, I can either share  
> diffs or commit them.
> They are actually pretty small.
> I just have to look into the definitions of the runtime linker/ 
> binder stuff and/or
> the assembly, see if there's some disconnect somewhere.
>
> Other gdb above, this is all with mingwin + msys.
> They are enough to build cm3cg.
> mingwin should suffice for the rest.
>
> The ld that comes with the mingwin that free Qt gives you is too  
> old, from around 2004.
> It doesn't support "response files", which are needed for building  
> some packages due to command line length.
> The change was made circa 2005. Current "released" Mingwin works (I  
> didn't use "technology preview")
>
> Probably I'll take a break for now.
>
>  - Jay
>
> Share life as it happens with the new Windows Live. Start sharing!




More information about the M3devel mailing list