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

v.gen: add _M_ARM64 to endianness check #21109

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

daddycocoaman
Copy link
Contributor

This PR addresses #21003 by adding a check that will allow for Windows ARM64 users to compile the X64 version of V with .\make.bat -msvc . The only remaining issue is that there is a harmless but loud error that shows up from detect_tcc because TCC is downloaded even when another compiler is specified (which maybe shouldn't be the case?). But everything works:

Updating TCC
 > Syncing TCC from https://github.com/vlang/tccbin

Updating vc...
 > Sync with remote https://github.com/vlang/vc

Building V...
 > Attempting to build "./v_win_bootstrap.exe" (from v_win.c) with MSVC
v_win.c
 > Compiling "./v.exe" with "./v_win_bootstrap.exe"
> C compiler cmd: "C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.39.33519\bin\Hostx64\x64\cl.exe" "@C:\Users\*\AppData\Local\Temp\v_0\v_up.exe.tmp.c.rsp"
> C compiler response file "C:\Users\*\AppData\Local\Temp\v_0\v_up.exe.tmp.c.rsp":
-w /we4013 /volatile:ms /Fo"C:\Users\*\AppData\Local\Temp\v_0\v_up.exe.tmp.c.obj" /F 16777216 /MDd /D_DEBUG /Zi /Fd"C:\Users\*\AppData\Local\Temp\v_0\v_up.exe.tmp.c.pdb" "C:\Users\*\AppData\Local\Temp\v_0\v_up.exe.tmp.c" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt" -I "C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.39.33519\include" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared" -I "C:\Users\*\dev\v-dev\thirdparty\stdatomic\win" kernel32.lib user32.lib advapi32.lib ws2_32.lib dbghelp.lib ws2_32.lib advapi32.lib shell32.lib /link /NOLOGO /OUT:"C:\Users\*\dev\v-dev\v_up.exe" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt\X64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\X64" /LIBPATH:"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.39.33519\lib\X64" /DEBUG:FULL
==================
C:/Users/*/AppData/Local/Temp/v_0/detect_tcc.01HSYEXNM7BRXKQF38GTJMN8XC.tmp.c:6895: warning: implicit declaration of function 'tcc_backtrace'
tcc: error: unrecognized file type
tcc: error: library 'dbghelp' not found
...
==================
(Use `v -cg` to print the entire error message)

builder error:
==================
C error. This should never happen.

This is a compiler bug, please report it using `v bug file.v`.

https://github.com/vlang/v/issues/new/choose

You can also use #help on Discord: https://discord.gg/vlang

 > V built successfully
 > To add V to your PATH, run `./v.exe symlink`.

V version: V 0.4.5 80a4249

@JalonSolov
Copy link
Contributor

Yes, tcc should still be downloaded... if there were a proper Windows ARM64 version of tcc.

The reason is that .\make.bat -msvc only builds V itself with msvc, it doesn't force everything built with V to be built the same. To do that, you would have to set VFLAGS='-cc msvc' or just let the normal "rollover" to msvc happen when a working tcc can't be found - which is slower than setting the env var so it doesn't try tcc at all.

tcc is so much faster than msvc that it will always be the default... unless we replace it with vtcc (the V port of tcc).

@spytheman spytheman merged commit df9a815 into vlang:master Mar 27, 2024
54 checks passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants