[PATCH] D47578: Do not enforce absolute path argv0 in windows

Takuto Ikuta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 31 21:12:22 PDT 2018


takuto.ikuta marked an inline comment as done.
takuto.ikuta added a comment.

In https://reviews.llvm.org/D47578#1117874, @rnk wrote:

> I think this would be easy to unit test in llvm/unittests/Support/CommandLine.cpp. We'd just check that the filename is "SupportTests.exe" on Windows and the path is relative after calling this, I guess. Right? Look at how ProgramTest.cpp does this to get a reasonable argv0:
>
>   sys::fs::getMainExecutable(TestMainArgv0, &ProgramTestStringArg1);
>   


Added test.

> 
> 
> In https://reviews.llvm.org/D47578#1117790, @takuto.ikuta wrote:
> 
>> In https://reviews.llvm.org/D47578#1117760, @amccarth wrote:
>>
>> > I was under the impression that some tools rely on the fact that arg[0] is always expanded to an absolute path.  Does this work with lldb and its test suite?
>>
>>
>> I tried, but there is no check-lldb target. Can I ask you what is the target name to run lldb test suite?
> 
> 
> The LLDB test suite isn't in very good shape on Windows. It is complicated to set up and build, I don't want to block this fix on @takuto.ikuta setting up that build environment. This is a Windows-only change, and I believe it makes it more consistent with Linux, so as long as check-llvm, check-clang, and check-lld pass, this should be relatively safe.

I confirmed that this patch passed check-llvm, check-clang and check-lld.

I tried to test lldb, but failed to build. lldb looks cannot be built with MSVC 2017 15.7.2

  FAILED: tools/lldb/tools/lldb-mi/CMakeFiles/lldb-mi.dir/MIDriverMain.cpp.obj
  c:\src\chromium\src\third_party\llvm-build\Release+Asserts\bin\clang-cl.exe  /nologo -DGTEST_HAS_RTTI=0 -DIMPORT_LIBLLDB -DLLDB_CONFIGURATION_RELEASE -DLLDB_DISABLE_CURSES -DLLDB_DISABLE_LIBEDIT -DLLDB_DISABLE_PYTHON -DLLDB_PYTHON_HOME=\"\" -DLLDB_USE_BUILTIN_DEMANGLER -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_DEBUG_POINTER_IMPL="" -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\lldb\tools\lldb-mi -IC:\src\git\llvm-project-20170507\lldb\tools\lldb-mi -Itools\lldb\include -IC:\src\git\llvm-project-20170507\lldb\include -Iinclude -IC:\src\git\llvm-project-20170507\llvm\include -IC:\src\git\llvm-project-20170507\llvm\..\clang\include -Itools\lldb\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /Brepro /W4  -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wcovered-switch-default -Wdelete-non-virtual-dtor -Wstring-conversion -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension /MD /O2 /Ob2 /DNDEBUG   -wd4018 -wd4068 -wd4150 -wd4251 -wd4521 -wd4530  /EHs-c- /GR- /showIncludes /Fotools\lldb\tools\lldb-mi\CMakeFiles\lldb-mi.dir\MIDriverMain.cpp.obj /Fdtools\lldb\tools\lldb-mi\CMakeFiles\lldb-mi.dir\ -c C:\src\git\llvm-project-20170507\lldb\tools\lldb-mi\MIDriverMain.cpp
  In file included from C:\src\git\llvm-project-20170507\lldb\tools\lldb-mi\MIDriverMain.cpp:37:
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\include\csignal(19,13):  error: no member named 'sig_atomic_t' in the global namespace
  using _CSTD sig_atomic_t; using _CSTD raise; using _CSTD signal;
        ~~~~~ ^
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\include\csignal(19,39):  error: no member named 'raise' in the global namespace
  using _CSTD sig_atomic_t; using _CSTD raise; using _CSTD signal;
                                  ~~~~~ ^
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\include\csignal(19,58):  error: no member named 'signal' in the global namespace
  using _CSTD sig_atomic_t; using _CSTD raise; using _CSTD signal;
                                                     ~~~~~ ^
  C:\src\git\llvm-project-20170507\lldb\tools\lldb-mi\MIDriverMain.cpp(74,10):  error: use of undeclared identifier 'SIGINT'
    signal(SIGINT, sigint_handler);
           ^
  C:\src\git\llvm-project-20170507\lldb\tools\lldb-mi\MIDriverMain.cpp(185,10):  error: use of undeclared identifier 'SIGINT'
    signal(SIGINT, sigint_handler);
           ^
  5 errors generated.


https://reviews.llvm.org/D47578





More information about the llvm-commits mailing list