jcmvbkbc/crosstool-NG

[ERROR] configure: error: in `/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-final'

calamarino opened this issue · 4 comments

I have tried a lot of different thing but it has been impossible to make it work :( any help is appreciated
This is my /opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-final/config.log

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.64.  Invocation command line was

  $ /opt/Espressif/crosstool-NG/.build/src/gcc-4.8.2/configure --build=x86_64-build_unknown-linux-gnu --host=x86_64-build_unknown-linux-gnu --target=xtensa-lx106-elf --prefix=/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf --with-local-prefix=/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/xtensa-lx106-elf/sysroot --disable-libmudflap --with-sysroot=/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/xtensa-lx106-elf/sysroot --with-newlib --enable-threads=no --disable-shared --with-pkgversion=crosstool-NG 1.20.0 --disable-__cxa_atexit --with-gmp=/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-mpfr=/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-mpc=/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-isl=/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-cloog=/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-libelf=/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools --enable-lto --enable-target-optspace --disable-libgomp --disable-libmudflap --disable-nls --disable-multilib --enable-languages=c

## --------- ##
## Platform. ##
## --------- ##

hostname = yeke
uname -m = x86_64
uname -r = 4.1.0-1-amd64
uname -s = Linux
uname -v = #1 SMP Debian 4.1.3-1 (2015-08-03)

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin
PATH: /opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools/bin
PATH: /opt/Espressif/crosstool-NG/.build/tools/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/local/games
PATH: /usr/games
PATH: /home/yerco/development/phabricator_tools/arcanist/bin
PATH: /home/yerco/development/phabricator_tools/arcanist/resources/shell
PATH: /opt/debian_armel_wheezy/lib/arm-linux-gnueabi
PATH: /home/yerco/development/esp-open-sdk/xtensa-lx106-elf/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2317: checking build system type
configure:2331: result: x86_64-build_unknown-linux-gnu
configure:2378: checking host system type
configure:2391: result: x86_64-build_unknown-linux-gnu
configure:2411: checking target system type
configure:2424: result: xtensa-lx106-elf
configure:2478: checking for a BSD-compatible install
configure:2546: result: /opt/Espressif/crosstool-NG/.build/tools/bin/install -c
configure:2557: checking whether ln works
configure:2579: result: yes
configure:2583: checking whether ln -s works
configure:2587: result: yes
configure:2594: checking for a sed that does not truncate output
configure:2658: result: /opt/Espressif/crosstool-NG/.build/tools/bin/sed
configure:2667: checking for gawk
configure:2683: found /usr/bin/gawk
configure:2694: result: gawk
configure:3164: checking for libatomic support
configure:3170: result: no
configure:3183: checking for libitm support
configure:3189: result: no
configure:3202: checking for libsanitizer support
configure:3208: result: no
configure:3896: checking for x86_64-build_unknown-linux-gnu-gcc
configure:3912: found /opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools/bin/x86_64-build_unknown-linux-gnu-gcc
configure:3923: result: x86_64-build_unknown-linux-gnu-gcc
configure:4192: checking for C compiler version
configure:4201: x86_64-build_unknown-linux-gnu-gcc --version >&5
gcc (Debian 5.2.1-17) 5.2.1 20150911
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4212: $? = 0
configure:4201: x86_64-build_unknown-linux-gnu-gcc -v >&5
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 5.2.1-17' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --with-arch-32=i586 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.2.1 20150911 (Debian 5.2.1-17) 
configure:4212: $? = 0
configure:4201: x86_64-build_unknown-linux-gnu-gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4212: $? = 1
configure:4201: x86_64-build_unknown-linux-gnu-gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:4212: $? = 1
configure:4232: checking for C compiler default output file name
configure:4254: x86_64-build_unknown-linux-gnu-gcc -O2 -g -pipe     -lstdc++ -lm conftest.c  >&5
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
configure:4258: $? = 1
configure:4295: result: 
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:4301: error: in `/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-final':
configure:4305: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build='x86_64-build_unknown-linux-gnu'
ac_cv_env_AR_FOR_TARGET_set=''
ac_cv_env_AR_FOR_TARGET_value=''
ac_cv_env_AR_set=''
ac_cv_env_AR_value=''
ac_cv_env_AS_FOR_TARGET_set=''
ac_cv_env_AS_FOR_TARGET_value=''
ac_cv_env_AS_set=''
ac_cv_env_AS_value=''
ac_cv_env_CCC_set=''
ac_cv_env_CCC_value=''
ac_cv_env_CC_FOR_TARGET_set=''
ac_cv_env_CC_FOR_TARGET_value=''
ac_cv_env_CC_set=''
ac_cv_env_CC_value=''
ac_cv_env_CFLAGS_set='set'
ac_cv_env_CFLAGS_value='-O2 -g -pipe '
ac_cv_env_CPPFLAGS_set=''
ac_cv_env_CPPFLAGS_value=''
ac_cv_env_CXXFLAGS_set='set'
ac_cv_env_CXXFLAGS_value='-O2 -g -pipe '
ac_cv_env_CXX_FOR_TARGET_set=''
ac_cv_env_CXX_FOR_TARGET_value=''
ac_cv_env_CXX_set=''
ac_cv_env_CXX_value=''
ac_cv_env_DLLTOOL_FOR_TARGET_set=''
ac_cv_env_DLLTOOL_FOR_TARGET_value=''
ac_cv_env_DLLTOOL_set=''
ac_cv_env_DLLTOOL_value=''
ac_cv_env_GCC_FOR_TARGET_set=''
ac_cv_env_GCC_FOR_TARGET_value=''
ac_cv_env_GCJ_FOR_TARGET_set=''
ac_cv_env_GCJ_FOR_TARGET_value=''
ac_cv_env_GFORTRAN_FOR_TARGET_set=''
ac_cv_env_GFORTRAN_FOR_TARGET_value=''
ac_cv_env_GOC_FOR_TARGET_set=''
ac_cv_env_GOC_FOR_TARGET_value=''
ac_cv_env_LDFLAGS_set='set'
ac_cv_env_LDFLAGS_value='  -lstdc++ -lm'
ac_cv_env_LD_FOR_TARGET_set=''
ac_cv_env_LD_FOR_TARGET_value=''
ac_cv_env_LD_set=''
ac_cv_env_LD_value=''
ac_cv_env_LIBS_set=''
ac_cv_env_LIBS_value=''
ac_cv_env_LIPO_FOR_TARGET_set=''
ac_cv_env_LIPO_FOR_TARGET_value=''
ac_cv_env_LIPO_set=''
ac_cv_env_LIPO_value=''
ac_cv_env_NM_FOR_TARGET_set=''
ac_cv_env_NM_FOR_TARGET_value=''
ac_cv_env_NM_set=''
ac_cv_env_NM_value=''
ac_cv_env_OBJCOPY_set=''
ac_cv_env_OBJCOPY_value=''
ac_cv_env_OBJDUMP_FOR_TARGET_set=''
ac_cv_env_OBJDUMP_FOR_TARGET_value=''
ac_cv_env_OBJDUMP_set=''
ac_cv_env_OBJDUMP_value=''
ac_cv_env_RANLIB_FOR_TARGET_set=''
ac_cv_env_RANLIB_FOR_TARGET_value=''
ac_cv_env_RANLIB_set=''
ac_cv_env_RANLIB_value=''
ac_cv_env_READELF_FOR_TARGET_set=''
ac_cv_env_READELF_FOR_TARGET_value=''
ac_cv_env_READELF_set=''
ac_cv_env_READELF_value=''
ac_cv_env_STRIP_FOR_TARGET_set=''
ac_cv_env_STRIP_FOR_TARGET_value=''
ac_cv_env_STRIP_set=''
ac_cv_env_STRIP_value=''
ac_cv_env_WINDMC_FOR_TARGET_set=''
ac_cv_env_WINDMC_FOR_TARGET_value=''
ac_cv_env_WINDMC_set=''
ac_cv_env_WINDMC_value=''
ac_cv_env_WINDRES_FOR_TARGET_set=''
ac_cv_env_WINDRES_FOR_TARGET_value=''
ac_cv_env_WINDRES_set=''
ac_cv_env_WINDRES_value=''
ac_cv_env_build_alias_set='set'
ac_cv_env_build_alias_value='x86_64-build_unknown-linux-gnu'
ac_cv_env_build_configargs_set=''
ac_cv_env_build_configargs_value=''
ac_cv_env_host_alias_set='set'
ac_cv_env_host_alias_value='x86_64-build_unknown-linux-gnu'
ac_cv_env_host_configargs_set=''
ac_cv_env_host_configargs_value=''
ac_cv_env_target_alias_set='set'
ac_cv_env_target_alias_value='xtensa-lx106-elf'
ac_cv_env_target_configargs_set=''
ac_cv_env_target_configargs_value=''
ac_cv_host='x86_64-build_unknown-linux-gnu'
ac_cv_path_SED='/opt/Espressif/crosstool-NG/.build/tools/bin/sed'
ac_cv_path_install='/opt/Espressif/crosstool-NG/.build/tools/bin/install -c'
ac_cv_prog_AWK='gawk'
ac_cv_prog_CC='x86_64-build_unknown-linux-gnu-gcc'
ac_cv_target='xtensa-lx106-elf'
acx_cv_prog_LN='ln'

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR=''
AR_FOR_BUILD='$(AR)'
AR_FOR_TARGET=''
AS=''
AS_FOR_BUILD='$(AS)'
AS_FOR_TARGET=''
AWK='gawk'
BISON=''
BUILD_CONFIG=''
CC='x86_64-build_unknown-linux-gnu-gcc'
CC_FOR_BUILD='$(CC)'
CC_FOR_TARGET=''
CFLAGS='-O2 -g -pipe '
CFLAGS_FOR_BUILD=''
CFLAGS_FOR_TARGET=''
COMPILER_AS_FOR_TARGET=''
COMPILER_LD_FOR_TARGET=''
COMPILER_NM_FOR_TARGET=''
CONFIGURE_GDB_TK=''
CPPFLAGS=''
CXX=''
CXXFLAGS='-O2 -g -pipe '
CXXFLAGS_FOR_BUILD=''
CXXFLAGS_FOR_TARGET=''
CXX_FOR_BUILD='$(CXX)'
CXX_FOR_TARGET=''
DEBUG_PREFIX_CFLAGS_FOR_TARGET=''
DEFS=''
DLLTOOL=''
DLLTOOL_FOR_BUILD='$(DLLTOOL)'
DLLTOOL_FOR_TARGET=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
EXPECT=''
EXTRA_CONFIGARGS_LIBJAVA='--disable-static'
FLAGS_FOR_TARGET=''
FLEX=''
GCC_FOR_TARGET=''
GCC_SHLIB_SUBDIR=''
GCJ_FOR_BUILD='$(GCJ)'
GCJ_FOR_TARGET=''
GDB_TK=''
GFORTRAN_FOR_BUILD='$(GFORTRAN)'
GFORTRAN_FOR_TARGET=''
GNATBIND=''
GNATMAKE=''
GOC_FOR_BUILD='$(GOC)'
GOC_FOR_TARGET=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_GDB_TK=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LD=''
LDFLAGS='  -lstdc++ -lm'
LDFLAGS_FOR_BUILD=''
LDFLAGS_FOR_TARGET=''
LD_FOR_BUILD='$(LD)'
LD_FOR_TARGET=''
LEX=''
LIBOBJS=''
LIBS=''
LIPO=''
LIPO_FOR_TARGET=''
LN='ln'
LN_S='ln -s'
LTLIBOBJS=''
M4=''
MAINT=''
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE=''
MAKEINFO=''
NM=''
NM_FOR_BUILD='$(NM)'
NM_FOR_TARGET=''
OBJCOPY=''
OBJDUMP=''
OBJDUMP_FOR_TARGET=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
RANLIB_FOR_BUILD='$(RANLIB)'
RANLIB_FOR_TARGET=''
RAW_CXX_FOR_TARGET=''
READELF=''
READELF_FOR_TARGET=''
RPATH_ENVVAR=''
RUNTEST=''
SED='/opt/Espressif/crosstool-NG/.build/tools/bin/sed'
SHELL='/bin/bash'
STRIP=''
STRIP_FOR_TARGET=''
SYSROOT_CFLAGS_FOR_TARGET=''
TOPLEVEL_CONFIGURE_ARGUMENTS='/opt/Espressif/crosstool-NG/.build/src/gcc-4.8.2/configure --build=x86_64-build_unknown-linux-gnu --host=x86_64-build_unknown-linux-gnu --target=xtensa-lx106-elf --prefix=/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf --with-local-prefix=/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/xtensa-lx106-elf/sysroot --disable-libmudflap --with-sysroot=/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/xtensa-lx106-elf/sysroot --with-newlib --enable-threads=no --disable-shared --with-pkgversion='\''crosstool-NG 1.20.0'\'' --disable-__cxa_atexit --with-gmp=/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-mpfr=/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-mpc=/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-isl=/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-cloog=/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-libelf=/opt/Espressif/crosstool-NG/.build/xtensa-lx106-elf/buildtools --enable-lto --enable-target-optspace --disable-libgomp --disable-libmudflap --disable-nls --disable-multilib --enable-languages=c'
WINDMC=''
WINDMC_FOR_BUILD='$(WINDMC)'
WINDMC_FOR_TARGET=''
WINDRES=''
WINDRES_FOR_BUILD='$(WINDRES)'
WINDRES_FOR_TARGET=''
YACC=''
ac_ct_CC=''
ac_ct_CXX=''
bindir='${exec_prefix}/bin'
build='x86_64-build_unknown-linux-gnu'
build_alias='x86_64-build_unknown-linux-gnu'
build_configargs=''
build_configdirs='build-libiberty build-texinfo build-flex build-bison build-m4 build-fixincludes'
build_cpu='x86_64'
build_libsubdir='build-x86_64-build_unknown-linux-gnu'
build_noncanonical='x86_64-build_unknown-linux-gnu'
build_os='linux-gnu'
build_subdir='build-x86_64-build_unknown-linux-gnu'
build_tooldir=''
build_vendor='build_unknown'
clooginc=''
clooglibs=''
compare_exclusions=''
configdirs='intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libdecnumber gmp mpfr mpc isl cloog libelf libiconv texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
do_compare=''
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
extra_host_libiberty_configure_flags=''
extra_isl_gmp_configure_flags=''
extra_mpc_gmp_configure_flags=''
extra_mpc_mpfr_configure_flags=''
extra_mpfr_configure_flags=''
gmpinc=''
gmplibs=''
host='x86_64-build_unknown-linux-gnu'
host_alias='x86_64-build_unknown-linux-gnu'
host_configargs=''
host_cpu='x86_64'
host_noncanonical='x86_64-build_unknown-linux-gnu'
host_os='linux-gnu'
host_subdir='.'
host_vendor='build_unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
islinc=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
poststage1_ldflags=''
poststage1_libs=''
prefix='/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf'
program_transform_name='s&^&xtensa-lx106-elf-&'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
stage1_cflags=''
stage1_checking=''
stage1_languages=''
stage1_ldflags=''
stage1_libs=''
stage2_werror_flag=''
sysconfdir='${prefix}/etc'
target='xtensa-lx106-elf'
target_alias='xtensa-lx106-elf'
target_configargs=''
target_configdirs='target-libgcc target-libbacktrace target-libgloss target-newlib target-libgomp target-libatomic target-libitm target-libstdc++-v3 target-libmudflap target-libsanitizer target-libssp target-libquadmath target-libgfortran target-boehm-gc target-libffi target-zlib target-libjava target-libobjc target-libada target-libgo target-rda'
target_cpu='xtensa'
target_noncanonical='xtensa-lx106-elf'
target_os='elf'
target_subdir='xtensa-lx106-elf'
target_vendor='lx106'
tooldir=''

