[llvm-bugs] [Bug 47859] New: Invalid, missing flags passed into Ninja generator (libc++ release build)

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 15 08:03:44 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47859

            Bug ID: 47859
           Summary: Invalid, missing flags passed into Ninja generator
                    (libc++ release build)
           Product: Build scripts
           Version: trunk
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: local.tourist.kiev at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 24065
  --> https://bugs.llvm.org/attachment.cgi?id=24065&action=edit
This my generated build.ninja file

Hi.

It looks like there are few issues, while building libc++ on Windows 10 (I can
confirm on both x86_64 and i386) with clang-cl:

*--* _CRT_STDIO_ISO_WIDE_SPECIFIERS flag is passed into the compiler, while I
didn't enforce that;
*--* /MD flag is passed instead of /MT ;
*--* /DNDEBUG should not be passed, since I am performing a release build ;
*--* /NODEFAULTLIB wasn't specified (while I suspect that it should, according
to my recent tryouts, to resolve the issue) for: libucrt.lib, ucrt.lib,
libvcruntime.lib, vcruntime.lib ;


Not sure (yet) how should it look properly - but here is an example of
improperly formed build instruction, from the generated build.ninja file:

build src\CMakeFiles\cxx_static.dir\valarray.cpp.obj:
CXX_COMPILER__cxx_static_Release
C$:\Users\Worker\Desktop\llvm-project\libcxx\src\valarray.cpp ||
cmake_object_order_depends_target_cxx_static
  DEFINES = -DNDEBUG -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH
-D_ALLOW_MSC_VER_MISMATCH -D_CRTBLD -D_CRT_SECURE_NO_WARNINGS
-D_CRT_STDIO_ISO_WIDE_SPECIFIERS -D_LIBCPP_BUILDING_LIBRARY
-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
  FLAGS = /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -Wall -Wextra
-W -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type
-Wextra-semi -Wno-user-defined-literals -Wno-covered-switch-default
-Wno-suggest-override -Wno-ignored-attributes -Wno-c++98-compat
-Wno-c++98-compat-pedantic -Wno-c++11-compat -Wno-undef -Wno-reserved-id-macro
-Wno-gnu-include-next -Wno-gcc-compat -Wno-zero-as-null-pointer-constant
-Wno-deprecated-dynamic-exception-spec -Wno-sign-conversion -Wno-old-style-cast
-Wno-deprecated -Wno-shift-sign-overflow -Wno-double-promotion -Wno-error -EHsc
/I C:/Users/Worker/Desktop/llvm-project/build_libcxx/include/c++/v1 /FI
C:/Users/Worker/Desktop/llvm-project/build_libcxx/__config_site -std:c++17
  OBJECT_DIR = src\CMakeFiles\cxx_static.dir
  OBJECT_FILE_DIR = src\CMakeFiles\cxx_static.dir
  TARGET_COMPILE_PDB = src\CMakeFiles\cxx_s

I was generating the config. like this:

cmake -DLLVM_PATH=../llvm -DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX="C:\Users\Worker\libcxx_dist"
-DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -G Ninja ../libcxx

And

>cmake --version
cmake version 3.19.0-rc1

>clang-cl --version
clang version 11.0.0
Target: x86_64-pc-windows-msvc
Thread model: posix

>ninja --version
1.10.0.git.kitware.jobserver-1

You can find my generated build.ninja file described here:
https://gist.github.com/advancedwebdeveloper/d1bbd53677dfefac219f21545a55a114

And here is my compressed build folder:
https://drive.google.com/file/d/1oo4jz8A0Ha63tC7LWoZ1IKa6Ld99GXX7/view?usp=sharing

Ivan

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201015/187799aa/attachment-0001.html>


More information about the llvm-bugs mailing list