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

[Windows] Chapter 5: can't emit object or assembler text #8

Open
tesivo opened this issue Nov 10, 2021 · 3 comments
Open

[Windows] Chapter 5: can't emit object or assembler text #8

tesivo opened this issue Nov 10, 2021 · 3 comments

Comments

@tesivo
Copy link

tesivo commented Nov 10, 2021

From last section "Emitting assembler text and object code"
`**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.5
** Copyright (c) 2021 Microsoft Corporation


[vcvarsall.bat] Environment initialized for: 'x64'

F:\LLVM\Learn-LLVM-12\Chapter05\tinylang>llvm-config --version
12.0.0

F:\LLVM\Learn-LLVM-12\Chapter05\tinylang>llvm-config --cmakedir
C:\Program Files (x86)\LLVM\lib\cmake\llvm

F:\LLVM\Learn-LLVM-12\Chapter05\tinylang>mkdir build

F:\LLVM\Learn-LLVM-12\Chapter05\tinylang>cd build

F:\LLVM\Learn-LLVM-12\Chapter05\tinylang\build>cmake -G Ninja -DLLVM_DIR=C:\Program Files (x86)\LLVM\lib\cmake\llvm ..
-- The C compiler identification is MSVC 19.29.30136.0
-- The CXX compiler identification is MSVC 19.29.30136.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using Debug VC++ CRT: MDd
CMake Warning (dev) at C:/Program Files (x86)/LLVM/lib/cmake/llvm/HandleLLVMOptions.cmake:412 (option):
Policy CMP0077 is not set: option() honors normal variables. Run "cmake
--help-policy CMP0077" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

For compatibility with older versions of CMake, option is clearing the
normal variable 'LLVM_ENABLE_WARNINGS'.
Call Stack (most recent call first):
CMakeLists.txt:11 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Using Debug VC++ CRT: MDd
CMake Warning (dev) at C:/Program Files (x86)/LLVM/lib/cmake/llvm/HandleLLVMOptions.cmake:887 (option):
Policy CMP0077 is not set: option() honors normal variables. Run "cmake
--help-policy CMP0077" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

For compatibility with older versions of CMake, option is clearing the
normal variable 'LLVM_ENABLE_EH'.
Call Stack (most recent call first):
CMakeLists.txt:11 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at C:/Program Files (x86)/LLVM/lib/cmake/llvm/HandleLLVMOptions.cmake:888 (option):
Policy CMP0077 is not set: option() honors normal variables. Run "cmake
--help-policy CMP0077" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

For compatibility with older versions of CMake, option is clearing the
normal variable 'LLVM_ENABLE_RTTI'.
Call Stack (most recent call first):
CMakeLists.txt:11 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeDependentOption.cmake:52 (option):
Policy CMP0077 is not set: option() honors normal variables. Run "cmake
--help-policy CMP0077" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

For compatibility with older versions of CMake, option is clearing the
normal variable 'LLVM_EXPORT_SYMBOLS_FOR_PLUGINS'.
Call Stack (most recent call first):
C:/Program Files (x86)/LLVM/lib/cmake/llvm/HandleLLVMOptions.cmake:1051 (CMAKE_DEPENDENT_OPTION)
CMakeLists.txt:11 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Configuring done
-- Generating done
-- Build files have been written to: F:/LLVM/Learn-LLVM-12/Chapter05/tinylang/build

F:\LLVM\Learn-LLVM-12\Chapter05\tinylang\build>ninja
[1/17] Building CXX object lib\Basic\CMakeFiles\tinylangBasic.dir\Version.cpp.obj
...
[17/17] Linking CXX executable tools\driver\tinylang.exe

F:\LLVM\Learn-LLVM-12\Chapter05\tinylang\build>tools\driver\tinylang.exe ..\examples\Gcd.mod --mtriple=x86_64-pc-windows-msvc
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: tools\driver\tinylang.exe ..\examples\Gcd.mod --mtriple=x86_64-pc-windows-msvc
#0 0x00007ff7aa5c323c std::_Verify_range(class std::_Vector_const_iterator<class std::_Vector_val<struct std::_Simple_types<class std::basic_string<char, struct std::char_traits, class std::allocator>>>> const &, class std::_Vector_const_iterator<class std::_Vector_val<struct std::_Simple_types<class std::basic_string<char, struct std::char_traits, class std::allocator>>>> const &) C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector:197:0
#1 0x00007ff7aa5b819e std::_Adl_verify_range<class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class std::basic_string<char, struct std::char_traits, class std::allocator>>>>, class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class std::basic_string<char, struct std::char_traits, class std::allocator>>>>>(class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class std::basic_string<char, struct std::char_traits, class std::allocator>>>> const &, class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class std::basic_string<char, struct std::char_traits, class std::allocator>>>> const &) C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xutility:1312:0
#2 0x00007ff7aa5ba4b3 std::any_of<std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::basic_string<char,std::char_traits,std::allocator > > > >,<lambda_974eb888392fb18f969c0a6e001adf5a> > C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\algorithm:1215:0
#3 0x00007ff7aa5b64fb main F:\LLVM\Learn-LLVM-12\Chapter05\tinylang\tools\driver\Driver.cpp:142:0
#4 0x00007ff7afe202d9 invoke_main d:\a01_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:79:0
#5 0x00007ff7afe201be __scrt_common_main_seh d:\a01_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0
#6 0x00007ff7afe2007e __scrt_common_main d:\a01_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331:0
#7 0x00007ff7afe2036e mainCRTStartup d:\a01_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17:0
#8 0x00007fff911f54e0 (C:\WINDOWS\System32\KERNEL32.DLL+0x154e0)
#9 0x00007fff928c485b (C:\WINDOWS\SYSTEM32\ntdll.dll+0x485b)`

Can you help me out with this? Thanks in advance!

@redstar
Copy link
Collaborator

redstar commented Nov 22, 2021

Hi Lorenzo,
thanks for the report. It looks like that I put the wrong example into the folder. The example uses more features than implemented in chapter 5. I need to check this.

@tesivo
Copy link
Author

tesivo commented Nov 22, 2021

Ok thanks, I'll stand by. Meanwhile I share with you that, removing the lines from:

if (codegen::getMCPU() == "help" ||

to:

seems to work correctly

@tesivo
Copy link
Author

tesivo commented Nov 30, 2021

Hi Lorenzo, thanks for the report. It looks like that I put the wrong example into the folder. The example uses more features than implemented in chapter 5. I need to check this.

Any news?

@tesivo tesivo closed this as completed Dec 29, 2021
@tesivo tesivo reopened this Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants