From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2043.outbound.protection.outlook.com [40.107.105.43]) by sourceware.org (Postfix) with ESMTPS id B75873857C55 for ; Mon, 3 Jul 2023 09:02:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B75873857C55 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=siemens.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=siemens.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mm5HYhHqfbPGlLiXg9zSLItQV9OAnZrG8FN+0mkSEUp119P97Su82xP3u17JfZUa28XGM5XAY6FQnabzWHUbywUuFgswd/cHZw0YuZbLS2onwRuaFzVJcbb239hgxvvGwQJlzLB36bXhkmtkevIon4iEyB0S/VsbwBF+yf29zlzTxJe47tyPjui+1ATNiJvslGsjprDPHXSnEu6J1kc1IFLs5HfOmaYL1PDH98ieRNJXPPn8RwwCNhWCzCUfme5WRsDOqi9AkdjPOsBa8PgPl7ugW1KVHlANBiRk5LkRLGt1VhI5A7cZgta06/dZgyYxGRdtWe6udxdkB4IcTpe6Pg== 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=auOEMx2QBSbl3El4ICQvxUK497VlKscT61gC+hxzjZQ=; b=FzfA73FpQVKGavTL/kbWaGUzruW9x1I/r7/xjk4TYSp/wpTVs68M1rQhGDT/AmxiJaTufWuLtK0bv6/ZZp2KtdgSfeM0VONp6DaglCbGUgIsEllXedFEnWID4kJgQLhx+P8peQLwCmpJF0VtZdP4UH95Q5mcF1UQcmAcPoy19EggZnFsYv9+vnNnbdePrjkIFrdUx8ZTBV+2vYAIvexufLH9dUKyA1hOZvy4JWug5PeTLRNTcLJBw4CMp4PKYzbbI1/eLXdWtZKlJ6HRgwTQH8Q0kc6dIwYvWIK174gOzrsEzhx4ZOyG5ytszu9YKZuFsNBH6cXEkSqepYXQifFtHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=auOEMx2QBSbl3El4ICQvxUK497VlKscT61gC+hxzjZQ=; b=Ygd6eZUA4z09+zYFOM2E8Iqdm9k1nNdJqCm13/RRF3zE5peY2zTXWCB/Fqf43TTynyJeGaNYP6kVxheaJIzexvtBjAIxkTXdH58Cz0YbeDQUpy5BmdAS7mG1s9Vsx4QhNch0uqmZmFhCXsN1NnF/iNUvHrAVeWsu+noOdFhuqqVdXcjjn1T/HiLswYq7zQrfngJG1uRebyYBq/uOfdywJG/Vm9HTMe8B+nuMilf8/8XFDxkL/9jpnjeNxRtdmVZs8WSBXfQpSbTfyLoo8+AbEylu2KIDPi/hAWnzqWqWGt+jbUhh2wZ+lMEvIaXyrUczakg5GfZGf+GY+QCl+PQNfw== Received: from AM0PR10MB3666.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:15b::23) by GV2PR10MB6718.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:150:b4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 09:02:55 +0000 Received: from AM0PR10MB3666.EURPRD10.PROD.OUTLOOK.COM ([fe80::2d6a:ecc3:3228:41bd]) by AM0PR10MB3666.EURPRD10.PROD.OUTLOOK.COM ([fe80::2d6a:ecc3:3228:41bd%5]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023 09:02:55 +0000 From: "Stubbs, Andrew" To: Wileam Yonatan Phan , Andrew Stubbs , "gcc@gcc.gnu.org" Subject: RE: Clarification on newlib version for building AMDGCN offloading backend Thread-Topic: Clarification on newlib version for building AMDGCN offloading backend Thread-Index: AQHZUGByOGXaA+z51U+nalCHMEkbEK7vdOAAgAAux6mAIpB5WIABA/KAgJFUpgCAA+kQoA== Date: Mon, 3 Jul 2023 09:02:55 +0000 Message-ID: References: <99e77e25-0c83-1087-691d-43530e7395b3@codesourcery.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_Enabled=true; MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_SetDate=2023-07-03T09:02:53Z; MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_Method=Standard; MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_Name=restricted; MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_SiteId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_ActionId=e484f5d2-6e7c-41c9-986c-5f5995a4e3b5; MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_ContentBits=0 document_confidentiality: Restricted authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siemens.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM0PR10MB3666:EE_|GV2PR10MB6718:EE_ x-ms-office365-filtering-correlation-id: b5d718e5-1445-4f97-cecf-08db7ba44a2e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VWXF9LgZAav4Ifvh3NmJ7gNMklRvP3IDcSZ8L+nrrZUuP9GR2vM4TK+FZ5M3xgG6s96qMTcr9pzttmaRuoWrlOae9StI3A3bxLzFQUDDeilHVCjwq35Jq2OBwQuumHkgVuDKliYHxIl/5KIOi2tC+UMtHoWW9LfDfW0zNxBLGCVwC2WaipksvnI+CITnkINOa+KEd5n+v+MohBwFudGCmZipa/Ug9hX5Gnxr0AcueKFWD7k6pz2AgclyCNLctV9kp/O/96SpKf3DsfW2sPXfT6zXHtTgE2Ssj1FeYb+zbP66z3eObiSETsFcrHed3DuhVNU+vqyZpbI9QkN+R+pvi2bJQQop7AKW7Hxlz8UVvnq4mOif0dYbUFRnCx+l8gFRG8K5RCJjdgG9kpYUYcL/2xIgsrIwWd5CV2Grut8ZvdcjJa1OxMrnRmgc+HKBhCdHVl4LxmLyEvzhqfxfJ46htnBXOXYdRAkVwguBFRqdsO4urbNL8Mv+8vUg5J6rLhxWs/cl/NAqyTSdUpob8mJzUJM+h23jpg/ArQ6lpwnVjHysJlON4eJph9h+GYEZxzcWQxvKRNCKCCfMmfwh/Ckbc4kghFGFpSKp0sYYx9dXMxU= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR10MB3666.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(376002)(396003)(346002)(39860400002)(451199021)(38070700005)(2906002)(41300700001)(5660300002)(52536014)(8936002)(8676002)(33656002)(55016003)(86362001)(186003)(82960400001)(478600001)(26005)(6506007)(9686003)(71200400001)(53546011)(7696005)(76116006)(122000001)(316002)(66476007)(64756008)(66446008)(66556008)(66946007)(38100700002)(110136005)(83380400001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?4SfIgpj8l8Fk/HGbqUDsfQXJ3xjFZMaiqs21ymiEGql8RGa2TIJN8dAO4v6S?= =?us-ascii?Q?bypoU3D9RwuOyfZ30i/3eCLKsQoDX4v/Gtn4HhB5Vtj/30Nz5lcdxug/ffGI?= =?us-ascii?Q?AlrgLwTqLCcBI8DtUIQv/o5LmY4RLOA0m6RLwEsuP/rcxo2LBZDqrSjZHn/g?= =?us-ascii?Q?bWSfNKnM+dvSvNd4QqloayzBElTqYULw//ipC94ghpZuJ4jfH35cb9U5DIF4?= =?us-ascii?Q?C4JCRiBGUd9hjAeJcTD8gcQqerZbqoMje+I8tLOn9D4qPjd34vHwJ3qaWMpN?= =?us-ascii?Q?yD822x0z7cHNoveYaOnJWQWXeZkLdy5M2cdXz45BYRqMU0JjLKaE2jY6/8/f?= =?us-ascii?Q?3c2XosCV3oKjotkbVPJO2a4bOHVuwGrCHOKhs7AVS6O2uYKWsHK5vvs19rva?= =?us-ascii?Q?C6s2Ajc84reszbwZb6obsRiyv8VQkK1nT0R/uwIDziCPhR1HiMO//YT5QV/t?= =?us-ascii?Q?qKkONrNIlQt7QL/5RM699F8EiL/WWi3aKKFHKanjszk3QA0htmk09Yz2x3XU?= =?us-ascii?Q?KKxmAbBV8CMk+q9m21iDobbSQAiOUtg0K+HlAWdtLa2iMwbckfENkmZljLvm?= =?us-ascii?Q?hAaLfkeoXyRGlveT3GUB4UnCP2cu1nGpbtVwMBqTNEPgdSOoqiuGMk8CmhPf?= =?us-ascii?Q?SDfD5w8CN5zKSppHGlwLHcskHUn+bPPufabWS0SgziUT/qjvUGHNebEwYJy7?= =?us-ascii?Q?HqvBpSNS7RWkVjCACzKaebcxY9oVNZizXYbEEwxryOJ2eGwouoqri1lDYZpy?= =?us-ascii?Q?LjHA8/+nZXku48nvfEaifWZveR7lNQPqjQYLlt4bTULTCGReBE++poBFVXVi?= =?us-ascii?Q?ZVsOW1xq+iVrKxi4Z8BhPRVIhjuYD6Go381rcNkMjuL4LOE6wnMD84LCSqOL?= =?us-ascii?Q?VvPTarEnRO7EyhDTji00SC0PSwgtH0nfYAogIMiAWR7o2GoI6Gzz7czGf4Rf?= =?us-ascii?Q?Xa3VLKIga7iFifhxOEx/1WGFXg4XSocpQ+qDlsERZGHhoPcOSSLvJWwMrhE6?= =?us-ascii?Q?cq6AysIYghTUUfyvQTnmzILYoepB/p6XKIX8WsR/W5XpkLLbtEPZivVd10Pk?= =?us-ascii?Q?YLN/JWQwVpIHDSd/JfP2srkL7hIPRtX5V3c7gSovARbjVOOXoYLGm/TLBGbm?= =?us-ascii?Q?97FKV/0yDhzmd2JaQ/4uLoigfqdidNXURHmdZTyWHVlayc/29fDv49KBwHsY?= =?us-ascii?Q?/XVKXNK3I91BPC1X7KCKq3f4BC9jndFUX6PpK9cj3QdeeL5mG+PL4wMW4guu?= =?us-ascii?Q?enpEJwvMNkIqNkGptKFUzyzQkl0OmQlNtsl2fE0gqzdqcLZXAnKOV1OXTCPe?= =?us-ascii?Q?Kpyg1VWhFmVNGk83e/a2s83V8NxkuOTZWLguuLMXaFAraq4wibhhxr0Ij5wY?= =?us-ascii?Q?Keiu740njG1cymtr1uB24H+1MyBPRgGyHEpWLpztdmIRzUFpxUbT34C5uTQ0?= =?us-ascii?Q?Ay6aIxk4MIDxCD1ObqvF/PLpm4lmsGyfBjJLHQbeaFHifs8zodi/Sj6TwSZy?= =?us-ascii?Q?6aSH2ZDLiWKkmR0ljnOUtMpIvuy/ayKacmxp2ZsXC5aEcyREPM2/yzpFnzxo?= =?us-ascii?Q?jUbQ+eX0Zof9OiNJjD7TOooN9LmrEWQ4pKpwq5rP?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB3666.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: b5d718e5-1445-4f97-cecf-08db7ba44a2e X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jul 2023 09:02:55.2447 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: n9BGplPdpo3QdWP8BJyRCHO7yWSU5vszaHKzeAmbMkEbEmx9CgOzGF9OIZ92TssiO8h2Q+zJleb7ikaC/ehw20EfMENL/ypSFC4FtAwaRcU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR10MB6718 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: Hi Wil, Our toolchains installations are relocatable, and therefore can't have an r= path hardcoded into them. Instead, we provide instructions in the user manu= al how to set LD_LIBRARY_PATH to pick up the correct libraries. If you're creating OS packages then you could probably add the lib64 direct= ory to the ldcache so it Just Works without any explicit rpath. If you really want to modify the specs, you can do this by patching the gcc= /config/i386/linux-common.h sourcefile to add it to the LINK_SPEC there, or= you can build and install the compiler, run "gcc -dumpspecs", and write th= e edited text to a file named "specs" in the correct install directory. You= 'll want it in the x86_64 compiler directory, not the amdgcn compiler thoug= h, as the dynamic libraries are the host-side implementation, not the GPU s= ide. There might be a configure option too, but I've never investigated that. If= there isn't and you would like to add one, then I expect upstream GCC woul= d be happy to accept a patch. Andrew > -----Original Message----- > From: Wileam Yonatan Phan > Sent: Friday, June 30, 2023 10:06 PM > To: Andrew Stubbs ; gcc@gcc.gnu.org > Subject: Re: Clarification on newlib version for building AMDGCN offloadi= ng > backend > > Hi Andrew, > > Just wanna follow up on the progress of this endeavor of enabling GCC wit= h > AMDGCN offloading in Spack. So far I think I've got everything working, e= xcept > for the part where libgomp is pulled from the wrong place at runtime, bec= ause > Spack prefers using RPATH to LD_LIBRARY_PATH. As outlined in the Spack PR > comments, the proposed fix is modifying the *link_gomp field inside prefix>/lib/gcc/amdgcn-amdhsa//specs to add the rpath flags = for > libgomp. But I'm honestly unsure if this should be done at configure time= , build > time, or install time. > > The Spack PR can be accessed here: > om%2Fspack%2Fspack%2Fpull%2F35919&data=3D05%7C01%7Candrew.stubbs%4 > 0siemens.com%7C673557f0a6c04a52c1c608db79ade602%7C38ae3bcd95794f > d4addab42e1495d55a%7C1%7C0%7C638237560023809014%7CUnknown%7C > TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJ > XVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DUrKryjKfE6uH7tJR4jNbSfK4AfnTR > %2FeJg3tiKgR8LeQ%3D&reserved=3D0> > > Please advise, > Wil > > From: Andrew Stubbs > Sent: Thursday, March 30, 2023 04:45 > To: Wileam Yonatan Phan ; gcc@gcc.gnu.org > > Subject: Re: Clarification on newlib version for building AMDGCN offloadi= ng > backend > > On 29/03/2023 19:18, Wileam Yonatan Phan wrote: > > Hi Andrew, > > > > I just built GCC 12.2.0 with AMDGCN offloading successfully with Spack! > > However, when I tried to test it with an OpenACC test code that I have,= I > encountered the following error message: > > > > wyp@basecamp:~/work/testcodes/f90-acc-ddot$ gfortran -fopenacc > > -foffload=3Damdgcn-unknown-amdhsa=3D"-march=3Dgfx900" ddot.f90 > > as: unrecognized option '-triple=3Damdgcn--amdhsa' > > mkoffload: fatal error: > > x86_64-pc-linux-gnu-accel-amdgcn-unknown-amdhsa-gcc returned 1 exit > status compilation terminated. > > lto-wrapper: fatal error: > > /home/wyp/work/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-12.2.0/gcc- > 12.2.0-w7lclfarefmge3uegn2a5vw37bnwhwto/libexec/gcc/x86_64-pc-linux- > gnu/12.2.0//accel/amdgcn-unknown-amdhsa/mkoffload returned 1 exit status > compilation terminated. > > /usr/bin/ld: error: lto-wrapper failed > > collect2: error: ld returned 1 exit status > > My guess is that it's trying to use the wrong assembler. Usually this mea= ns > there is a problem with your installation procedure and/or your PATH. I t= hink > you should be able to investigate further using -v and/or strace. The cor= rect one > should be named $DESTDIR/usr/local/amdgcn-amdhsa/bin/as, but this will be > different if you configured GCC with a custom --prefix location. If you h= ave > relocated the toolchain since installation then the toolchain will attemp= t to > locate libraries and tools relative to the gcc binary. If it does not fin= d them there > then it looks in the "usual places", and those usually contain an "as" su= itable > only for the host system. > > If you find an error on the Wiki instructions please let me know and I wi= ll > correct them. > > Andrew