[llvm-dev] fail to build libcxx with llvm 8.0.0

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[llvm-dev] fail to build libcxx with llvm 8.0.0

Chris Lattner via llvm-dev


I try to build llvm 8.0.0 (with clang compiler-rt libcxx libcxxabi lldb lld polly). But At libcxx build stage I got a wall of error: 'std::abort' has not been declared

This happen when the builder compile the file: libcxxabi/src/cxa_aux_runtime.cpp

I build using gcc 8.3.0 and I am able to build and run some toys code (see below)

The command used to compile is (they are some duplicated flag due to var env):


$ /opt/gcc/bin/g++  -D_GNU_SOURCE -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS -D_LIBCXXABI_BUILDING_LIBRARY -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/BUILD/llvm-8.0.0/build/projects/libcxxabi/src -I/tmp/BUILD/libcxxabi/src -I/usr/include/libxml2 -I/tmp/BUILD/llvm-8.0.0/build/include -I/tmp/BUILD/llvm-8.0.0/include -I/tmp/BUILD/libcxxabi/include -I/tmp/BUILD/libcxx/include  -O3 -g -Wall -Wformat-security -Wp,-D_GLIBCXX_ASSERTIONS -fPIC -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -mtune=generic  -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1   -std=gnu++14 -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections  -O3 -g -Wall -Wformat-security -Wp,-D_GLIBCXX_ASSERTIONS -fPIC -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -mtune=generic  -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1   -std=gnu++14 -fPIC   -nostdinc++ -Werror=return-type -W -Wall -Wchar-subscripts -Wconversion -Wmissing-braces -Wunused-function -Wshadow -Wsign-compare -Wsign-conversion -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wunused-parameter -Wunused-variable -Wwrite-strings -Wundef -Wno-error -pedantic -fstrict-aliasing -funwind-tables -D_DEBUG -std=c++11 -o CMakeFiles/cxxabi_objects.dir/cxa_aux_runtime.cpp.o -c /tmp/BUILD/libcxxabi/src/cxa_aux_runtime.cpp
In file included from /tmp/BUILD/libcxx/include/stdlib.h:94,
                 from /tmp/BUILD/libcxx/include/cstdlib:86,
                 from /tmp/BUILD/libcxx/include/exception:82,
                 from /tmp/BUILD/libcxx/include/new:85,
                 from /tmp/BUILD/libcxxabi/src/cxa_aux_runtime.cpp:14:
/opt/gcc/include/c++/8/stdlib.h:38:12: error: 'std::abort' has not been declared
 using std::abort;
/opt/gcc/include/c++/8/stdlib.h:39:12: error: 'std::atexit' has not been declared
 using std::atexit;
/opt/gcc/include/c++/8/stdlib.h:40:12: error: 'std::exit' has not been declared


Thanksfor your help,

Best regards






#include <iostream>
using namespace std;
int main(void) {
  cout << "It works for C++!" << endl;
  return 0;


#include <iostream>
#include <cstdlib>
using namespace std;
int main()
  div_t result1 = div(51, 6);
  cout << "Quotient of 51/6 = " << result1.quot << endl;
  cout << "Remainder of 51/6 = " << result1.rem << endl;
  ldiv_t result2 = div(19237012L,251L);
  cout << "Quotient of 19237012L/251L = " << result2.quot << endl;
  cout << "Remainder of 19237012L/251L = " << result2.rem << endl;
  return 0;


Researcher computational biology

PhD, Jonathan MERCIER

Bioinformatics (LBI)

2, rue Gaston Crémieux

91057 Evry Cedex

Tel :(33) 1 60 87 83 44

Email :[hidden email]

LLVM Developers mailing list
[hidden email]