Reputation: 500
I'm trying to cross compile a C/C++ application, and since it needs an old version of libc, I compiled a custom GCC without --with-sysroot
flag, and I use as sysroot a copy of the target root filesystem. However, it can't find some libraries as Glog, even if the .so
files are present in the sysroot. Using a native compilation, everything is fine (si I guess the CMakeLists is good?), but when cross compiling I get:
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libgflags.so.2, needed by /opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libglog.so, not found (try using -rpath or -rpath-link)
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libglog.so: undefined reference to `google::FlagRegisterer::FlagRegisterer(char const*, char const*, char const*, char const*, void*, void*)'
collect2: error: ld returned 1 exit status
If I use as compiler flag -v
:
[ 42%] Linking CXX executable single_lidar_listener
Using built-in specs.
COLLECT_GCC=/opt/cross/bin/arm-linux-gnueabihf-g++
COLLECT_LTO_WRAPPER=/opt/cross/libexec/gcc/arm-linux-gnueabihf/6.3.0/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../gcc-6.3.0/configure --prefix=/opt/cross --target=arm-linux-gnueabihf --enable-languages=c,c++ --disable-multilib -v --enable-shared --enable-linker-build-id --enable-threads=posix --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-gtk-cairo --with-arch-directory=arm --enable-multiarch --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --with-target-system-zlib --disable-sjlj-exceptions --enable-checking=release --without-included-gettext
Thread model: posix
gcc version 6.3.0 (GCC)
COMPILER_PATH=/opt/cross/libexec/gcc/arm-linux-gnueabihf/6.3.0/:/opt/cross/libexec/gcc/arm-linux-gnueabihf/6.3.0/:/opt/cross/libexec/gcc/arm-linux-gnueabihf/:/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/:/opt/cross/lib/gcc/arm-linux-gnueabihf/:/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/bin/
LIBRARY_PATH=/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/:/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/:/opt/box-root-fs/lib/arm-linux-gnueabihf/:/opt/box-root-fs/lib/:/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/:/opt/box-root-fs/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-g' '-o' 'single_lidar_listener' '-L/opt/box-root-fs/lib' '-L/opt/box-root-fs/usr/lib' '-L/opt/box-root-fs/usr/local/lib' '-shared-libgcc' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu'
/opt/cross/libexec/gcc/arm-linux-gnueabihf/6.3.0/collect2 -plugin /opt/cross/libexec/gcc/arm-linux-gnueabihf/6.3.0/liblto_plugin.so -plugin-opt=/opt/cross/libexec/gcc/arm-linux-gnueabihf/6.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccvlXVsC.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/opt/box-root-fs --build-id --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -pie -o single_lidar_listener /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/Scrt1.o /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/crti.o /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/crtbeginS.o -L/opt/box-root-fs/lib -L/opt/box-root-fs/usr/lib -L/opt/box-root-fs/usr/local/lib -L/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0 -L/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib -L/opt/box-root-fs/lib/arm-linux-gnueabihf -L/opt/box-root-fs/lib -L/opt/box-root-fs/usr/lib/arm-linux-gnueabihf -L/opt/box-root-fs/usr/lib CMakeFiles/single_lidar_listener.dir/single_lidar.cpp.o CMakeFiles/single_lidar_listener.dir/sick_scan_xd_api_wrapper.c.o -rpath /lib:/usr/lib:/usr/local/lib -lglog libtoojpeg.a -ldl -lrt -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/crtendS.o /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/crtn.o
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libgflags.so.2, needed by /opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libglog.so, not found (try using -rpath or -rpath-link)
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libglog.so: undefined reference to `google::FlagRegisterer::FlagRegisterer(char const*, char const*, char const*, char const*, void*, void*)'
collect2: error: ld returned 1 exit status
and with -Wl,--verbose
[ 71%] Linking CXX executable single_lidar_listener
GNU ld (GNU Binutils) 2.28
Supported emulations:
armelf_linux_eabi
armelfb_linux_eabi
using internal linker script:
==================================================
/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */
/* Copyright (C) 2014-2017 Free Software Foundation, Inc.
Copying and distribution of this script, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. */
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
"elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SEARCH_DIR("/opt/cross/arm-linux-gnueabihf/lib");
SECTIONS
{
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = SEGMENT_START("text-segment", 0)); . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
.interp : { *(.interp) }
.note.gnu.build-id : { *(.note.gnu.build-id) }
.hash : { *(.hash) }
.gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
.rel.dyn :
{
*(.rel.init)
*(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
*(.rel.fini)
*(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
*(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
*(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
*(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
*(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
*(.rel.ctors)
*(.rel.dtors)
*(.rel.got)
*(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
PROVIDE_HIDDEN (__rel_iplt_start = .);
*(.rel.iplt)
PROVIDE_HIDDEN (__rel_iplt_end = .);
}
.rela.dyn :
{
*(.rela.init)
*(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
*(.rela.fini)
*(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
*(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
*(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
*(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
*(.rela.ctors)
*(.rela.dtors)
*(.rela.got)
*(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
PROVIDE_HIDDEN (__rela_iplt_start = .);
*(.rela.iplt)
PROVIDE_HIDDEN (__rela_iplt_end = .);
}
.rel.plt :
{
*(.rel.plt)
}
.rela.plt :
{
*(.rela.plt)
}
.init :
{
KEEP (*(SORT_NONE(.init)))
}
.plt : { *(.plt) }
.iplt : { *(.iplt) }
.text :
{
*(.text.unlikely .text.*_unlikely .text.unlikely.*)
*(.text.exit .text.exit.*)
*(.text.startup .text.startup.*)
*(.text.hot .text.hot.*)
*(.text .stub .text.* .gnu.linkonce.t.*)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
}
.fini :
{
KEEP (*(SORT_NONE(.fini)))
}
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
.rodata1 : { *(.rodata1) }
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) }
PROVIDE_HIDDEN (__exidx_start = .);
.ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
PROVIDE_HIDDEN (__exidx_end = .);
.eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
.gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
.gcc_except_table.*) }
.gnu_extab : ONLY_IF_RO { *(.gnu_extab*) }
/* These sections are generated by the Sun/Oracle C++ compiler. */
.exception_ranges : ONLY_IF_RO { *(.exception_ranges
.exception_ranges*) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
. = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
.gnu_extab : ONLY_IF_RW { *(.gnu_extab) }
.gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
.exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
}
.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
PROVIDE_HIDDEN (__init_array_end = .);
}
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
PROVIDE_HIDDEN (__fini_array_end = .);
}
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin.o(.ctors))
KEEP (*crtbegin?.o(.ctors))
/* We don't want to include the .ctor section from
the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
}
.dtors :
{
KEEP (*crtbegin.o(.dtors))
KEEP (*crtbegin?.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
}
.jcr : { KEEP (*(.jcr)) }
.data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
.dynamic : { *(.dynamic) }
. = DATA_SEGMENT_RELRO_END (0, .);
.got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
.data :
{
PROVIDE (__data_start = .);
*(.data .data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
}
.data1 : { *(.data1) }
_edata = .; PROVIDE (edata = .);
. = .;
__bss_start = .;
__bss_start__ = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections.
FIXME: Why do we need it? When there is no .bss section, we don't
pad the .data section. */
. = ALIGN(. != 0 ? 32 / 8 : 1);
}
_bss_end__ = . ; __bss_end__ = . ;
. = ALIGN(32 / 8);
. = SEGMENT_START("ldata-segment", .);
. = ALIGN(32 / 8);
__end__ = . ;
_end = .; PROVIDE (end = .);
. = DATA_SEGMENT_END (.);
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* DWARF 3 */
.debug_pubtypes 0 : { *(.debug_pubtypes) }
.debug_ranges 0 : { *(.debug_ranges) }
/* DWARF Extension. */
.debug_macro 0 : { *(.debug_macro) }
.debug_addr 0 : { *(.debug_addr) }
.gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}
==================================================
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/Scrt1.o succeeded
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/Scrt1.o
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/crti.o succeeded
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/crti.o
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/crtbeginS.o succeeded
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/crtbeginS.o
attempt to open CMakeFiles/single_lidar_listener.dir/single_lidar.cpp.o succeeded
CMakeFiles/single_lidar_listener.dir/single_lidar.cpp.o
attempt to open CMakeFiles/single_lidar_listener.dir/sick_scan_xd_api_wrapper.c.o succeeded
CMakeFiles/single_lidar_listener.dir/sick_scan_xd_api_wrapper.c.o
attempt to open /opt/box-root-fs/lib/libglog.so failed
attempt to open /opt/box-root-fs/lib/libglog.a failed
attempt to open /opt/box-root-fs/usr/lib/libglog.so failed
attempt to open /opt/box-root-fs/usr/lib/libglog.a failed
attempt to open /opt/box-root-fs/usr/local/lib/libglog.so failed
attempt to open /opt/box-root-fs/usr/local/lib/libglog.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libglog.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libglog.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libglog.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libglog.a failed
attempt to open /opt/box-root-fs/lib/arm-linux-gnueabihf/libglog.so failed
attempt to open /opt/box-root-fs/lib/arm-linux-gnueabihf/libglog.a failed
attempt to open /opt/box-root-fs/lib/libglog.so failed
attempt to open /opt/box-root-fs/lib/libglog.a failed
attempt to open /opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libglog.so succeeded
-lglog (/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libglog.so)
attempt to open libtoojpeg.a succeeded
attempt to open /opt/box-root-fs/lib/libdl.so failed
attempt to open /opt/box-root-fs/lib/libdl.a failed
attempt to open /opt/box-root-fs/usr/lib/libdl.so failed
attempt to open /opt/box-root-fs/usr/lib/libdl.a failed
attempt to open /opt/box-root-fs/usr/local/lib/libdl.so failed
attempt to open /opt/box-root-fs/usr/local/lib/libdl.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libdl.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libdl.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libdl.so succeeded
-ldl (/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libdl.so)
attempt to open /opt/box-root-fs/lib/librt.so failed
attempt to open /opt/box-root-fs/lib/librt.a failed
attempt to open /opt/box-root-fs/usr/lib/librt.so failed
attempt to open /opt/box-root-fs/usr/lib/librt.a failed
attempt to open /opt/box-root-fs/usr/local/lib/librt.so failed
attempt to open /opt/box-root-fs/usr/local/lib/librt.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/librt.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/librt.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/librt.so succeeded
-lrt (/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/librt.so)
attempt to open /opt/box-root-fs/lib/libstdc++.so failed
attempt to open /opt/box-root-fs/lib/libstdc++.a failed
attempt to open /opt/box-root-fs/usr/lib/libstdc++.so failed
attempt to open /opt/box-root-fs/usr/lib/libstdc++.a failed
attempt to open /opt/box-root-fs/usr/local/lib/libstdc++.so failed
attempt to open /opt/box-root-fs/usr/local/lib/libstdc++.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libstdc++.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libstdc++.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so succeeded
-lstdc++ (/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so)
attempt to open /opt/box-root-fs/lib/libm.so failed
attempt to open /opt/box-root-fs/lib/libm.a failed
attempt to open /opt/box-root-fs/usr/lib/libm.so failed
attempt to open /opt/box-root-fs/usr/lib/libm.a failed
attempt to open /opt/box-root-fs/usr/local/lib/libm.so failed
attempt to open /opt/box-root-fs/usr/local/lib/libm.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libm.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libm.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libm.so succeeded
-lm (/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libm.so)
attempt to open /opt/box-root-fs/lib/libgcc_s.so failed
attempt to open /opt/box-root-fs/lib/libgcc_s.a failed
attempt to open /opt/box-root-fs/usr/lib/libgcc_s.so failed
attempt to open /opt/box-root-fs/usr/lib/libgcc_s.a failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc_s.so failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc_s.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc_s.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc_s.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libgcc_s.so succeeded
opened script file /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libgcc_s.so
opened script file /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libgcc_s.so
attempt to open libgcc_s.so.1 failed
attempt to open /opt/box-root-fs/lib/libgcc_s.so.1 failed
attempt to open /opt/box-root-fs/usr/lib/libgcc_s.so.1 failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc_s.so.1 failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc_s.so.1 failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libgcc_s.so.1 succeeded
libgcc_s.so.1 (/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libgcc_s.so.1)
attempt to open /opt/box-root-fs/lib/libgcc.so failed
attempt to open /opt/box-root-fs/lib/libgcc.a failed
attempt to open /opt/box-root-fs/usr/lib/libgcc.so failed
attempt to open /opt/box-root-fs/usr/lib/libgcc.a failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc.so failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc.a succeeded
attempt to open /opt/box-root-fs/lib/libgcc.so failed
attempt to open /opt/box-root-fs/lib/libgcc.a failed
attempt to open /opt/box-root-fs/usr/lib/libgcc.so failed
attempt to open /opt/box-root-fs/usr/lib/libgcc.a failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc.so failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc.a succeeded
attempt to open /opt/box-root-fs/lib/libc.so failed
attempt to open /opt/box-root-fs/lib/libc.a failed
attempt to open /opt/box-root-fs/usr/lib/libc.so failed
attempt to open /opt/box-root-fs/usr/lib/libc.a failed
attempt to open /opt/box-root-fs/usr/local/lib/libc.so failed
attempt to open /opt/box-root-fs/usr/local/lib/libc.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libc.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libc.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libc.so succeeded
opened script file /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libc.so
opened script file /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libc.so
attempt to open /opt/cross/arm-linux-gnueabihf/lib/libc.so.6 succeeded
/opt/cross/arm-linux-gnueabihf/lib/libc.so.6
attempt to open /opt/cross/arm-linux-gnueabihf/lib/libc_nonshared.a succeeded
(/opt/cross/arm-linux-gnueabihf/lib/libc_nonshared.a)elf-init.oS
attempt to open /opt/cross/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 succeeded
/opt/cross/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3
/opt/cross/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3
attempt to open /opt/box-root-fs/lib/libgcc_s.so failed
attempt to open /opt/box-root-fs/lib/libgcc_s.a failed
attempt to open /opt/box-root-fs/usr/lib/libgcc_s.so failed
attempt to open /opt/box-root-fs/usr/lib/libgcc_s.a failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc_s.so failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc_s.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc_s.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc_s.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libgcc_s.so succeeded
opened script file /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libgcc_s.so
opened script file /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libgcc_s.so
attempt to open libgcc_s.so.1 failed
attempt to open /opt/box-root-fs/lib/libgcc_s.so.1 failed
attempt to open /opt/box-root-fs/usr/lib/libgcc_s.so.1 failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc_s.so.1 failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc_s.so.1 failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libgcc_s.so.1 succeeded
libgcc_s.so.1 (/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/libgcc_s.so.1)
attempt to open /opt/box-root-fs/lib/libgcc.so failed
attempt to open /opt/box-root-fs/lib/libgcc.a failed
attempt to open /opt/box-root-fs/usr/lib/libgcc.so failed
attempt to open /opt/box-root-fs/usr/lib/libgcc.a failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc.so failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc.a succeeded
attempt to open /opt/box-root-fs/lib/libgcc.so failed
attempt to open /opt/box-root-fs/lib/libgcc.a failed
attempt to open /opt/box-root-fs/usr/lib/libgcc.so failed
attempt to open /opt/box-root-fs/usr/lib/libgcc.a failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc.so failed
attempt to open /opt/box-root-fs/usr/local/lib/libgcc.a failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc.so failed
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/libgcc.a succeeded
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/crtendS.o succeeded
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/crtendS.o
attempt to open /opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/crtn.o succeeded
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/lib/crtn.o
libgflags.so.2 needed by /opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libglog.so
attempt to open /opt/cross/arm-linux-gnueabihf/lib/libgflags.so.2 failed
attempt to open /opt/cross/arm-linux-gnueabihf/lib/libgflags.so.2 failed
libpthread.so.0 needed by /opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libglog.so
found libpthread.so.0 at /opt/cross/arm-linux-gnueabihf/lib/libpthread.so.0
ld-linux-armhf.so.3 needed by /opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libglog.so
found ld-linux-armhf.so.3 at /opt/cross/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.3.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libgflags.so.2, needed by /opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libglog.so, not found (try using -rpath or -rpath-link)
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libglog.so: undefined reference to `google::FlagRegisterer::FlagRegisterer(char const*, char const*, char const*, char const*, void*, void*)'
Note that the compilation gives problems too, but goes fine if I manually specify in the CMakeLists.txt ${SYSROOT}/usr/include
as an header path.
and I can see the libraries in the correct place:
$ find /opt/box-root-fs/usr/ -name *gflags*
/opt/box-root-fs/usr/include/gflags
/opt/box-root-fs/usr/include/gflags/gflags_completions.h
/opt/box-root-fs/usr/include/gflags/gflags_gflags.h
/opt/box-root-fs/usr/include/gflags/gflags_declare.h
/opt/box-root-fs/usr/include/gflags/gflags.h
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libgflags_nothreads.so
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libgflags_nothreads.so.2
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libgflags_nothreads.a
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libgflags.so
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libgflags.so.2.1.2
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/cmake/gflags
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/cmake/gflags/gflags-config.cmake
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/cmake/gflags/gflags-export.cmake
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/cmake/gflags/gflags-export-release.cmake
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/cmake/gflags/gflags-config-version.cmake
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libgflags_nothreads.so.2.1.2
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libgflags.a
/opt/box-root-fs/usr/lib/arm-linux-gnueabihf/libgflags.so.2
where /opt/box-root-fs
is where I copied the sysroot. As a workaround, I can succesfully compile by manually specifying link_libraries(gflags)
, but I was wondering why GCC stops searching for the libraries, even if they are obviously in the right place? Thanks!
Upvotes: 0
Views: 83