Hi, guys, Right now the linked errors occurred have changed into the following case. Could someone tell me how to fix such errors? Thanks and regards, Dingjun .............................................. [ 90%] Building CXX object CMakeFiles/vtem_xyz.dir/src/serialmsg.cc.o [ 95%] Building CXX object CMakeFiles/vtem_xyz.dir/src/simulant.cc.o [100%] Linking CXX executable ../bin/vtem_xyz /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../librtd-dm6620.a: warning: relocation in read-only section `.text' /usr/bin/ld: CMakeFiles/vtem_xyz.dir/src/Vtem24.cc.o: in function `main': Vtem24.cc:(.text+0x34b): undefined reference to `__stack_chk_fail_local' /usr/bin/ld: CMakeFiles/vtem_xyz.dir/src/_d_dngl.cc.o: in function `dongle_interface::Initialize(char const*, long, int, int, int, unsigned char (&) [8])': _d_dngl.cc:(.text+0x1d5): undefined reference to `__stack_chk_fail_local' /usr/bin/ld: CMakeFiles/vtem_xyz.dir/src/_d_dngl.cc.o: in function `dongle_interface::Transform()': _d_dngl.cc:(.text+0x3e8): undefined reference to `__stack_chk_fail_local' /usr/bin/ld: CMakeFiles/vtem_xyz.dir/src/_d_dngl.cc.o: in function `dongle_interface::SendCommand(unsigned char (&) [2], unsigned char (&) [8], unsigned char (&) [8], unsigned char (&) [16])': _d_dngl.cc:(.text+0x52a): undefined reference to `__stack_chk_fail_local' /usr/bin/ld: CMakeFiles/vtem_xyz.dir/src/_d_dngl.cc.o: in function `dongle_interface::ReceiveResponse(unsigned char (&) [2], unsigned char (&) [2], unsigned char (&) [8], unsigned char (&) [8], unsigned char (&) [16], unsigned char (&) [16])': _d_dngl.cc:(.text+0x803): undefined reference to `__stack_chk_fail_local' /usr/bin/ld: CMakeFiles/vtem_xyz.dir/src/_d_dngl.cc.o:_d_dngl.cc:(.text+0x8ea): more undefined references to `__stack_chk_fail_local' follow /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/32/libstdc++.so: undefined reference to `__mbsnrtowcs_chk@GLIBC_2.4' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/32/libstdc++.so: undefined reference to `stat64@GLIBC_2.33' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/32/libstdc++.so: undefined reference to `fstat64@GLIBC_2.33' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/32/libstdc++.so: undefined reference to `__wmemcpy_chk@GLIBC_2.4' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/32/libstdc++.so: undefined reference to `__ctzdi2@GCC_3.4' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/32/libstdc++.so: undefined reference to `utimensat@GLIBC_2.6' /usr/bin/ld: ../bin/vtem_xyz: hidden symbol `__stack_chk_fail_local' isn't defined /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/vtem_xyz.dir/build.make:417: ../bin/vtem_xyz] Error 1 make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/vtem_xyz.dir/all] Error 2 make: *** [Makefile:91: all] Error 2 ________________________________ From: Xi Ruoyao Sent: Saturday, October 7, 2023 2:18 AM To: Jonathan Wakely ; Dingjun Chen Cc: gcc-help Subject: Re: What caused my executable file not to run on a Linux of old version 2.4.36.1 External Email Warning: Do not click any links or open any attachments unless you trust the sender and know the content is safe. From Geotech IT. On Fri, 2023-10-06 at 18:07 +0100, Jonathan Wakely via Gcc-help wrote: > > However, the executable file: vtem_xyz cannot run on RTD single board > > computer with Linux 2.4.36.1 2009, i686. > > All shared .so libraries are under the same directory with the executable > > file: vtem_xyz. I am wondering what's wrong with it. > > > > > You haven't told us what happens, so we can't help you. What does "cannot > run" mean? What happens when you try to run it? Linux 2.4.36.1? Really? The recent Glibc releases needs Linux kernel >= 3.2. So if you copy the Glibc from the host system (or statically link it into the executable) it won't work because the kernel version is too low. If you just link the executable dynamically with host Glibc but attempt to run it with the Glibc on your target board it won't work too because the executable may use symbols which don't exist in the old Glibc. Running Linux 2.4.36.1 is just wrong in 2023 (it was already wrong even in 2013). > Do you have any suggestions when building an executable file running > under a Linux of old version? Build a cross compiler and use the root FS of the target board as the sysroot. But again it's just wrong to run Linux 2.4 today, so you'll likely encounter problems here or there. And it's very difficult to find any support because nobody wants to install something based on Linux 2.4 and reproduce the problem for you, in 2023. Try upgrade the software stack for the target board. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University