Re: [llvm-dev] 3 stage ninja bootstrap on darwin?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] 3 stage ninja bootstrap on darwin?

Boris Kolpackov via cfe-dev
Hi all

I just ran into the same issue Jack described below.
I did a 2-stage build of LLVM/Clang/Compiler-rt on the current release_50 branch.

Versions:
OSX 10.12.6, Xcode 8.0, CMake 1.8.2, Ninja 1.7.2, Ccache 3.3.4

Log:
$ cmake -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_BUILD_TYPE=Release
-DLLVM_ENABLE_LTO=ON

-DLLVM_TARGETS_TO_BUILD=host
-DLLVM_CREATE_XCODE_TOOLCHAIN=ON

-DLLVM_INCLUDE_TESTS=ON
-DLLVM_INCLUDE_EXAMPLES=OFF
-DLLVM_INCLUDE_DOCS=OFF
-DLLVM_ENABLE_PROJECTS="clang;compiler-rt;lldb"

-DCLANG_ENABLE_BOOTSTRAP=ON ../llvm
-- The C compiler identification is AppleClang 8.0.0.8000038
-- The CXX compiler identification is AppleClang 8.0.0.8000038
...
-- Build files have been written to: /media/Dev/llvm50/build-ninja-clang-release
$ ninja stage2
...
-- Performing Test LLVM_NO_OLD_LIBSTDCXX
-- Performing Test LLVM_NO_OLD_LIBSTDCXX - Failed
CMake Error at cmake/modules/CheckCompilerVersion.cmake:38 (message):
Host Clang must be able to find libstdc++4.8 or newer!
Call Stack (most recent call first):
cmake/config-ix.cmake:14 (include)
CMakeLists.txt:584 (include)

Hack to force LLVM_ENABLE_LIBCXX=ON:
diff --git a/cmake/modules/CheckCompilerVersion.cmake b/cmake/modules/CheckCompilerVersion.cmake
index 2e8f5445781..38ec06c7631 100644
--- a/cmake/modules/CheckCompilerVersion.cmake
+++ b/cmake/modules/CheckCompilerVersion.cmake
@@ -1,6 +1,7 @@
 # Check if the host compiler is new enough. LLVM requires at least GCC 4.8,
 # MSVC 2015 (Update 3), or Clang 3.1.
 
+set(LLVM_ENABLE_LIBCXX ON)
 include(CheckCXXSourceCompiles)
 
 if(NOT DEFINED LLVM_COMPILER_CHECKED)

Maybe it just got messed up. However, I never explicitly pass
-DLLVM_ENABLE_LIBCXX=ON and it never caused problems in single-stage builds,
as on OSX the setting defaults to ON. Shouldn't that be the same for 2-stage
out of the box? Maybe stage 1 passes an invalid setting to the
stage 2
configuration that overrides the otherwise correct default?

Cheers
Stefan

  Is anyone using the 3 stage bootstrap described under 3-Stage
Non-Determinism at http://llvm.org/docs/AdvancedBuilds.html? I am
trying to build against the MacPorts current python2.7, ninja and make
releases, a build of current trunk for llvm, compiler-rt, cfe and
clang-tools-extra using...
% cmake -DLLVM_LINK_LLVM_DYLIB:BOOL=ON
-DCOMPILER_RT_ENABLE_IOS:BOOL=OFF -DLLVM_LIT_ARGS:STRING=-v
-DPYTHON_EXECUTABLE:FILEPATH=/opt/local/bin/python2.7
-DLLVM_ENABLE_ASSERTIONS:BOOL=OFF -DCMAKE_OSX_SYSROOT:STRING=/
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=
-DLLVM_TARGETS_TO_BUILD="X86;PowerPC;ARM"
-DCMAKE_INSTALL_PREFIX:PATH=/Users/howarth/dist
-DCMAKE_BUILD_TYPE:STRING=Release -DLLVM_ENABLE_LIBCXX:BOOL=ON -G
Ninja -C /Users/howarth/3stage/cfe-5.0.0.src/cmake/caches/3-stage.cmake
../llvm-5.0.0.src
% ninja stage3
on x86_64-apple-darwin16 using the Xcode 8.3 Beta 5 devtools as the
system compiler. The build is tripping up on the error...
-- Performing Test LLVM_NO_OLD_LIBSTDCXX
-- Performing Test LLVM_NO_OLD_LIBSTDCXX - Failed
CMake Error at cmake/modules/CheckCompilerVersion.cmake:38 (message):
  Host Clang must be able to find libstdc++4.8 or newer!
Call Stack (most recent call first):
  cmake/config-ix.cmake:14 (include)
  CMakeLists.txt:559 (include)
where is seems that -DLLVM_ENABLE_LIBCXX:BOOL=ON isn't getting passed
down to from stage1 to the stage2 configuration step. Any ideas on how
to work around this for a build against the system livc+++ under
Sierra?
         Jack
-- 
https://weliveindetail.github.io/blog/
https://cryptup.org/pub/stefan.graenitz@...

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] 3 stage ninja bootstrap on darwin?

Boris Kolpackov via cfe-dev
When doing multi-stage builds on Darwin you *must* have libcxx checked out in your source tree. Otherwise this error is expected.

-Chris

On Aug 5, 2017, at 10:39 AM, Stefan Gränitz via cfe-dev <[hidden email]> wrote:

Hi all

I just ran into the same issue Jack described below.
I did a 2-stage build of LLVM/Clang/Compiler-rt on the current release_50 branch.

Versions:
OSX 10.12.6, Xcode 8.0, CMake 1.8.2, Ninja 1.7.2, Ccache 3.3.4

Log:
$ cmake -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_BUILD_TYPE=Release
-DLLVM_ENABLE_LTO=ON

-DLLVM_TARGETS_TO_BUILD=host
-DLLVM_CREATE_XCODE_TOOLCHAIN=ON

-DLLVM_INCLUDE_TESTS=ON
-DLLVM_INCLUDE_EXAMPLES=OFF
-DLLVM_INCLUDE_DOCS=OFF
-DLLVM_ENABLE_PROJECTS="clang;compiler-rt;lldb"

-DCLANG_ENABLE_BOOTSTRAP=ON ../llvm
-- The C compiler identification is AppleClang 8.0.0.8000038
-- The CXX compiler identification is AppleClang 8.0.0.8000038
...
-- Build files have been written to: /media/Dev/llvm50/build-ninja-clang-release
$ ninja stage2
...
-- Performing Test LLVM_NO_OLD_LIBSTDCXX
-- Performing Test LLVM_NO_OLD_LIBSTDCXX - Failed
CMake Error at cmake/modules/CheckCompilerVersion.cmake:38 (message):
Host Clang must be able to find libstdc++4.8 or newer!
Call Stack (most recent call first):
cmake/config-ix.cmake:14 (include)
CMakeLists.txt:584 (include)

Hack to force LLVM_ENABLE_LIBCXX=ON:
diff --git a/cmake/modules/CheckCompilerVersion.cmake b/cmake/modules/CheckCompilerVersion.cmake
index 2e8f5445781..38ec06c7631 100644
--- a/cmake/modules/CheckCompilerVersion.cmake
+++ b/cmake/modules/CheckCompilerVersion.cmake
@@ -1,6 +1,7 @@
 # Check if the host compiler is new enough. LLVM requires at least GCC 4.8,
 # MSVC 2015 (Update 3), or Clang 3.1.
 
+set(LLVM_ENABLE_LIBCXX ON)
 include(CheckCXXSourceCompiles)
 
 if(NOT DEFINED LLVM_COMPILER_CHECKED)

Maybe it just got messed up. However, I never explicitly pass
-DLLVM_ENABLE_LIBCXX=ON and it never caused problems in single-stage builds,
as on OSX the setting defaults to ON. Shouldn't that be the same for 2-stage
out of the box? Maybe stage 1 passes an invalid setting to the
stage 2
configuration that overrides the otherwise correct default?

Cheers
Stefan

  Is anyone using the 3 stage bootstrap described under 3-Stage
Non-Determinism at http://llvm.org/docs/AdvancedBuilds.html? I am
trying to build against the MacPorts current python2.7, ninja and make
releases, a build of current trunk for llvm, compiler-rt, cfe and
clang-tools-extra using...
% cmake -DLLVM_LINK_LLVM_DYLIB:BOOL=ON
-DCOMPILER_RT_ENABLE_IOS:BOOL=OFF -DLLVM_LIT_ARGS:STRING=-v
-DPYTHON_EXECUTABLE:FILEPATH=/opt/local/bin/python2.7
-DLLVM_ENABLE_ASSERTIONS:BOOL=OFF -DCMAKE_OSX_SYSROOT:STRING=/
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=
-DLLVM_TARGETS_TO_BUILD="X86;PowerPC;ARM"
-DCMAKE_INSTALL_PREFIX:PATH=/Users/howarth/dist
-DCMAKE_BUILD_TYPE:STRING=Release -DLLVM_ENABLE_LIBCXX:BOOL=ON -G
Ninja -C /Users/howarth/3stage/cfe-5.0.0.src/cmake/caches/3-stage.cmake
../llvm-5.0.0.src
% ninja stage3
on x86_64-apple-darwin16 using the Xcode 8.3 Beta 5 devtools as the
system compiler. The build is tripping up on the error...
-- Performing Test LLVM_NO_OLD_LIBSTDCXX
-- Performing Test LLVM_NO_OLD_LIBSTDCXX - Failed
CMake Error at cmake/modules/CheckCompilerVersion.cmake:38 (message):
  Host Clang must be able to find libstdc++4.8 or newer!
Call Stack (most recent call first):
  cmake/config-ix.cmake:14 (include)
  CMakeLists.txt:559 (include)
where is seems that -DLLVM_ENABLE_LIBCXX:BOOL=ON isn't getting passed
down to from stage1 to the stage2 configuration step. Any ideas on how
to work around this for a build against the system livc+++ under
Sierra?
         Jack
-- 
https://weliveindetail.github.io/blog/
https://cryptup.org/pub/stefan.graenitz@...
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] 3 stage ninja bootstrap on darwin?

Boris Kolpackov via cfe-dev
On Fri, Sep 1, 2017 at 7:14 PM, Chris Bieneman via cfe-dev
<[hidden email]> wrote:
> When doing multi-stage builds on Darwin you *must* have libcxx checked out
> in your source tree. Otherwise this error is expected.
>

Is this documented somewhere?


https://github.com/llvm-mirror/llvm/blob/master/docs/AdvancedBuilds.rst

only mentions compiler-rt

Csaba
--
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] 3 stage ninja bootstrap on darwin?

Boris Kolpackov via cfe-dev
The only place I've seen it mentioned is here (https://clang.llvm.org/get_started.html):

6. Check out libcxx: (only required to build and run Compiler-RT tests on OS X, optional otherwise)



On Sun, Sep 10, 2017 at 10:16 AM, Csaba Raduly via cfe-dev <[hidden email]> wrote:
On Fri, Sep 1, 2017 at 7:14 PM, Chris Bieneman via cfe-dev
<[hidden email]> wrote:
> When doing multi-stage builds on Darwin you *must* have libcxx checked out
> in your source tree. Otherwise this error is expected.
>

Is this documented somewhere?


https://github.com/llvm-mirror/llvm/blob/master/docs/AdvancedBuilds.rst

only mentions compiler-rt

Csaba
--
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev