From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 00BBD3858C00 for ; Sun, 6 Nov 2022 11:41:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 00BBD3858C00 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2A6AIWpX019734; Sun, 6 Nov 2022 11:41:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : references : date : message-id : content-type : mime-version; s=corp-2022-7-12; bh=NeIqduOPadj8F0Z6vVd/Ffggofrbdz/H86a4ngyCXN8=; b=WJ7X3GXHFEHRkRod2Q1phX4X6RTytojY5Evw15vmgGrgXJJ0rqHgIlqhZRLCFv2DRgwp vicoz1s9p3aHvD3h/cp/iFwoOvpmeq76YxAVTKF9vvqEJjS45Zk2AFaQN24htXWf5asN oFE4seF994XwKDSdS5lSWVxRgonr4E7NZleiJJm/doTeLcd+MrJ+/iUVhb4QQIWQI/uL OoOvnfDteb/45cpjYSzFgFaEHqN1YWXBXEftoApFPa+YGGPZOflEjaeianhp8rsT1lJl jHz+4Je7tWToKx0bN9a5hwBjtCWmxgMKfxwfpUhjcqCaOxdgrpWjqc2fZEFM1DE+YRaO Wg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kngkfspj8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 06 Nov 2022 11:41:13 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2A65hm0C035622; Sun, 6 Nov 2022 11:41:13 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kne92j16w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 06 Nov 2022 11:41:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BfiBSn6oSX3f+qd37AHc6WYGpe0zQpn/5Q6X5phlKQm6izI0HnDc290i/9AlUTUAJZmab8UUCmogsKRj9l8tO3+HREtPwOLTDcTipZLm+ub2RL21H2ou6tzybfZ9/hxO5/dXo+aJJFXbA9PGocWgX8xLZnnHTZti9pWADbRy/BqnOJeQ64BjaDOiRuHekJ+x26GFvV0y5mhcV0LJptRwnUMvZ1cf26qnipo4TAjkk8g4bhC7YY3Wid8TWWU1t7UPRfqJdPVVz+ZPVTCOzuBFWZrfTOyklnUXGE9UVbpG4zbNNm/FDiN8uoBS8+dCgKN4sYfxopRBQwRffXOnVkp+2w== 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=NeIqduOPadj8F0Z6vVd/Ffggofrbdz/H86a4ngyCXN8=; b=A4HmTPktfEudbZ5kSpSVqf3l6S6JZ8SKUwtXl0Yeo7k9wJyeAqnArNoY31YFlQcY7Eu+/gPGgWIonTrqhV1kXpRwgq7l47mSh8YM/W6YghZlti7phrs3sUR4YYU9yrO1332hta2tACJqxdrePCcceqF/m1jmqu0lSqrrAIkju9jmiOPMsbo+/2m9Qrmz3bGxm8gDDiGI6K2rcAImMkdKYKHXkfxMFA+EX3Vg++j6/Sps7qBBEqOqZyVvruu30PkPFQs5LSI6XL86KVzYN5pWx25md3JNo4Hlbk8M3suU80JerO0TIMs3UFn6D4fMxYmhq/lsrYU40acISWhz4TJrPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NeIqduOPadj8F0Z6vVd/Ffggofrbdz/H86a4ngyCXN8=; b=SN8MxwANjbAuuTstSUkLUA6O/8MTCI+KMkyFNLzvnfDDSpIn5T95L5YbmIHLzWOz9DpdeRMpd/PabPbAKQgXSos/hPYmwANhFxUKiusHUnfYFtak6tZDboTXiQLcUIsW7o3xAJaXDqEnOZ/GXo3mNkv2b5QSSOVybeKt5di2254= Received: from BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) by BLAPR10MB5025.namprd10.prod.outlook.com (2603:10b6:208:30d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.25; Sun, 6 Nov 2022 11:41:09 +0000 Received: from BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::5095:b148:8def:1049]) by BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::5095:b148:8def:1049%5]) with mapi id 15.20.5791.025; Sun, 6 Nov 2022 11:41:09 +0000 From: "Jose E. Marchesi" To: Simon Marchi Cc: gdb-patches@sourceware.org, indu.bhagat@oracle.com, elena.zannoni@oracle.com Subject: Re: [PATCH V2] gdb: link executables with libtool References: <20221105140233.1197237-1-jose.marchesi@oracle.com> <242f99e5-2c41-155a-3bd9-e0c96dea28f5@simark.ca> Date: Sun, 06 Nov 2022 12:45:09 +0100 Message-ID: <87sfiwfgsa.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: text/plain X-ClientProxiedBy: AS9PR06CA0376.eurprd06.prod.outlook.com (2603:10a6:20b:460::14) To BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB2888:EE_|BLAPR10MB5025:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c02f5bb-3759-48ee-3e1e-08dabfebcc74 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eAK86N5A9Y22dQ/zBTnYz2p83pBdHBXfhfP6aI0vPKJHH12Xn8YEvB51z3X5DO1PxQud5x4uhDyP+Gs/kywKhx1cmnq49/q7D2qv1zvM7mDY4EYNInGQL1oRsMT3DYKZJXDjYEhMgY4wtQsFCoS0YbeWsO+JovSwVi5+5NyBJo0BIx0do8e2UqcSzVaWep1xXezHLIXzXnBwL0eyEGdW1i85LIrA01hKzp9+qa0/P9QVUx6w3aezl7qUzJ+NLwz/Myk1QxGW7R7KilIfKPu1XkQQjuoQh3fL+qfJ1WnZm1E1EBRBkctEJ5X26KAvNJgRYH3NP/xcmQ77NsP8dR+seKk8se/1fGnPBgcnME+8UZly/KSRjPTWROLe3nheASmcPi5qG8Q1TOSgNhNdtSz4fioQ1b8sLb5uTAUt8BrG1Up75Ud0SKTh12UuOjbXAtGcXE8YOWgp72c/KSRRtFLDPMpjVN+g+S3GemZpDsIKk1T5Q272BHJDWeQ8pVns/XOXrdXqj7DGp+Xi/daU8tuPv5K4IUnbgK6DgddK/eoD12voBnAFRBMiXuL1koFcawaEsaNfuwTgwVqXX9Lx0ROBxqd2dZ625dR2XDBlMUjzUR3zdrlZiFujMa00rx0BUFwPwTsBEvAQtk6IV2yeiEgEALj6rVIuOBTPp4CvK0QUZPMfRJfCQAb29Iq5cP3k2SgZ+wiQ39grw45tXYOy5Ycm7VqTqiLicQcJXfHVYdd8HMv5ocNzh+NEOaiVtp+GfFt+ykemgnusRgKVL6DFM7JHHm4uj1aqA/lk25nOnzzfykOThWekzd/QUrhA1YRrrHJNO7qQRHI9QfRgzJsM8ogxBg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB2888.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(346002)(366004)(376002)(396003)(136003)(451199015)(38100700002)(8676002)(36756003)(4326008)(6916009)(316002)(45080400002)(30864003)(2906002)(4001150100001)(5660300002)(66946007)(66556008)(66476007)(8936002)(41300700001)(84970400001)(107886003)(6506007)(83380400001)(53546011)(186003)(2616005)(6512007)(26005)(478600001)(6486002)(86362001)(966005)(21314003)(460985005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?2kZBZZzj0/Cdxxj7vQ47L9jcJCwViEewjucHYRfhUUNN/oUFI1ix/Ib82dHj?= =?us-ascii?Q?EKoxmYBXVyGukGn6NK8Lxw/Pzzyt1RzzlJUh+GeQEq8CvKW5Dmlhbfk6niim?= =?us-ascii?Q?zJdaXYiKGiEtmjCDzP6WEcOIwvxUO28ycBOopTlDC6kh+M+mfQq/SbhEx5GP?= =?us-ascii?Q?j8DTA621KAi7NqqXIlsjn2yhDluFJbErdTCZEHXO0XdX2q9wEZBp+fxtEf8w?= =?us-ascii?Q?/7RGQ1sf6nkF5WqDDvKGqXNeG9hwKbq0rArUxTnRu4BP/9H82nypfgCd8K2Q?= =?us-ascii?Q?2AqN869BEyRbl8/TSdAueHezHpTSMyfNaqQJ+4Dnz15Dh/1bZ3lRrzKyVP6w?= =?us-ascii?Q?bK1vnjv3SDxClb4nbdi8BKBQLKocaenfjz2Gqrk65NnnMQzC2jzAon5GseSW?= =?us-ascii?Q?DvAW5V2gmCaEa1++d98ufR9XGbNEJJndfwZ2fvccZDP/qQ3IfGSWndBDtOoJ?= =?us-ascii?Q?mXrBcPCoWBP1LVs/mpA91ROQMPcNwfQCLz2qacMdQJmjIk10auwha+UE5JU0?= =?us-ascii?Q?+cKfFR6pXiICq2lYQf8qG+1faPaifZhXV5TlrqoNFFyRh3/of46DYJgK9/3z?= =?us-ascii?Q?SPguF9qQHro7TylgtWn9ggTxtN2DOC8ThTQ8YW7e5onGAHRFiGs1e3GG1D1I?= =?us-ascii?Q?xqS2B/VAEROn+N3k1ZWYIj3EQEssIA9Ad9k2dFZ6i8COgNenQU06Nvyg3m+p?= =?us-ascii?Q?4loEiTPaQG8XJIzfHEgMm1PheAVYYiLOwtjSaJj3qcAImQHfg1NLwGW0HBFk?= =?us-ascii?Q?TKZfPnezvvtBUe5KS6TeTjjbcfFUCF3NBULXSmA2KGNJn1uggrNsgHTOPkjh?= =?us-ascii?Q?n3H3c1heH8YHlju0hUrhCBdMnkvKfJvIgkRzysKnOyPhwJeTA4piSUvhmAgp?= =?us-ascii?Q?UOJ1F2fLgO/W/J2ykdHiHQYF5R1v+i4G1xTl6Inx3uHhp6LOv2aqYAfp3zPl?= =?us-ascii?Q?6HOr6yMbtkyn4WpUzwd9DyRTFz8w0IHi3JqsUSzhESAQc2cG1lqkyVkwLS7R?= =?us-ascii?Q?/Lp4WtNjn8scVk1ixnVQcfwkoMmXHkv+VERFcb8Df8CaiADSAHBU6EHLt9pr?= =?us-ascii?Q?Epcb3jrUN8asyO/AFtG1sV3fBm40FYo/4qL+JDoXnJ0+CC1cw62G6oJB9E1u?= =?us-ascii?Q?zXOFArVIKcZCznCYydMNT7U1G8ZtRMyV7AV6oa7fuvgk7JpxbspEPyEQ1Y55?= =?us-ascii?Q?pmMKrCySCqFfFkkFDFad6Xpu09aTy9Wvg+BiA6Trdg9T5Y/gFs9YYYe7FMRg?= =?us-ascii?Q?dhCluj6D4g5NamRdD6m3bL3KdUOAE7y935haBpuywcUCYfGUNV2wbigdbNFj?= =?us-ascii?Q?vUh7sCCebvSbRTygEIUHrFFgnNGKanR/YsGonzJxlVcND35ym2d+XIFOUfzx?= =?us-ascii?Q?D6m70Yae+Q7rrMjUSbxs5uy3kb25L6uKwlZcsWBT+KfbJj+td9T0mmgUdvFN?= =?us-ascii?Q?MoEjd5KtqQQtvOeqFFd++79IOePHLTSIE5QSCjXv345kH93eWEVcf0dDo6SY?= =?us-ascii?Q?bvRELej9KBzNzeLv1M7mz0G+aAV52EXnS1Y+8lefdhgYofwFMrQiF+Lep8Es?= =?us-ascii?Q?DAfKsyfBRmGeNUFQc1LbV3K/kfyX60/Ati4xwRb7KP1v/MCzjhWkhTPBulDl?= =?us-ascii?Q?7w=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c02f5bb-3759-48ee-3e1e-08dabfebcc74 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2888.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2022 11:41:09.6767 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 98kMQqg+BwA+Db8lLHU9HBsnebacxp7fpN7iM3MGhJUwXh28aROFkSNB4IyidegxzZ0TJmbqPV/go9ZUQBtPd5fIUJQ9X+CcXSGNVcarOXM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB5025 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-06_07,2022-11-03_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 phishscore=0 bulkscore=0 suspectscore=0 spamscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211060105 X-Proofpoint-ORIG-GUID: bs2Y54o_QJ0NuXx6Ds1-l-OP-6OCG1q0 X-Proofpoint-GUID: bs2Y54o_QJ0NuXx6Ds1-l-OP-6OCG1q0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > On 11/5/22 10:02, Jose E. Marchesi via Gdb-patches wrote: >> This patch changes the GDB build system in order to use libtool to >> link the several built executables. This makes it possible to refer >> to libtool libraries (.la files) in CLIBS. >> >> As an application of the above, >> >> LIBBFD new refers to ../libbfd/libbfd.la > > new -> now > >> LIBBACKTRACE_LIB now refers to ../libbacktrace/libbacktrace.la >> LIBCTF now refers to ../libctf/libctf.la > > The patch linked in this bug: > > https://sourceware.org/bugzilla/show_bug.cgi?id=29372 > > also updated OPCODES to use $(OPCODES_DIR)/libopcodes.la, should you do > it too? Indeed I should. Thanks for pointing that out :) >> >> NOTE1: The addition of libtool adds a few new configure-time options >> to GDB. Among these, --enable-shared and --disable-shared, >> which were previously ignored. Now GDB shall honor these >> options when linking, picking up the right version of the >> referred libtool libraries automagically. >> >> NOTE2: I have not tested the insight build. >> >> NOTE3: For regenerating configure I used an environment with Autoconf >> 2.69 and Automake 1.15.1. This should match the previously >> used version as announced in the configure script. > > Your patch appears to be missing the changes to gdb/configure, however > the diffstat in your email shows: > > gdb/configure | 31544 ++++++++++++++++++++++++------------ > > When running `autoreconf -f` in the gdb/ directory, I get some changes > that revert your changes to gdb/aclocal.m4, and makes some changes to > gdb/configure. But I don't think my changes are right, because LT_INIT > stays unexpanded in the generated configure. > > Does the method of regenerating the build system change with this patch? > > If I run libtoolize in gdb/, it adds a bunch of .m4 files to > $top_level/config, and then if I run autoreconf, LT_INIT gets properly > expanded. But these .m4 files already exist at the top-level such as > $top_level/libtool.m4, I guess we don't want them twice. Should > gdb/configure.ac be modified to find the existing files? For instance, > this makes it work for me: > > > diff --git a/gdb/configure.ac b/gdb/configure.ac > index 4fd77e485762..12561d4d2de6 100644 > --- a/gdb/configure.ac > +++ b/gdb/configure.ac > @@ -19,7 +19,7 @@ dnl along with this program. If not, see . > dnl Process this file with autoconf to produce a configure script. > > AC_INIT > -AC_CONFIG_MACRO_DIRS([../config]) > +AC_CONFIG_MACRO_DIRS([.. ../config]) > AC_CONFIG_SRCDIR([main.c]) > AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h]) > AM_MAINTAINER_MODE Hmm, the libtool that is in the binutils tree (in the top-level .m4 files, which are macros that generate the actual `libtool' scripts at configure time) is actually: 1) A phantom release 2.2.7a that doesn't exist anyhwere else, or at least I haven't managed to find it. It certainly doesn't exist in ftp.gnu.org nor in alpha.gnu.org. 2) Locally patched. Indeed `autoreconf' runs libtoolize, so to avoid it to install other .m4 files your fix above makes sense. >> NOTE4: Now the installed shared object libbfd.so is used by gdb >> if binutils is installed with --enable-shared. > > Do you mean bfd instead of binutils? Or do you mean binutils in the > sense that bfd is part of binutils? > >> Testing performed: >> >> - --enable-shared and --disable-shared (the default in binutils) work >> as expected: the linked executables link with the archive or shared >> libraries transparently. >> >> - Makefile.in modified for EXEEXT = .exe. It installs the binaries >> just fine. The installed gdb.exe runs fine. >> >> - Native build regtested in x86_64. The installed gdb runs fine. >> >> In the regression testing I'm observing that the following tests >> doesn't seem to be deterministic: >> >> gdb.base/step-over-syscall.exp >> gdb.threads/process-dies-while-detaching.exp >> gdb.threads/process-dies-while-handling-bp.exp >> >> Sometimes some of the the tests in these files unexpectedly fail, >> like in: >> >> -PASS: gdb.threads/process-dies-while-detaching.exp: single-process: \ >> continue: detach: continue >> +FAIL: gdb.threads/process-dies-while-detaching.exp: single-process: \ >> continue: detach: continue >> >> Sometimes they unexpectedly pass: >> >> -KFAIL: gdb.base/step-over-syscall.exp: clone: displaced=on: \ >> check_pc_after_cross_syscall: single step over clone \ >> final pc (PRMS: gdb/19675) >> +PASS: gdb.base/step-over-syscall.exp: clone: displaced=on: \ >> check_pc_after_cross_syscall: single step over clone final pc >> >> -KFAIL: gdb.threads/process-dies-while-handling-bp.exp: \ >> non_stop=on: cond_bp_target=0: inferior 1 exited \ >> (prompt) (PRMS: gdb/18749) >> +PASS: gdb.threads/process-dies-while-handling-bp.exp: \ >> non_stop=on: cond_bp_target=0: inferior 1 exited > > It's unfortunately not the only ones. It's not good, but it's known. Ah ok. I would say it it not bad at all, considering both the size and character of the GDB testsuite. >> - Cross build for aarch64-linux-gnu built to exercise >> program_transform_name and friends. The installed >> aarch64-linux-gnu-gdb runs fine. > > Great, thanks for the details on the testing. > >> >> 2022-11-05 Jose E. Marchesi >> >> * gdb/aclocal.m4: include libtool macros from the top-level >> directory. >> * gdb/Makefile.in (LIBTOOL): Define. >> (CC_LD): Use libtool for linking. >> (install-only): Use libtool for installing GDB$(EXEEXT). >> (install-gdbtk): Likewise for insight$(EXEEXT). >> * gdb/configure.ac: Call LT_INIT. >> Refer to libctf.la and libbacktrace.la. >> * gdb/configure: Regenerate. >> * gdb/testsuite/lib/gdb.exp: Run uninstalled GDB with libtool >> --mode=execute. > > Could you add the git trailer: > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29372 > > ? Will do. > >> --- >> ChangeLog | 15 + > > I don't think you should add gdb changes to the top-level ChangeLog. We > simply don't use ChangeLogs now. Oops, that was Emacs C-x4a. I saw ChangeLog entries in the buffer with reasonably recent entries and assumed it was GDB's. Sorry about that :) > >> gdb/Makefile.in | 12 +- >> gdb/aclocal.m4 | 5 + >> gdb/configure | 31544 ++++++++++++++++++++++++------------ >> gdb/configure.ac | 15 +- >> gdb/testsuite/lib/gdb.exp | 2 +- >> 6 files changed, 21142 insertions(+), 10451 deletions(-) >> >> diff --git a/ChangeLog b/ChangeLog >> index 73c3a006881..fea3f7c6877 100644 >> --- a/ChangeLog >> +++ b/ChangeLog >> @@ -1,3 +1,18 @@ >> +2022-11-05 Jose E. Marchesi >> + >> + * gdb/aclocal.m4: include libtool macros from the top-level >> + directory. >> + * gdb/Makefile.in (LIBTOOL): Define. >> + (CC_LD): Use libtool for linking. >> + (install-only): Use libtool for installing GDB$(EXEEXT). >> + (install-gdbtk): Likewise for insight$(EXEEXT). >> + Use libbfd.la instead of libbfd.a. >> + * gdb/configure.ac: Call LT_INIT. >> + Refer to libctf.la and libbacktrace.la. >> + * gdb/configure: Regenerate. >> + * gdb/testsuite/lib/gdb.exp: Run uninstalled GDB with libtool >> + --mode=execute. >> + >> 2022-10-10 Nick Clifton >> >> * src-release.sh: Add "-r " option to create reproducible >> diff --git a/gdb/Makefile.in b/gdb/Makefile.in >> index c528ee5aa80..b03eedd4d2f 100644 >> --- a/gdb/Makefile.in >> +++ b/gdb/Makefile.in >> @@ -143,10 +143,12 @@ MAKEINFO_CMD = $(MAKEINFO) $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS) >> MAKEHTML = $(MAKEINFO_CMD) --html >> MAKEHTMLFLAGS = >> >> +LIBTOOL = @LIBTOOL@ >> + >> # Set this up with gcc if you have gnu ld and the loader will print out >> # line numbers for undefined references. >> #CC_LD = g++ -static >> -CC_LD = $(CXX) $(CXX_DIALECT) >> +CC_LD = $(LIBTOOL) --mode=link $(CXX) $(CXX_DIALECT) >> >> # Where is our "include" directory? Typically $(srcdir)/../include. >> # This is essentially the header file directory for the library >> @@ -163,7 +165,7 @@ CTF_DEPS = @CTF_DEPS@ >> >> # Where is the BFD library? Typically in ../bfd. >> BFD_DIR = ../bfd >> -BFD = $(BFD_DIR)/libbfd.a >> +BFD = $(BFD_DIR)/libbfd.la >> BFD_SRC = $(srcdir)/$(BFD_DIR) >> BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) >> >> @@ -2017,7 +2019,8 @@ install-only: $(CONFIG_INSTALL) >> true ; \ >> fi ; \ >> $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \ >> - $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) gdb$(EXEEXT) \ >> + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \ >> + gdb$(EXEEXT) \ >> $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \ >> $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(includedir)/gdb ; \ >> $(INSTALL_DATA) jit-reader.h $(DESTDIR)$(includedir)/gdb/jit-reader.h >> @@ -2529,7 +2532,8 @@ install-gdbtk: >> true ; \ >> fi ; \ >> $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir); \ >> - $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) insight$(EXEEXT) \ >> + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \ >> + insight$(EXEEXT) \ >> $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \ >> $(SHELL) $(srcdir)/../mkinstalldirs \ >> $(DESTDIR)$(GDBTK_LIBRARY) ; \ >> diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 >> index 3ed4a58d39f..4aac87b52ed 100644 >> --- a/gdb/aclocal.m4 >> +++ b/gdb/aclocal.m4 >> @@ -212,4 +212,9 @@ m4_include([../config/override.m4]) >> m4_include([../config/pkg.m4]) >> m4_include([../config/plugins.m4]) >> m4_include([../config/tcl.m4]) >> +m4_include([../libtool.m4]) >> +m4_include([../ltoptions.m4]) >> +m4_include([../ltsugar.m4]) >> +m4_include([../ltversion.m4]) >> +m4_include([../lt~obsolete.m4]) >> m4_include([acinclude.m4]) >> diff --git a/gdb/configure.ac b/gdb/configure.ac >> index fceb80e8c9d..4fd77e48576 100644 >> --- a/gdb/configure.ac >> +++ b/gdb/configure.ac >> @@ -46,6 +46,10 @@ ACX_NONCANONICAL_TARGET >> >> AC_ARG_PROGRAM >> >> +# We require libtool to link with the in-tree libtool libraries >> +# the proper way. >> +LT_INIT >> + >> # We require a C++11 compiler. Check if one is available, and if >> # necessary, set CXX_DIALECT to some -std=xxx switch. >> AX_CXX_COMPILE_STDCXX(11, , mandatory) >> @@ -2092,7 +2096,7 @@ AC_ARG_ENABLE([libbacktrace], >> >> if test "${enable_libbacktrace}" = "yes"; then >> LIBBACKTRACE_INC="-I$srcdir/../libbacktrace/ -I../libbacktrace/" >> - LIBBACKTRACE_LIB=../libbacktrace/.libs/libbacktrace.a >> + LIBBACKTRACE_LIB=../libbacktrace/libbacktrace.la >> AC_DEFINE(HAVE_LIBBACKTRACE, 1, [Define if libbacktrace is being used.]) >> else >> LIBBACKTRACE_INC= >> @@ -2151,15 +2155,10 @@ AC_ARG_WITH(xxhash, >> [], [with_xxhash=auto]) >> >> GCC_ENABLE([libctf], [yes], [], [Handle .ctf type-info sections]) >> -if test x${enable_static} = xno; then >> - LIBCTF="-Wl,--rpath,../libctf/.libs ../libctf/.libs/libctf.so" >> - CTF_DEPS="../libctf/.libs/libctf.so" >> -else >> - LIBCTF="../libctf/.libs/libctf.a" >> - CTF_DEPS="$LIBCTF" >> -fi >> if test "${enable_libctf}" = yes; then >> AC_DEFINE(ENABLE_LIBCTF, 1, [Handle .ctf type-info sections]) >> + LIBCTF="../libctf/libctf.la" >> + CTF_DEPS="../libctf/libctf.la" >> else >> LIBCTF= >> CTF_DEPS= >> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp >> index e2cda30b95a..63d57581d13 100644 >> --- a/gdb/testsuite/lib/gdb.exp >> +++ b/gdb/testsuite/lib/gdb.exp >> @@ -154,7 +154,7 @@ global GDB_DATA_DIRECTORY >> global inferior_spawn_id >> >> if [info exists TOOL_EXECUTABLE] { >> - set GDB $TOOL_EXECUTABLE >> + set GDB "libtool --mode=execute $TOOL_EXECUTABLE" > > Can you explain why this is needed? My understanding is that > TOOL_EXECUTABLE can be used to point to an arbitrary gdb executable to > test. If it's a gdb that has been "make install"ed, then libtool > doesn't have to be involved. If pointing to a gdb executable in its > build directory, then "gdb" will be a libtool script that sets all the > right runtime library paths. The only moment I can imagine this would > be useful would be if TOOL_EXECUTABLE consists of a wrapper around > gdb, e.g. "valgrind /path/to/build/gdb". Hm, I actually changed that to see if it would help with the failing tests, since these (related to forking etc) may have been sensible to the fact the libtool wrapper script introduced an additional process in the chain. I agree with you, will remove this thunk from the next version of the patch. Thanks for the review!