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

Jonathan MERCIER via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 16 00:51:09 PDT 2019


Dear,

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


#############

# TOYS CODE  #

#############

it_works.cpp

===========

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


test_div.cpp

===========
#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;
}




-- 

Jonathan MERCIER
Centre National de Recherche en Génomique Humaine (CNRGH)

Researcher computational biology

PhD, Jonathan MERCIER

Bioinformatics (LBI)

2, rue Gaston Crémieux

91057 Evry Cedex

Tel :(33) 1 60 87 83 44

Email :jonathan.mercier at cng.fr <mailto:jonathan.mercier at cng.fr>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190416/b453b814/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jecdjchmdodadhfb.
Type: image/jpg
Size: 5638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190416/b453b814/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lphpcgbcclimidgb.
Type: image/jpg
Size: 17553 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190416/b453b814/attachment-0001.jpg>


More information about the llvm-dev mailing list