Inferno Os not build with the last Microsoft compilers

Issue #339 resolved
Former user created an issue

Inferno OS not build with Visual Studio 2013 Express and Visual Studio 2015 Express Errors: 1) Vs2013 ...... cl -DINCPATH="D:/work/repos/inferno-os/module" -c -nologo -W3 -Zi -MT -ID:/work/repos/inferno-os/Nt/386/include -ID:/work/repos/inferno-os/include y.tab.c y.tab.c limbo.y(1931) : warning C4013: 'tolower' undefined; assuming extern returning int link -nologo -incremental:no -map -out:obj.out asm.obj com.obj decls.obj dis.obj dtocanon.obj ecom.obj gen.obj lex.obj nodes.obj optab.obj optim.obj sbl.obj stubs.obj typecheck.obj types.obj y.tab.obj D:/work/repos/inferno-os/Nt/386/lib/libbio.a D:/work/repos/inferno-os/Nt/386/lib/libmath.a D:/work/repos/inferno-os/Nt/386/lib/libsec.a D:/work/repos/inferno-os/Nt/386/lib/libmp.a D:/work/repos/inferno-os/Nt/386/lib/lib9.a binmode.obj LIBCMT.lib(strtod.obj) : error LNK2005: _strtod already defined in libmath.a(dtoa.obj) obj.out : fatal error LNK1169: one or more multiply defined symbols found mk: link -nologo -incremental:no ... : exit status=exit(1) mk: for (j in ... : exit status=exit(1)

2) Vs2015 ......... cl -DINCPATH="D:/work/repos/inferno-os/module" -c -nologo -W3 -Zi -MT -D_WIN32_WINNT=0x0400 -ID:/work/repos/inferno-os/Nt/386/include -ID:/work/repos/inferno-os/include ecom.c ecom.c ecom.c(2065): error C2143: syntax error: missing ')' before 'constant' ecom.c(2065): error C2143: syntax error: missing '{' before 'constant' ecom.c(2065): error C2059: syntax error: константа ecom.c(2065): error C2059: syntax error: ) ecom.c(2149): error C2143: syntax error: missing ')' before 'constant' ecom.c(2149): error C2143: syntax error: missing '{' before 'constant' ecom.c(2149): error C2059: syntax error: constant ecom.c(2149): error C2059: syntax error: ) ecom.c(2159): error C2143: syntax error: missing ')' before 'constant' ecom.c(2159): error C2143: syntax error: missing '{' before 'constant' ecom.c(2159): error C2059: syntax error: constant ecom.c(2159): error C2059: syntax error: ) mk: cl -DINCPATH="D:/work/repos/inferno-os/module" -c ... : exit status=exit(1) mk: for (j in ... : exit status=exit(1)

Comments (14)

  1. Charles Forsyth

    Apparently they've added bool (and true, false) unconditionally, or one of their include files includes the _Bool definition.

  2. Charles Forsyth

    I've updated the source to try to avoid both problems. I've tested it under the 2010 and 2014 versions, but not yet the 2015 ones (which I haven't got yet). You might try it anyway to see if it works.

  3. Александр Юричук

    Thank you for the fast reply. :) I have checked your source changes on VS2013 and VS2015. Result - not compile on both cases. Here is the error log.

    1) VS2013

    cl -DROOT="D:/work/repos/inferno-os" -DEMU -I. -I../port -ID:/work/repos/inferno-os/Nt/386/include -ID:/work/repos/inferno-os/include -ID:/work/repos/inferno-os/libinterp -c -nologo -W3 -Zi -MT -D_WIN32_WINNT=0x0400 -ID:/work/repos/inferno- emu.c386/include -ID:/work/repos/inferno-os/include '-DKERNDATE='1437739774 link -subsystem:console -entry:WinMainCRTStartup -nologo -incremental:no -map -out:iemu.exe os.obj emu.root.obj lock.obj fp.obj r16.obj vlrt.obj devfs.obj srv.obj devaudio.obj devpipe.obj win.obj devsnarf.obj ipif.obj devprof.obj devcons.obj cmd.obj devdraw.obj devssl.obj devcap.obj devdup.obj devsrv.obj devenv.obj deveia.obj devpointer.obj devprog.obj devroot.obj devmem.obj audio.obj devcmd.obj ipaux.obj devmnt.obj devarch.obj devindir.obj devip.obj random.obj exception.obj errstr.obj env.obj dis.obj alloc.obj sysfile.obj dev.obj dial.obj devtab.obj print.obj proc.obj parse.obj exportfs.obj cache.obj error.obj inferno.obj qio.obj uqid.obj discall.obj main.obj chan.obj latin1.obj pgrp.obj emu.obj D:/work/repos/inferno-os/Nt/386/lib/libinterp.a D:/work/repos/inferno-os/Nt/386/lib/libtk.a D:/work/repos/inferno-os/Nt/386/lib/libfreetype.a D:/work/repos/inferno-os/Nt/386/lib/libmath.a D:/work/repos/inferno-os/Nt/386/lib/libdraw.a D:/work/repos/inferno-os/Nt/386/lib/libmemlayer.a D:/work/repos/inferno-os/Nt/386/lib/libmemdraw.a D:/work/repos/inferno-os/Nt/386/lib/libkeyring.a D:/work/repos/inferno-os/Nt/386/lib/libsec.a D:/work/repos/inferno-os/Nt/386/lib/libmp.a D:/work/repos/inferno-os/Nt/386/lib/lib9.a binmode.obj netapi32.lib wsock32.lib user32.lib gdi32.lib advapi32.lib winmm.lib mpr.lib emu.c LIBCMT.lib(strtoq.obj) : error LNK2005: _strtoll already defined in lib9.a(strtoll.obj) iemu.exe : fatal error LNK1169: one or more multiply defined symbols found mk: cl -DROOT="D:/work/repos/inferno-os" -DEMU ... : exit status=exit(1) mk: echo '@{builtin cd' ... : exit status=exit(1) mk: for (j in ... : exit status=exit(1)

    2) VS2015

    cl -c -nologo -W3 -Zi -MT -D_WIN32_WINNT=0x0400 -ID:/work/repos/inferno-os/Nt/386/include -ID:/work/repos/inferno-os/include draw.c draw.c d:\work\repos\inferno-os\libinterp\runt.h(239): error C2032: __p__environ: function cannot be member of struct 'Prefab_Element' d:\work\repos\inferno-os\libinterp\runt.h(252): error C2032: __p__environ: function cannot be member of struct struct 'Prefab_Compound' mk: cl -c -nologo ... : exit status=exit(1) mk: for (j in ... : exit status=exit(1)

  4. Charles Forsyth

    The first one is "more of the same", and I've added strtoll to the list of functions renamed in lib9.h (the idea is to use the lib9 one because it works exactly the same on all platforms, and wasn't previously provided by MS).

    The second is more of a mystery. It looks as though they might #define environ to be something else, but that seems unorthodox, so I'm not sure. That line in runt.h is supposed to be something like

    Prefab_Environ* environ;
    
  5. Charles Forsyth

    Oh, it's probably their implementation of extern char **environ. People make such a mess of C implementations now. Too many #defines in the "standard" include files. I don't need that one, so I'll try undef'ing it. I suspect it might now cause trouble in mk/Nt.c, but we'll see.

  6. Александр Юричук

    I've compiled source once more time but there are errors:

    1) VS2015 iyacc -d dbg.y

    conflicts: 2 shift/reduce cl -c -nologo -W3 -Zi -MT -D_WIN32_WINNT=0x0400 -ID:/work/repos/inferno-os/Nt/386/include -ID:/work/repos/inferno-os/include -I../include -I../include main.c main.c d:\work\repos\inferno-os\utils\acid\acid.h(181): error C2632: 'int' followed by 'bool' is illegal d:\work\repos\inferno-os\utils\acid\acid.h(181): error C2059: syntax error: <parameter-list> mk: cl -c -nologo ... : exit status=exit(1) mk: for (j in ... : exit status=exit(1) mk: for (j in ... : exit status=exit(1)

    2) VS2013

    cl -c -nologo -W3 -Zi -MT -D_WIN32_WINNT=0x0400 -ID:/work/repos/inferno-os/Nt/386/include -ID:/work/repos/inferno-os/include -I. ntsrv.c ntsrv.c ntsrv.c(69) : error C2365: 'logf' : redefinition; previous definition was 'function' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(745) : see declaration of 'logf' ntsrv.c(189) : error C2106: '=' : left operand must be l-value ntsrv.c(256) : warning C4550: expression evaluates to a function which is missing an argument list mk: cl -c -nologo ... : exit status=exit(1) mk: for (j in ... : exit status=exit(1) mk: for (j in ... : exit status=exit(1)

  7. Charles Forsyth

    Sorry. It's like pulling teeth. Another update ... while I pull across the latest free version. I've tended to use slightly older ones on the grounds that people won't always have the latest.

  8. Александр Юричук

    Don’t mention it. The migration to another version of compiler is sometimes realy pain in the ass. ;) Besides, there is another rount to fight in compilation!

    1) VS2013

    link -nologo -incremental:no -map -out:obj.out main.obj y.tab.obj lex.obj util.obj exec.obj expr.obj list.obj builtin.obj proc.obj dot.obj print.obj os-Nt.obj rdebug.obj D:/src/inferno-os/Nt/386/lib/libmach.a D:/src/inferno-os/Nt/386/lib/libmath.a D:/src/inferno-os/Nt/386/lib/libbio.a D:/src/inferno-os/Nt/386/lib/libregexp.a D:/src/inferno-os/Nt/386/lib/lib9.a binmode.obj expr.obj : error LNK2019: An undefined external symbol (_bool) was found in function _chklval obj.out : fatal error lnk1120 1 unresolved externals mk: link -nologo -incremental:no ... : exit status=exit(1) mk: for (j in ... : exit status=exit(1) mk: for (j in ... : exit status=exit(1)

    2) VS2015

    cl -c -nologo -W3 -Zi -MT -D_WIN32_WINNT=0x0400 -ID:/src/inferno-os/Nt/386/include -ID:/src/inferno-os/include -I../include -I../include expr.c expr.c expr.c(843): error C2059: syntax error: 'type' expr.c(846): error C2059: syntax error: 'type' expr.c(860): error C2059: syntax error: 'type' expr.c(873): error C2059: syntax error: 'type' expr.c(877): error C2059: syntax error: '&' expr.c(877): error C2065: 'n': undeclared identifier expr.c(877): error C2223: left of '->right' must point to struct/union expr.c(877): error C2056: illegal expression expr.c(877): error C2466: cannot allocate an array of constant size 0 expr.c(877): error C2143: syntax error: missing ')' before '->' expr.c(877): error C2143: syntax error: missing '{' before '->' expr.c(877): error C2059: syntax error: '->' expr.c(877): error C2059: syntax error: ')' expr.c(878): error C2059: syntax error: 'if' expr.c(882): error C2059: syntax error: '}' expr.c(1005): error C2065: 'oeinc': undeclared identifier expr.c(1006): error C2065: 'oeinc': undeclared identifier expr.c(1032): error C2099: initializer is not a constant mk: cl -c -nologo ... : exit status=exit(1) mk: for (j in ... : exit status=exit(1) mk: for (j in ... : exit status=exit(1)

  9. Charles Forsyth

    It turns out that my test compilations with the old compiler weren't actually testing anything, because hg update hadn't actually updated anything recently, because of a clash, which explains a bit. I thought I'd fixed the clash, because a later hg update was fine, but it was lying to me.

  10. Charles Forsyth

    I've got the 2015 compiler now. What they do is ill-advised. Nothing in the C standard or POSIX allows environ to be #define'd so as to prevent its use as a local variable or structure member. It's for backwards compatibility (or in this case, incompatibility). I can see what to do, but I won't be able to do it until tomorrow.

  11. Александр Юричук

    With the last changes compilation in VS2013 is completely working. VS2015 still have problems with "_environ". I think you know about it. ;)

  12. Charles Forsyth

    I finally sorted out the environ problem, which required embarrassing little to avoid it, and also a bug in MS system() that affected awk, preventing mkroot from running (it gave a strange "Access Denied" message because of a 32/64 problem).

  13. Charles Forsyth

    I think it now compiles (and also runs!) with newer VS tools and I've tested it on two Windows 10 systems (Home & Server).

  14. Log in to comment