[llvm-commits] [PATCH - lld] Fix build issue building lld against libstdc++ 4.7
Michael Spencer
bigcheesegs at gmail.com
Fri Dec 21 19:25:50 PST 2012
On Fri, Dec 21, 2012 at 2:55 PM, Andy Gibbs <andyg1001 at hotmail.co.uk> wrote:
> Hi,
>
> There is a build error building lld against libstdc++ 4.7 (certainly on
> linux), which the attached patch seeks to address. It must have crept in at
> some point following r169487 (last working checkpoint in my repository
> clone), but I haven't tracked it down to an exact commit. At the bottom of
> this post is a log of the error generated on my system.
>
> The fix simply drops a (probably) extraneous "const" from the ArrayRef
> template parameter used to passing arguments to the driver.
>
> Am I ok to commit this fix?
>
> Cheers,
> Andy
>
>
> Details of build failure:
>
> Scanning dependencies of target lld
> [100%] Building CXX object tools/lld/tools/lld/CMakeFiles/lld.dir/lld.cpp.o
> In file included from clang/source/tools/lld/tools/lld/lld.cpp:18:
> In file included from clang/source/tools/lld/include/lld/Driver/Driver.h:23:
> In file included from clang/source/include/llvm/Option/ArgList.h:13:
> In file included from clang/source/include/llvm/ADT/SmallVector.h:20:
> In file included from
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/algorithm:62:
> In file included from
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/bits/stl_algo.h:67:
> In file included from
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/random:40:
> In file included from
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/string:42:
> In file included from
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/bits/allocator.h:48:
> In file included from
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h:34:
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/ext/new_allocator.h:83:7:
> error: class member cannot be redeclared
> address(const_reference __x) const _GLIBCXX_NOEXCEPT
> ^
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/bits/allocator.h:89:29:
> note: in instantiation of template class '__gnu_cxx::new_allocator<const
> char *const>' requested
> here
> class allocator: public __glibcxx_base_allocator<_Tp>
> ^
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h:35:35:
> note: expanded from macro '__glibcxx_base_allocator'
> #define __glibcxx_base_allocator __gnu_cxx::new_allocator
> ^
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/bits/alloc_traits.h:89:24:
> note: in instantiation of template class 'std::allocator<const char *const>'
> requested here
> typedef typename _Alloc::value_type value_type;
> ^
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/ext/alloc_traits.h:110:5:
> note: in instantiation of template class
> 'std::allocator_traits<std::allocator<const char *const> >' requested
> here
> : std::allocator_traits<_Alloc>
> ^
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/bits/stl_vector.h:75:35:
> note: in instantiation of template class
> '__gnu_cxx::__alloc_traits<std::allocator<const char
> *const> >' requested here
> typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
> ^
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/bits/stl_vector.h:208:30:
> note: in instantiation of template class 'std::_Vector_base<const char
> *const,
> std::allocator<const char *const> >' requested here
> class vector : protected _Vector_base<_Tp, _Alloc>
> ^
> clang/source/tools/lld/tools/lld/lld.cpp:126:7: note: in instantiation of
> template class 'std::vector<const char *const, std::allocator<const char
> *const> >' requested here
> llvm::ArrayRef<const char *const>(argv + 1, argv + argc));
> ^
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/ext/new_allocator.h:79:7:
> note: previous declaration is here
> address(reference __x) const _GLIBCXX_NOEXCEPT
> ^
> 1 error generated.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
It's not extraneous, but the patch is fine to commit.
- Michael Spencer
More information about the llvm-commits
mailing list