Compiling icu4c with gcc-8.5.0

3 views
Skip to first unread message

Dmytro Makovey

unread,
Aug 8, 2025, 11:30:37 AMAug 8
to icu-support
I am having issues compiling icu4c-63.1 with gcc-8.5.0.

I see documentation mentioning requirement of C11 and C++17 support and
if I'm reading gcc docs correctly - that is present in gcc-8.5.0.

When I compile using gcc-11.5.0+ everything just compiles and no issues,
but with gcc-8.5.0 I get

g++ -O3 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings
-Wno-long-long -std=c++11 -L/opt/gitlab/bootstrap/lib64
-Wl,--as-needed -o icuinfo icuinfo.o -L../../lib -licutu -L../../lib
-licui18n -L../../lib -licuuc -L../../stubdata -licudata -lpthread -ldl -lm
/opt/gitlab/bootstrap/lib/gcc/x86_64-unknown-linux-gnu/8.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
/opt/gitlab/bootstrap/lib64/libicutu.a(udbgutil.ao): in function
`std::__new_allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const,
std::map<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::set<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::less<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > > >, std::less<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
std::allocator<std::pair<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const,
std::set<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::less<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > > > > > > >::allocate(unsigned long, void
const*)':
udbgutil.cpp:(.text._ZNSt15__new_allocatorISt13_Rb_tree_nodeISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt3mapIS7_St3setIS7_St4lessIS7_ESaIS7_EESC_SaIS1_IS8_SE_EEEEEE8allocateEmPKv[_ZNSt15__new_allocatorISt13_Rb_tree_nodeISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt3mapIS7_St3setIS7_St4lessIS7_ESaIS7_EESC_SaIS1_IS8_SE_EEEEEE8allocateEmPKv]+0x40):
undefined reference to `std::__throw_bad_array_new_length()'
/opt/gitlab/bootstrap/lib/gcc/x86_64-unknown-linux-gnu/8.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
/opt/gitlab/bootstrap/lib64/libicutu.a(udbgutil.ao): in function
`std::__new_allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const,
std::set<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::less<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > > > >::allocate(unsigned long, void const*)':
udbgutil.cpp:(.text._ZNSt15__new_allocatorISt13_Rb_tree_nodeISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt3setIS7_St4lessIS7_ESaIS7_EEEEE8allocateEmPKv[_ZNSt15__new_allocatorISt13_Rb_tree_nodeISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt3setIS7_St4lessIS7_ESaIS7_EEEEE8allocateEmPKv]+0x40):
undefined reference to `std::__throw_bad_array_new_length()'
/opt/gitlab/bootstrap/lib/gcc/x86_64-unknown-linux-gnu/8.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
/opt/gitlab/bootstrap/lib64/libicutu.a(udbgutil.ao): in function
`std::__new_allocator<std::_Rb_tree_node<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >::allocate(unsigned
long, void const*)':
udbgutil.cpp:(.text._ZNSt15__new_allocatorISt13_Rb_tree_nodeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE8allocateEmPKv[_ZNSt15__new_allocatorISt13_Rb_tree_nodeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE8allocateEmPKv]+0x40):
undefined reference to `std::__throw_bad_array_new_length()'


--
Sr. Backend Engineer
GitLab

Markus Scherer

unread,
Aug 8, 2025, 1:44:24 PMAug 8
to Dmytro Makovey, icu-support
On Fri, Aug 8, 2025 at 8:30 AM 'Dmytro Makovey' via icu-support <icu-s...@unicode.org> wrote:
I am having issues compiling icu4c-63.1 with gcc-8.5.0.

I see documentation mentioning requirement of C11 and C++17 support and
if I'm reading gcc docs correctly - that is present in gcc-8.5.0.

ICU 63 required C++11.
ICU 75 and up require C++17.

It looks like std::string fails to compile. I have no idea why.

markus

Dmytro Makovey

unread,
Aug 8, 2025, 6:19:21 PMAug 8
to Markus Scherer, icu-support
For posterity:

it looks like some of my CFLAGS/LDFLAGS were not agreeing with
`gcc-8.5.0`. After I've reset those I can *build* fine. Will need to
validate whether produced library is properly functional etc.

On 2025-08-08 10:44, Markus Scherer wrote:
> On Fri, Aug 8, 2025 at 8:30 AM 'Dmytro Makovey' via icu-support <
> icu-s...@unicode.org> wrote:
>
>> I am having issues compiling icu4c-63.1 with gcc-8.5.0.
>>
>> I see documentation mentioning requirement of C11 and C++17 support and
>> if I'm reading gcc docs correctly - that is present in gcc-8.5.0.
>>
>
> ICU 63 <https://icu.unicode.org/download/63> required C++11.
> ICU 75 <https://icu.unicode.org/download/75> and up require C++17.
>
> It looks like std::string fails to compile. I have no idea why.
>
> markus
>

Reply all
Reply to author
Forward
0 new messages