Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot bootstrap with msvc anymore #1382

Closed
revelator opened this issue Jan 19, 2025 · 8 comments
Closed

cannot bootstrap with msvc anymore #1382

revelator opened this issue Jan 19, 2025 · 8 comments

Comments

@revelator
Copy link

not sure what happened here ??? compiler set to VISUALC but when trying to do a bootstrap it complains that it is missing wcc386.exe and fails. copying wcc386.exe into binbuild this happens ->

cc builder.obj
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(83): Error! E1009: Expecting ',' but found '('
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(83): Warning! W304: Return type 'int' assumed for function '__pragma'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(83): Error! E1026: Invalid declarator
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(83): Error! E1009: Expecting ',' but found ')'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(184): Error! E1026: Invalid declarator
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(184): Error! E1009: Expecting ',' but found 'typedef'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(184): Error! E1026: Invalid declarator
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(184): Error! E1009: Expecting ',' but found 'unsigned'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(184): Error! E1026: Invalid declarator
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(184): Error! E1009: Expecting ',' but found 'int'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(184): Error! E1024: Declared symbol 'size_t' is not in parameter list
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(185): Error! E1023: Storage class of parameter must be register or unspecified
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(185): Error! E1024: Declared symbol 'ptrdiff_t' is not in parameter list
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(186): Error! E1023: Storage class of parameter must be register or unspecified
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(186): Error! E1024: Declared symbol 'intptr_t' is not in parameter list
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(196): Error! E1023: Storage class of parameter must be register or unspecified
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(196): Error! E1024: Declared symbol '__vcrt_bool' is not in parameter list
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(215): Error! E1023: Storage class of parameter must be register or unspecified
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(215): Error! E1024: Declared symbol 'wchar_t' is not in parameter list
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(277): Error! E1024: Declared symbol '__security_init_cookie' is not in parameter list
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(280): Error! E1024: Declared symbol '__security_check_cookie' is not in parameter list
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(281): Error! E1147: Too many errors: compilation aborted
Error(E42): Last command making (builder.obj) returned a bad status
Error(E02): Make execution terminated

huh ???.

@jmalak
Copy link
Member

jmalak commented Jan 19, 2025

It looks like you have misconfigured OW build environment.
Check what bootstrap compiler you have setup by listing environment variables.
Check PATH, WATCOM, OWTOOLS.
It looks like as you have configured one toolchain but in OW setup is used different or you have incorrectly setup.

If you use Visual Studio as bootstrap toolchain then you need first run batch vcvarsall.bat or similar setup then run OW setup script and next run OW build.
Note Visual studio for 32-bit target is not supported.

@revelator
Copy link
Author

well not sure what to tell you but all those steps have been followed and its a nogo.

@echo off
REM *****************************************************************
REM SETVARS.BAT - Windows NT/DOS version
REM *****************************************************************
REM NOTE: Do not use this batch file directly, but copy it and
REM       modify it as necessary for your own use!!

REM Change OWROOT to point your Open Watcom source tree
REM Note: '=' sign in path is not allowed (build will fail).
REM
REM set OWROOT=c:\ow\ow
REM
REM If space character is used in the path then you must double quote
REM this path.
REM
REM set "OWROOT=c:\ow\o w"
REM

set OWROOT=D:\open-watcom-v2

REM Set OWTOOLS entry to identify your toolchain used by build process
REM supported values are WATCOM VISUALC INTEL

set OWTOOLS=VISUALC

REM Build control related variables
REM ###############################

REM Set OWDOCBUILD variable to 0 to suppress documentation build

set OWDOCBUILD=1

REM Set OWNOWGML variable to 1 to not use WGML utility
REM It doesn't requires appropriate DOS emulator
REM and suppress documentation build

REM set OWNOWGML=1

REM Set OWGUINOBUILD variable to 1 to suppress tools GUI version build
REM If it is used then only tools character mode version is build

REM set OWGUINOBUILD=1

REM Set OWNOBUILD variable to list of OW projects to suppress their build
REM Example set OWNOBUILD=ide browser dlgprs

REM set OWNOBUILD=

REM Set OWDISTRBUILD variable to 1 to enable build all OW installers

set OWDISTRBUILD=1

REM Documentation related variables
REM ###############################

REM Change this to the PATH required by GhostScript for PDF creation on used host OS (optional)
REM For Windows host we use Windows CI copy of appropriate tools
if not '%OS%' == 'Windows_NT' goto csetup1
set OWGHOSTSCRIPTPATH=%OWROOT%\ci\nt386
:csetup1

if not '%OS%' == 'Windows_NT' goto csetup3
if not '%PROCESSOR_ARCHITEW6432%' == 'AMD64' if not '%PROCESSOR_ARCHITECTURE%' == 'AMD64' goto csetup3
REM Build process requires WGML utility which is available only as DOS executable.
REM On Windows platforms which don't have NTVDM or if WGML doesn't work under NTVDM
REM then DOSBOX emulator must be installed and OWDOSBOX variable must be set.
REM It is necessary for all 64-bit Windows and Windows 7 32-bit
REM Uncoment and set OWDOSBOX variable bellow to point to DOSBOX emulator executable
REM path must not include spaces

REM For Windows host we use Windows CI copy of appropriate tools
set OWDOSBOX=%OWROOT%\ci\nt386\dosbox.exe
:csetup3

REM ###############################

REM Subdirectory to be used for building OW binaries
REM default is 'binbuild'
REM set OWOBJDIR=binbuild

REM DOS4GW 1.97 
set DOS4G=QUIET
REM DOS4GW 2.0x 
REM set DOS4G=STARTUPBANNER:1

REM Invoke the batch file for the common environment setup
call "%OWROOT%\cmnvars.bat"

REM Change the default command prompt
if not '%OS%' == 'Windows_NT' prompt $p$g

cd "%OWROOT%"

setvars.bat

yes the source is in D:\open-watcom-v2

the msvc 2017 compiler toolchain is 64 bit

im using windows 11 if the new command shell makes a difference to how the batch files are read.

my steps are start visual studio 64 bit compiler shell
then run setvars.bat followed by build.bat

@revelator
Copy link
Author

had to install visual studio 2015 before it worked seems like some recent change in the newer versions has broken bootstrap for open watcom v2

@jmalak
Copy link
Member

jmalak commented Jan 20, 2025

Did you check what is setup in environment before run OW build?
OWTOOLS
PATH
WATCOM
LIB
INCLUDE
What parameters you use for Visual Studio shell? What target you use?

@revelator
Copy link
Author

revelator commented Jan 20, 2025

running the batch files like this -> .\setvars.bat and .\build.bat rel fixed it for 2017 looks like msvc adopted some syntax from unix.
it works now except the batch files cannot be run twice as the second time throws some obscure file errror. -> Files was unexpected at this time.

@jmalak
Copy link
Member

jmalak commented Jan 20, 2025

It is strange because on my test box and on build server it works without problem.
you should have your own copy of setvars.bat with modified setup, don't use setvars.bat (it is template, can be overwritten by git)
Best method is to add "call command" to VS setup script to beginning of your OW setup script that it is initialized before OW build setup one times only

@revelator
Copy link
Author

yeah its kinda strange not sure what happened there but yeah i could just add a call to the vs setup script.
might be the windows terminal that needs a reinstall ? since win11 seems to prefer that as the default shell after the last update.

@revelator
Copy link
Author

well it built atleast but the shell acting up seems to point at some larger issues so im going to reinstall the terminal to see if that fixes anything if not well atleast i have a way of building it now though it is rather convoluted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants