On Mon, 2020-02-10 at 12:43 -0600, Bruce Dubbs via blfs-dev wrote:
> On 2/10/20 12:24 PM, spiky0011 via blfs-dev wrote:
> > Hi
> > 
> > "System svn"
> > 
> > I,m getting a make fail while trying to build clang in llvm. It gets 
> > through to about 1300 and fails, scrolling back I find an error.
> > 
> > I have built llvm without clang and it succeeded, tried to rebuild llvm 
> > with clang on exsisiting llvm failed.
> > 
> > I also tried on another fresh built LFS without an installed llvm same 
> > fail.
> > 
> > So this fail seems to come from adding clang to the llvm build.
> > 
> > 
> > ./projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:342:72:
> >  
> > error: narrowing conversion of ‘-1’ from ‘int’ to ‘long unsigned int’ 
> > [-Wnarrowing]
> >    342 |     typedef char IMPL_PASTE(assertion_failed_##_, 
> > line)[2*(int)(pred)-1]
> > > ^
> > ../projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:336:30:
> >  
> > note: in expansion of macro ‘IMPL_COMPILER_ASSERT’
> >    336 | #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
> >        |                              ^~~~~~~~~~~~~~~~~~~~
> > ../projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1437:3:
> >  
> > note: in expansion of macro ‘COMPILER_CHECK’
> >   1437 |   COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) 
> > == \
> >        |   ^~~~~~~~~~~~~~
> > ../projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:1131:1:
> >  
> > note: in expansion of macro ‘CHECK_SIZE_AND_OFFSET’
> >   1131 | CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
> >        | ^~~~~~~~~~~~~~~~~~~~~
> > ../projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:342:70:
> >  
> > warning: size of array ‘assertion_failed__1131’ is not an integral 
> > constant-expression [-Wpedantic]
> >    342 |     typedef char IMPL_PASTE(assertion_failed_##_, 
> > line)[2*(int)(pred)-1]
> >        | ~~~~~~~~~~~~~^~
> > ../projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:336:30:
> >  
> > note: in expansion of macro ‘IMPL_COMPILER_ASSERT’
> >    336 | #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
> >        |                              ^~~~~~~~~~~~~~~~~~~~
> > ../projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1437:3:
> >  
> > note: in expansion of macro ‘COMPILER_CHECK’
> >   1437 |   COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) 
> > == \
> >        |   ^~~~~~~~~~~~~~
> > ../projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:1131:1:
> >  
> > note: in expansion of macro ‘CHECK_SIZE_AND_OFFSET’
> >   1131 | CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
> >        | ^~~~~~~~~~~~~~~~~~~~~
> > ../projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:342:70:
> >  
> > error: size ‘-1’ of array ‘assertion_failed__1131’ is negative
> >    342 |     typedef char IMPL_PASTE(assertion_failed_##_, 
> > line)[2*(int)(pred)-1]
> >        | ~~~~~~~~~~~~~^~
> 
> Try:
> 
> sed -e '/ipc_perm, mode/s|^|//|' \
>      -i 
> projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
> 
> The file path is long and is wrapped.
> 
>    -- Bruce
> 
> 
>    -- Bruce
> 

FWIW, I've been building clang separately for a long time and never had an 
issue.
The following is my set of instruction to build clang:

mkdir build
cd build
CC=gcc CXX=g++ cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_CONFIG=/usr/bin/llvm-config \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_BUILD_TESTS=ON \
-Wno-dev \
-G Ninja \
..
ninja
ninja install

The only other difference to the book is that I don't include AMDGPU in 
LLVM_TARGETS_TO_BUILD when building llvm.

Regards,
Wayne.






-- 
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to