From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from CAN01-YQB-obe.outbound.protection.outlook.com (mail-yqbcan01on2115.outbound.protection.outlook.com [40.107.116.115]) by sourceware.org (Postfix) with ESMTPS id 247A23855591 for ; Tue, 10 Oct 2023 10:28:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 247A23855591 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=geotechairborne.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=geotechairborne.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KHTE9bP4KqkeENbcA+bcwpY2xE3WozsqyNRGPU1+Dmf/ljZ18GeUjebN1NXcbhBRWalF39OP0moZlcz55FOKqhGM6BQHltlwjUTM+g2r6YNjWtQu/f/FSGgJgBJ8JD45y5eIXrZUfkkyuSvBZ2zEATyaocZ3LEgrrSh8lsp0aDFht657aC35VyKpXrgktICFXv/fWfAP6jdLDgv2qj2BX6aSZjhufJohMeL20jKs3+5l4QyyGUlvjQAEW16LmQ0dsai59yVAU7oyI1mY7uFLVqYwMz2VD+uFZy8KPO4ukCvBIboeJH57e+Pj5g0tKu/4Rrydu9mq3wIreSnOdJ986A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Mv2ti8OOKxmC/Gxbu+xhJJUMk8oNufFE67Ed/2zP1rY=; b=QLncdwKBVSxc/NhVsA7yx5P2lj0XP+LVpHe2GVCNPbrjtjS/GjbYnaF6YMKJ8yICBbdog1YxB40lhl7MkDSShYcUem89Gl+ZKG9TNF4hHnL84ZN4vovX1Tee3+QLPtz/O9ddqdB7Xu0xTNZxKS43fvfO/5FAJgNWt0dLDulmSKHRKmFbnWXoDePIWEcuY3Rdw7HT4LUGb6mWK7I9x0BhdF73yVe+9RXh8D00YehXSE/ccZTzPdTnGfuOLTQUAZPUURwL5rfm89TlGVBKrxB5N4c2Mjfg4l7/FqqRAn4noZLOXMllm4b1E/MRbaZ/dtXmXhD/t3FTWFz9Rsg9ziRoiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=geotechairborne.com; dmarc=pass action=none header.from=geotechairborne.com; dkim=pass header.d=geotechairborne.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geotechca.onmicrosoft.com; s=selector1-geotechca-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mv2ti8OOKxmC/Gxbu+xhJJUMk8oNufFE67Ed/2zP1rY=; b=PI2VdHL5Z1uHePx357y0aQwgoCHj6tFdFGUzbdM+Y6sitrFDozPZEOOmERgStMWgADqj1l87Q49pEBF27emIOp75xd5KczgIUcpDXDYDLj4N5rsKQF/xqoJOw05+UAMgnLcYG3k+v2LoFSPETcUqGkDO/uUmF5WtowDq/ImBPSU= Received: from YT2P288MB0073.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:ed::18) by YT2P288MB0170.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:f6::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.38; Tue, 10 Oct 2023 10:28:04 +0000 Received: from YT2P288MB0073.CANP288.PROD.OUTLOOK.COM ([fe80::ef9f:ec99:677b:aa9f]) by YT2P288MB0073.CANP288.PROD.OUTLOOK.COM ([fe80::ef9f:ec99:677b:aa9f%4]) with mapi id 15.20.6863.032; Tue, 10 Oct 2023 10:28:04 +0000 From: Dingjun Chen To: Kai Ruottu , Xi Ruoyao , Jonathan Wakely CC: gcc-help Subject: Re: What caused my executable file not to run on a Linux of old version 2.4.36.1 Thread-Topic: What caused my executable file not to run on a Linux of old version 2.4.36.1 Thread-Index: AQHZ+GFW6G3FsZAplUSi06+H1l8TrbA8/mmAgADdAACAAFQbAIAEplW8 Date: Tue, 10 Oct 2023 10:28:03 +0000 Message-ID: References: <2abfaf68-fe2c-f151-6c7f-14bb1bf8ce03@wippies.com> In-Reply-To: <2abfaf68-fe2c-f151-6c7f-14bb1bf8ce03@wippies.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=geotechairborne.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: YT2P288MB0073:EE_|YT2P288MB0170:EE_ x-ms-office365-filtering-correlation-id: 65cc5a0b-db34-4762-fadd-08dbc97b961d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AC/FCZrMCBn7gEgovAoIf24TEs7DPgg11RnTlRtKoeDZSAGfVETQYKv6z/+9Ct81jW0LYExE9uTNl9iMPa3E2oTEn2PJuXU3V9KR5uFRYzODID9fNnJoOrIE4q6VOSwRz4gHGpfjtEUQJATEFl5iVEc/Agy5ProUjmKyHb9wD2hNKCPzjdKK8psLU6zlFYcyZ1YdN+42QiYhQ1HHr6fH4tQYQlZYq5GRMiqC+ZEwyfrLlk26Iku6HvGsESbeuA0VbK/CVRxrk1TiDqLN1JM7R5kTQQENNMaHGUyWXnOpZaFwwTt3rSaxBk0VePyg0KhnD9onA2woRrnHDGiwSAYRY/Ncz3m8EIJWLYycIvujFPEKERWdhwHxGSkoGoVfTWAxq4otxHo3gvl2mjb/mjcbjgb1WHyVhSO0hn8pP5z8GCAm/VnqC65mwmLhCvGxfSx7XJ1zwmdYicIOC3KuXhbA0lWnL4OSI3USwjlSryoTFfvOwq+9HLGzV6ngJdy9FVzKO7iqGBGn7G/jwedvte3kxeeyOMT/6kCfv3Oe9VlWAbGcFLcU4Vb+yAEKJ7Ma8J7vtYLIselq24PkfR2/HfQTURb4BF28cyxORDeo0AuVYRQztPl/jFyKJDF2p0oW2+M2 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:YT2P288MB0073.CANP288.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(376002)(396003)(39830400003)(346002)(136003)(366004)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(33656002)(9686003)(53546011)(6506007)(7696005)(478600001)(71200400001)(26005)(66574015)(83380400001)(2906002)(5660300002)(76116006)(66446008)(91956017)(110136005)(64756008)(66476007)(66556008)(66946007)(4326008)(8676002)(8936002)(52536014)(316002)(41300700001)(122000001)(55016003)(38070700005)(38100700002)(86362001)(19627405001)(66899024);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?lr85RDI/yz2+g45w0OtEkYzEdNNRBctYxDIhot51guBAs03/yY9rcr0lw1?= =?iso-8859-1?Q?NHEEeLETf2QXeBRUoB6VGLlHezIyQ50i5KxFHcqlhJusFwN6ITnA3WSA++?= =?iso-8859-1?Q?1dhPFkOt9r04VA6v6cIOF8SByBEduCQeGnpSOIxuUQz2uzxkTcB8E4707A?= =?iso-8859-1?Q?RV89+KgBd37E+Th89PEQtkKhioObZjXpsQL0yvi+xsa1lOZcDAOYKOI5y6?= =?iso-8859-1?Q?XwszCduPbo0ngU8YeCCw5bBAHqU+3ceyy3BbgQmyE1v/OwMh7SOIhLeCb0?= =?iso-8859-1?Q?6cQK/5HepKX1HxCYN3QVnnW3wd2JiY/Og9sgJt/hnxSrnR0BhJ3ju8PwwP?= =?iso-8859-1?Q?wBMmEbr85Z5STb7fLF724Cl9facxeZMZ9n16e5VdAu9AuMA117NREc8t2t?= =?iso-8859-1?Q?jtkR4h0u7Z4EDA4iKgjoFIsHaAyRNE8kGVprme3mmSL6zjpUzH03DPXncE?= =?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9lIqub+ZyuRwXNfhh5MFF/G4BoWvlU?= =?iso-8859-1?Q?Pn1apS7CwUUV11kK1BRFiFsNXbFMcwubUhqcGrkjnoqCwaqmGpJE0IfLGw?= =?iso-8859-1?Q?3TEjfvDbb+gMnDsP19ZpM46F8nNKVFZhK9Nz0bqHbaAl7ckG9oTvGXrJr5?= =?iso-8859-1?Q?IV0gPiadxPnNPNg7lt+7ft51NX3wrn2m/aQtcxMpL5GA6fDnePVaZ0MlOd?= =?iso-8859-1?Q?Y7JaJYlntMnJQ7Tb2d/eSzeD5aT/Mmrf0INyUzXo3JrSU405wuT/aZRgrm?= =?iso-8859-1?Q?LaKMC4QQwtaNSvzTdNfq5D6yGufDc3NjEXQ6g0Vxy/t7vXWYr66LZJuw?= =?iso-8859-1?Q?=3D=3D?= Content-Type: multipart/alternative; boundary="_000_YT2P288MB0073A180106966A3D9775AFB97CDAYT2P288MB0073CANP_" MIME-Version: 1.0 X-OriginatorOrg: geotechairborne.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YT2P288MB0073.CANP288.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 65cc5a0b-db34-4762-fadd-08dbc97b961d X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Oct 2023 10:28:03.9255 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: ae2b007c-7c36-48e7-a51a-35d3a71a277c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: P/uCRq+xrMCb+ht/xCfiIXkZbnpQBtpL0LjdEx8Aay7q2pTfbA/SSx3FSkfaTa9m+L2sRuvajfvgRjmShRMbnCt2MqIVXBaSGj+AS+NtSfmxYqvDN/4t6yHVxu7mNm9Y X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT2P288MB0170 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,HTML_MESSAGE,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --_000_YT2P288MB0073A180106966A3D9775AFB97CDAYT2P288MB0073CANP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Ruoyao and Kai, The kernel is too old and Please see errors occurred below. You mentioned "= because the executable may use symbols which don't exist in the old Glibc" = and You are right. How to fix it? By the way, the GNU ld command is 64-bit. However I want to build 32-bit ex= ecutables. dingjun@G02515:~/DAQ_XYZCross2_cmake/build$ objdump -f /usr/bin/ld /usr/bin/ld: file format elf64-x86-64 architecture: i386:x86-64, flags 0x00000150: HAS_SYMS, DYNAMIC, D_PAGED start address 0x0000000000048630 Can I fix such an error with 32-bit ld? Which GNU C/C++ compiler version ca= n offer us a 32-bit ld to link the objects? I look forward to your help! Thanks in advance for your responses! 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: CMakeFiles/vtem_xyz.dir/src/_d_dngl.cc.o: undefined reference = to symbol '_Unwind_Resume@@GCC_3.0' /usr/bin/ld: /home/dingjun/sbc_lib_test/libgcc_s.so.1: error adding symbols= : DSO missing from command line collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/vtem_xyz.dir/build.make:417: ../bin/vtem_xyz] Erro= r 1 make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/vtem_xyz.dir/all] Error 2 make: *** [Makefile:91: all] Error 2 ________________________________ From: Kai Ruottu Sent: Saturday, October 7, 2023 7:19 AM To: Xi Ruoyao ; Jonathan Wakely = ; Dingjun Chen Cc: gcc-help Subject: Re: What caused my executable file not to run on a Linux of old ve= rsion 2.4.36.1 External Email Warning: Do not click any links or open any attachments unle= ss you trust the sender and know the content is safe. From Geotech IT. Xi Ruoyao via Gcc-help kirjoitti 7.10.2023 klo 9.18: > 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 executab= le >>> 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 <= =3D 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. For pure curiosity I checked whether one could create a cross-GCC for some quite old Linux system like CentOS 3.9/i386 for which I still had target headers (including the kernel ones) and libraries in a sysroot. The GCC sources were gcc-11.4.0 and GNU binutils sources were 2.39. The 'usr/include/linux/version.h' seemed to tell the kernel being 2.4.20 in CentOS 3.9/i386. The sysroot inluded also the original native GCC for CentOS 3.9/i386 and it seemed still to run somehow in my uptodate Fedora Linux : [root@fedora bin]# ./i386-redhat-linux-gcc -v Reading specs from ./../lib/gcc-lib/i386-redhat-linux/3.2.3/specs Configured with: ../configure --prefix=3D/usr --mandir=3D/usr/share/man --infodir=3D/usr/share/info --enable-shared --enable-threads=3Dposix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=3Di386-redhat-linux S=E4iemalli: posix gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-60) [root@fedora bin]# uname -a Linux fedora 6.4.6-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 24 20:51:12 UTC 2023 x86_64 GNU/Linux The cross-GCC built almost succeeded with the same configure options I had used for CentOS 6.10/i686. Only producing libsanitizer for the target CentOS 3.9 didn't work so adding '--disable-libsanitizer' was required. Some missing header in 'usr/include/linux' stopped the build in the first try. [root@fedora bin]# i386-centos-linux3.9-gcc-11 -v Using built-in specs. COLLECT_GCC=3Di386-centos-linux3.9-gcc-11 COLLECT_LTO_WRAPPER=3D/run/media/kairuottu/2c439158-ef3e-4dcf-a63b-03191c30= 2829/opt/cross64/bin/../lib/gcc/i386-centos-linux3.9/11.4.0/lto-wrapper Target: i386-centos-linux3.9 Configured with: ../configure --build=3Dx86_64-linux-gnu --host=3Dx86_64-linux-gnu --target=3Di386-centos-linux3.9 --prefix=3D/opt/cross --libdir=3D/opt/cross/lib --libexecdir=3D/opt/cross/l= ib --with-sysroot=3D/opt/host-i386-centos-linux3.9 --enable-languages=3Dc,c++ --enable-shared --enable-threads=3Dposix --enable-__cxa_atexit --enable-checking=3Drelease --disable-nls --disable-libsanitizer --disable-libunwind-exceptions --disable-dssi --disable-plugin --with-tune=3Dgeneric --with-arch=3Di686 --enable-version-specific-runtime-libs --with-gxx-include-dir=3D/opt/cross/include/c++/11.4 --program-prefix=3Di386-centos-linux3.9- --program-suffix=3D-11 Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.4.0 (GCC) --_000_YT2P288MB0073A180106966A3D9775AFB97CDAYT2P288MB0073CANP_--