zsim
zsim copied to clipboard
compilation issue
hi despite the fact the correct path of libstdc++ is given, im facing linking error! can you please help?
[amk7371@e5-cse-204-01 zsim]$ scons-3 -j16
scons: Reading SConscript files ...
Building opt zsim at build/opt
Checking for C library hdf5... (cached) no
Checking for C library hdf5_serial... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/opt/fftoggle -Wl,-R/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib --static build/opt/fftoggle.o build/opt/config.o build/opt/galloc.o build/opt/log.o build/opt/pin_cmd.o -L/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib -L/home/mdl/amk7371/CSE530/hdf5-1.8.22/lib -lconfig++ -lpthread
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
g++ -o build/opt/libzsim.so -Wl,-R/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib -Wl,--hash-style=sysv -Wl,-Bsymbolic -Wl,--version-script=/home/mdl/amk7371/CSE530/pin-2.14-71313-gcc.4.4.7-linux/source/include/pin/pintool.ver -shared build/opt/decoder.os build/opt/network.os build/opt/text_stats.os build/opt/virt/cpu.os build/opt/cache_arrays.os build/opt/null_core.os build/opt/ooo_core.os build/opt/parse_vdso.os build/opt/zsim.os build/opt/pin_cmd.os build/opt/contention_sim.os build/opt/virt/time.os build/opt/stats_filter.os build/opt/ddr_mem.os build/opt/process_tree.os build/opt/detailed_mem.os build/opt/scheduler.os build/opt/trace_driver.os build/opt/hdf5_stats.os build/opt/virt/timeout.os build/opt/mem_ctrls.os build/opt/virt/fs.os build/opt/hash.os build/opt/utility_monitor.os build/opt/config.os build/opt/virt/syscall_name.os build/opt/proc_stats.os build/opt/cache.os build/opt/log.os build/opt/timing_cache.os build/opt/prefetcher.os build/opt/process_stats.os build/opt/virt/virt.os build/opt/access_tracing.os build/opt/coherence_ctrls.os build/opt/init.os build/opt/tracing_cache.os build/opt/lookahead.os build/opt/ooo_core_recorder.os build/opt/simple_core.os build/opt/timing_core.os build/opt/detailed_mem_params.os build/opt/debug_zsim.os build/opt/memory_hierarchy.os build/opt/timing_event.os build/opt/core_recorder.os build/opt/galloc.os build/opt/virt/ports.os build/opt/monitor.os build/opt/partition_mapper.os build/opt/dramsim_mem_ctrl.os -L/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib -L/home/mdl/amk7371/CSE530/hdf5-1.8.22/lib -L/usr/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/gcc/x86_64-redhat-linux/4.8.2 -L/usr/lib/x86_64-redhat-linux6E/lib -L/home/mdl/amk7371/CSE530/pin-2.14-71313-gcc.4.4.7-linux/extras/xed-intel64/lib -L/home/mdl/amk7371/CSE530/pin-2.14-71313-gcc.4.4.7-linux/intel64/lib -L/home/mdl/amk7371/CSE530/pin-2.14-71313-gcc.4.4.7-linux/intel64/lib-ext -lconfig++ -lpin -lxed -lpindwarf -lelf -ldl -lrt -lhdf5 -lhdf5_hl
printf "#define ZSIM_BUILDDATE "date
"\n#define ZSIM_BUILDVERSION "python misc/gitver.py
"" >>build/opt/version.h
scons: *** [build/opt/fftoggle] Error 1
/usr/bin/ld: skipping incompatible /usr/lib/libdl.so when searching for -ldl
/usr/bin/ld: skipping incompatible /usr/lib/libdl.a when searching for -ldl
/usr/bin/ld: skipping incompatible /usr/lib/librt.so when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/librt.a when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
scons: building terminated because of errors.
[amk7371@e5-cse-204-01 zsim]$ ls /usr/lib/gcc/x86_64-redhat-linux/4.8.2/
32/ crtendS.o finclude/ libatomic.so libgcc_s.so@ libgomp.a libquadmath.so
crtbegin.o crtfastmath.o include/ libcaf_single.a libgcov.a libgomp.so@ libstdc++.so@
crtbeginS.o crtprec32.o libasan_preinit.o libcloog-isl.so.4* libgfortranbegin.a libgomp.spec libtsan.so
crtbeginT.o crtprec64.o libasan.so libgcc.a libgfortran.so@ libitm.so rpmver
crtend.o crtprec80.o libatomic.a libgcc_eh.a libgfortran.spec libitm.spec
[amk7371@e5-cse-204-01 zsim]$ ls -la /usr/lib/gcc/x86_64-redhat-linux/4.8.2/libstdc++.so
lrwxrwxrwx 1 root root 37 Sep 20 2019 /usr/lib/gcc/x86_64-redhat-linux/4.8.2/libstdc++.so -> ../../../../lib64/libstdc++.so.6.0.19
[amk7371@e5-cse-204-01 zsim]$
can someone please help?
Your linker can't find the library file. Follow this.
HI Mohammad,
Thank you so much for replying. However it doesnt solve my issue. And interesting part is when i run ld from commandline alone it works. I'm using g++ version of 4.8.5
[amk7371@e5-cse-204-01 zsim]$ g++ -o build/opt/fftoggle -Wl,-R/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib --static build/opt/fftoggle.o build/opt/config.o build/opt/galloc.o build/opt/log.o build/opt/pin_cmd.o -L/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/ -L/home/mdl/amk7371/CSE530/hdf5-1.8.22/lib -lconfig++ -lpthread --verbose Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/:/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/:/usr/lib/gcc/x86_64-redhat-linux/ LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.8.5/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-o' 'build/opt/fftoggle' '-static' '-L/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib' '-L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/' '-L/home/mdl/amk7371/CSE530/hdf5-1.8.22/lib' '-v' '-mtune=generic' '-march=x86-64' /usr/libexec/gcc/x86_64-redhat-linux/4.8.5/collect2 --build-id --no-add-needed --hash-style=gnu -m elf_x86_64 -static -o build/opt/fftoggle /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o -L/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/ -L/home/mdl/amk7371/CSE530/hdf5-1.8.22/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../.. -R/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib build/opt/fftoggle.o build/opt/config.o build/opt/galloc.o build/opt/log.o build/opt/pin_cmd.o -lconfig++ -lpthread -lstdc++ -lm --start-group -lgcc -lgcc_eh -lc --end-group /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crtn.o /usr/bin/ld: cannot find -lstdc++ collect2: error: ld returned 1 exit status
[amk7371@e5-cse-204-01 zsim]$ ld -lstdc++ --verbose GNU ld version 2.27-44.base.el7 Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om using internal linker script:
/* Script for -z combreloc: combine and sort reloc sections / / Copyright (C) 2014-2016 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("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") OUTPUT_ARCH(i386:x86-64) ENTRY(_start) SEARCH_DIR("=/usr/x86_64-redhat-linux/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/x86_64-redhat-linux/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SECTIONS { / Read-only sections, merged into text segment: / PROVIDE (_executable_start = SEGMENT_START("text-segment", 0x400000)); . = SEGMENT_START("text-segment", 0x400000) + 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) } .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.) (.rela.ldata .rela.ldata. .rela.gnu.linkonce.l.) (.rela.lbss .rela.lbss. .rela.gnu.linkonce.lb.) (.rela.lrodata .rela.lrodata. .rela.gnu.linkonce.lr.) (.rela.ifunc) } .rela.plt : { (.rela.plt) PROVIDE_HIDDEN (__rela_iplt_start = .); (.rela.iplt) PROVIDE_HIDDEN (__rela_iplt_end = .); } .init : { KEEP ((SORT_NONE(.init))) } .plt : { (.plt) (.iplt) } .plt.got : { (.plt.got) } .plt.bnd : { (.plt.bnd) } .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) } .fini : { KEEP ((SORT_NONE(.fini))) } PROVIDE (__etext = .); PROVIDE (_etext = .); PROVIDE (etext = .); .rodata : { (.rodata .rodata. .gnu.linkonce.r.) } .rodata1 : { (.rodata1) } .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) } .got : { *(.got) *(.igot) } . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 24 ? 24 : 0, .); .got.plt : { *(.got.plt) (.igot.plt) } .data : { (.data .data. .gnu.linkonce.d.) SORT(CONSTRUCTORS) } .data1 : { (.data1) } _edata = .; PROVIDE (edata = .); . = .; __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 ? 64 / 8 : 1); } .lbss : { (.dynlbss) (.lbss .lbss. .gnu.linkonce.lb.) (LARGE_COMMON) } . = ALIGN(64 / 8); . = SEGMENT_START("ldata-segment", .); .lrodata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) : { (.lrodata .lrodata. .gnu.linkonce.lr.) } .ldata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) : { (.ldata .ldata. .gnu.linkonce.l.) . = ALIGN(. != 0 ? 64 / 8 : 1); } . = ALIGN(64 / 8); _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) } .gnu.attributes 0 : { KEEP ((.gnu.attributes)) } /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto) } }
================================================== attempt to open //usr/x86_64-redhat-linux/lib64/libstdc++.so failed attempt to open //usr/x86_64-redhat-linux/lib64/libstdc++.a failed attempt to open //usr/lib64/libstdc++.so succeeded -lstdc++ (//usr/lib64/libstdc++.so) libm.so.6 needed by //usr/lib64/libstdc++.so found libm.so.6 at //usr/lib64/libm.so.6 libc.so.6 needed by //usr/lib64/libstdc++.so found libc.so.6 at //usr/lib64/libc.so.6 ld-linux-x86-64.so.2 needed by //usr/lib64/libstdc++.so found ld-linux-x86-64.so.2 at //usr/lib64/ld-linux-x86-64.so.2 libgcc_s.so.1 needed by //usr/lib64/libstdc++.so found libgcc_s.so.1 at //usr/lib64/libgcc_s.so.1 ld: warning: cannot find entry symbol _start; not setting start address
Warm Regards, Abhijeet
From: Mohammad Bakhshalipour [email protected] Sent: Thursday, March 4, 2021 5:50 AM To: s5z/zsim [email protected] Cc: abhijeeetkumar [email protected]; Author [email protected] Subject: Re: [s5z/zsim] compilation issue (#247)
Your linker can't find the library file. Follow thishttps://stackoverflow.com/a/21647591/14088252.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/s5z/zsim/issues/247#issuecomment-790181081, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADHOMKGIGMEJYVBLWOPQWKDTB3G4PANCNFSM4YKMOZ4Q.
it seems like it is looking for static library (default behavior, *.a) , i removed the --static (from src/SConscript) from the LDFLAGS and it seems to be working now. thank you so much for help. 🙂
From: abhijeet kumar [email protected] Sent: Wednesday, March 10, 2021 3:19 AM To: s5z/zsim [email protected]; s5z/zsim [email protected] Cc: Author [email protected] Subject: Re: [s5z/zsim] compilation issue (#247)
HI Mohammad,
Thank you so much for replying. However it doesnt solve my issue. And interesting part is when i run ld from commandline alone it works. I'm using g++ version of 4.8.5
[amk7371@e5-cse-204-01 zsim]$ g++ -o build/opt/fftoggle -Wl,-R/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib --static build/opt/fftoggle.o build/opt/config.o build/opt/galloc.o build/opt/log.o build/opt/pin_cmd.o -L/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/ -L/home/mdl/amk7371/CSE530/hdf5-1.8.22/lib -lconfig++ -lpthread --verbose Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/:/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/:/usr/lib/gcc/x86_64-redhat-linux/ LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.8.5/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-o' 'build/opt/fftoggle' '-static' '-L/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib' '-L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/' '-L/home/mdl/amk7371/CSE530/hdf5-1.8.22/lib' '-v' '-mtune=generic' '-march=x86-64' /usr/libexec/gcc/x86_64-redhat-linux/4.8.5/collect2 --build-id --no-add-needed --hash-style=gnu -m elf_x86_64 -static -o build/opt/fftoggle /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o -L/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/ -L/home/mdl/amk7371/CSE530/hdf5-1.8.22/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../.. -R/home/mdl/amk7371/CSE530/libconfig-1.7.2/build/lib build/opt/fftoggle.o build/opt/config.o build/opt/galloc.o build/opt/log.o build/opt/pin_cmd.o -lconfig++ -lpthread -lstdc++ -lm --start-group -lgcc -lgcc_eh -lc --end-group /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crtn.o /usr/bin/ld: cannot find -lstdc++ collect2: error: ld returned 1 exit status
[amk7371@e5-cse-204-01 zsim]$ ld -lstdc++ --verbose GNU ld version 2.27-44.base.el7 Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om using internal linker script:
/* Script for -z combreloc: combine and sort reloc sections / / Copyright (C) 2014-2016 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("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") OUTPUT_ARCH(i386:x86-64) ENTRY(_start) SEARCH_DIR("=/usr/x86_64-redhat-linux/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/x86_64-redhat-linux/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SECTIONS { / Read-only sections, merged into text segment: / PROVIDE (_executable_start = SEGMENT_START("text-segment", 0x400000)); . = SEGMENT_START("text-segment", 0x400000) + 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) } .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.) (.rela.ldata .rela.ldata. .rela.gnu.linkonce.l.) (.rela.lbss .rela.lbss. .rela.gnu.linkonce.lb.) (.rela.lrodata .rela.lrodata. .rela.gnu.linkonce.lr.) (.rela.ifunc) } .rela.plt : { (.rela.plt) PROVIDE_HIDDEN (__rela_iplt_start = .); (.rela.iplt) PROVIDE_HIDDEN (__rela_iplt_end = .); } .init : { KEEP ((SORT_NONE(.init))) } .plt : { (.plt) (.iplt) } .plt.got : { (.plt.got) } .plt.bnd : { (.plt.bnd) } .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) } .fini : { KEEP ((SORT_NONE(.fini))) } PROVIDE (__etext = .); PROVIDE (_etext = .); PROVIDE (etext = .); .rodata : { (.rodata .rodata. .gnu.linkonce.r.) } .rodata1 : { (.rodata1) } .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) } .got : { *(.got) *(.igot) } . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 24 ? 24 : 0, .); .got.plt : { *(.got.plt) (.igot.plt) } .data : { (.data .data. .gnu.linkonce.d.) SORT(CONSTRUCTORS) } .data1 : { (.data1) } _edata = .; PROVIDE (edata = .); . = .; __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 ? 64 / 8 : 1); } .lbss : { (.dynlbss) (.lbss .lbss. .gnu.linkonce.lb.) (LARGE_COMMON) } . = ALIGN(64 / 8); . = SEGMENT_START("ldata-segment", .); .lrodata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) : { (.lrodata .lrodata. .gnu.linkonce.lr.) } .ldata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) : { (.ldata .ldata. .gnu.linkonce.l.) . = ALIGN(. != 0 ? 64 / 8 : 1); } . = ALIGN(64 / 8); _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) } .gnu.attributes 0 : { KEEP ((.gnu.attributes)) } /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto) } }
================================================== attempt to open //usr/x86_64-redhat-linux/lib64/libstdc++.so failed attempt to open //usr/x86_64-redhat-linux/lib64/libstdc++.a failed attempt to open //usr/lib64/libstdc++.so succeeded -lstdc++ (//usr/lib64/libstdc++.so) libm.so.6 needed by //usr/lib64/libstdc++.so found libm.so.6 at //usr/lib64/libm.so.6 libc.so.6 needed by //usr/lib64/libstdc++.so found libc.so.6 at //usr/lib64/libc.so.6 ld-linux-x86-64.so.2 needed by //usr/lib64/libstdc++.so found ld-linux-x86-64.so.2 at //usr/lib64/ld-linux-x86-64.so.2 libgcc_s.so.1 needed by //usr/lib64/libstdc++.so found libgcc_s.so.1 at //usr/lib64/libgcc_s.so.1 ld: warning: cannot find entry symbol _start; not setting start address
Warm Regards, Abhijeet
From: Mohammad Bakhshalipour [email protected] Sent: Thursday, March 4, 2021 5:50 AM To: s5z/zsim [email protected] Cc: abhijeeetkumar [email protected]; Author [email protected] Subject: Re: [s5z/zsim] compilation issue (#247)
Your linker can't find the library file. Follow thishttps://stackoverflow.com/a/21647591/14088252.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/s5z/zsim/issues/247#issuecomment-790181081, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADHOMKGIGMEJYVBLWOPQWKDTB3G4PANCNFSM4YKMOZ4Q.
i tried sample test. but i get lot of undefined symbols (??) from the stack trace output. is it expected? external dependencies versions are pin-2.14-71313-gcc.4.4.7-linux, libconfig-1.7.2 and hdf5-1.8.22
[amk7371@e5-cse-204-01 zsim]$ ./build/opt/zsim tests/simple.cfg [H] Starting zsim, built Tue Mar 9 17:01:55 EST 2021 (rev master:113:2aea90e:2fc 13+ 9- 4fc4325d) [H] Creating global segment, 1024 MBs [H] Global segment shmid = 3637307 [H] Deadlock detection ON A: Source/pin/injector_nonmac/auxvector.cpp: CopyAux: 291: unexpected AUX VEC type 26
################################################################################
STACK TRACE
################################################################################ addr2line -C -f -e "/home/mdl/amk7371/CSE530/pin-2.14-71313-gcc.4.4.7-linux/intel64/bin/pinbin" 0x5555557147f9 0x5555557155ce 0x5555557158a0 0x555555937b3c 0x55555593d2ff 0x55555593ee2d 0x55555592efe1 0x555555933b2d 0x55555592422e 0x55555592e230 0x7ffff700b555 0x55555570917a A: Source/pin/injector_nonmac/auxvector.cpp: CopyAux: 291: unexpected AUX VEC type 26
################################################################################
STACK TRACE
################################################################################ addr2line -C -f -e "/home/mdl/amk7371/CSE530/pin-2.14-71313-gcc.4.4.7-linux/intel64/bin/pinbin" 0x5555557147f9 0x5555557155ce 0x5555557158a0 0x555555937b3c 0x55555593d2ff 0x55555593ee2d 0x55555592efe1 0x555555933b2d 0x55555592422e 0x55555592e230 0x7ffff700b555 0x55555570917a ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? Detach Service Count: 1 ??:0 ?? ??:0 ?? ??:0 ?? ??:0 Pin 2.14 Copyright (c) 2003-2015, Intel Corporation. All rights reserved. @CHARM-VERSION: $Rev: 71293 $ @CHARM-BUILDER: BUILDER @CHARM-COMPILER: gcc 4.4.7 @CHARM-TARGET: ia32e @CHARM-CFLAGS: OPTIMIZE=1 NO_INLINE=NO_INLINE ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 ?? ??:0 Detach Service Count: 1 Pin 2.14 Copyright (c) 2003-2015, Intel Corporation. All rights reserved. @CHARM-VERSION: $Rev: 71293 $ @CHARM-BUILDER: BUILDER @CHARM-COMPILER: gcc 4.4.7 @CHARM-TARGET: ia32e @CHARM-CFLAGS: OPTIMIZE=1 NO_INLINE=NO_INLINE C: Injector exited with signal 6 E: Wait for injector failed: No child processes C: Injector exited with signal 6 E: Wait for injector failed: No child processes [H] Child 14776 done [H] Child 14775 done [H] All children done, exiting
Duplicate of #228
A workaround is to add args.push_back("-ifeellucky");
near line 80 where there're a lot of arg pushes.