From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 1CB193898521 for ; Mon, 3 May 2021 06:35:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1CB193898521 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3B1D3AE37; Mon, 3 May 2021 06:35:31 +0000 (UTC) Subject: Re: Hi Tom , May I ask two questions about gdb compiling To: "LV, XIAN" References: <9E8E160C0BCE694BA44854DA190BB1C41FC46B61@CN-EX-MB-002.NCIC.local> Cc: "gdb@sourceware.org" From: Tom de Vries Message-ID: <73b5853e-cc47-6e5b-fc3f-42154bd0773f@suse.de> Date: Mon, 3 May 2021 08:35:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <9E8E160C0BCE694BA44854DA190BB1C41FC46B61@CN-EX-MB-002.NCIC.local> Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 May 2021 06:35:33 -0000 [ CC-ing gdb mailing list ] On 5/3/21 7:26 AM, LV, XIAN wrote: > Dear Tom, > >     Sorry for disturbing. >     Now I try to compile the gdb-10.2 which downloaded from official > website and the compiling is successful. > >>>>./configure --target=aarch64-linux-gnu --host=aarch64-linux-gnu > --build=x86_64-linux-gnu --prefix=/home/rex/gdb-10.2 >>>>make > > But there are two questions: > *1.  How can I modify the path of dynamic interpreter:* > rex@rex-desktop:/project/gdb-10.2/build$ file gdb/gdb > gdb/gdb: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), > dynamically linked, interpreter */lib/ld-linux-aarch64.so.1,* for > GNU/Linux 3.7.0, BuildID[sha1]=1f80eff7276d6bb5ee3482675502770887a210f2, > with debug_info, not stripped > from */lib/ld-linux-aarch64.so.1 to /system/bin/linker64* > Hi, I did the following experiment: ... $ gcc ~/hello.c -g $ ldd ./a.out linux-vdso.so.1 (0x00007ffe353ca000) libc.so.6 => /lib64/libc.so.6 (0x00007f7bebbdb000) /lib64/ld-linux-x86-64.so.2 (0x00007f7bebf96000) $ /lib64/ld-linux-x86-64.so.2 --list ./a.out linux-vdso.so.1 (0x00007ffd02126000) libc.so.6 => /lib64/libc.so.6 (0x00007f88ba87f000) /lib64/ld-linux-x86-64.so.2 (0x00007f88bac3a000) $ /lib64/ld-lsb-x86-64.so.3 --list ./a.out linux-vdso.so.1 (0x00007ffe875fb000) libc.so.6 => /lib64/libc.so.6 (0x00007f6588a61000) /lib64/ld-linux-x86-64.so.2 => /lib64/ld-lsb-x86-64.so.3 (0x00007f6588e1c000) ... So, ISTM that you can override the dynamic linker used by adding it on the command line before the command you're trying to run. > *2. How can I compile the gdb tools with all dynamic library included in > the gdb execution file (Just use the libraries in static way)* > >     Thank you so much. > No idea. It may be possible. OTOH, it may be a better idea to look into concepts like containers, if your actual concern is to be able to package an executable with all its dependencies. [ FWIW, note btw that both your questions are more related to using linux than to gdb itself. So perhaps you'll able to find more or more elaborate answers to your questions in the generic information available for linux. ] Thanks, - Tom