## ------------------- ##
## File substitutions. ##
## ------------------- ##

alphaieee_frag=''
host_makefile_frag='/dev/null'
ospace_frag=''
serialization_dependencies=''
target_makefile_frag=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""

configure: exit 77

Looks like your system is missing libstdc++. Do you have it?

Thanks for replying. l have libstdc++-4.9-dev & libstdc++6

l have libstdc++-4.9-dev & libstdc++6

4.9 doesn't match your compiler version, which is 5.2.
What happens if you do the following:

echo 'int main() {return 0;}' > test.c
x86_64-build_unknown-linux-gnu-gcc -O2 -g -pipe -Wl,-t -lstdc++ -lm test.c

For me it does this (with x86_64-build_unknown-linux-gnu-gcc changed to x86_64-redhat-linux-gcc as I'm on Fedora):

/usr/bin/ld: mode elf_x86_64
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crt1.o
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/crtbegin.o
-lstdc++ (/usr/lib/gcc/x86_64-redhat-linux/4.7.2/libstdc++.so)
-lm (/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/libm.so)
/tmp/ccHTrfJz.o
-lgcc_s (/usr/lib/gcc/x86_64-redhat-linux/4.7.2/libgcc_s.so)
/lib64/libc.so.6
(/usr/lib64/libc_nonshared.a)elf-init.oS
/lib64/ld-linux-x86-64.so.2
-lgcc_s (/usr/lib/gcc/x86_64-redhat-linux/4.7.2/libgcc_s.so)
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/crtend.o
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crtn.o

Note that it gets libstdc++.so in compiler-specific location.

Thanks you are genius!