From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id DC8FF385842B for ; Thu, 30 Mar 2023 08:45:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC8FF385842B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.98,303,1673942400"; d="scan'208";a="980572" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 30 Mar 2023 00:45:56 -0800 IronPort-SDR: wwKV7nPSSUOBInZLclMiEFmmkF7K5Kh+IxXdIm6XcQBRA9P33m8bmPoWI3WnWndOTwnnRVIwgb 4yRvDAcaUoK6BRbftN7JNDndOn1NG5mybcPGCUTyy1Qtksz845mGMom72BH4h+Hi8+5NUrB7Zv hw3KieUeASCr3YTfdQ3IbvX9ILVK8sIfMiC4JTh+EiY5Vb4lzhPkxCSoqLIgziYoihlhxHNbOg oEX1ONc1SSKNrFNDWYMJM18Qm7yNk1XqSa/G7UrOS/GZdlbSvc8o9GPC74AW4DZb2LmVoMAqGu SeM= Message-ID: Date: Thu, 30 Mar 2023 09:45:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: Clarification on newlib version for building AMDGCN offloading backend To: Wileam Yonatan Phan , "gcc@gcc.gnu.org" References: <99e77e25-0c83-1087-691d-43530e7395b3@codesourcery.com> Content-Language: en-GB From: Andrew Stubbs In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,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: 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=amdgcn-unknown-amdhsa="-march=gfx900" ddot.f90 > as: unrecognized option '-triple=amdgcn--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 means there is a problem with your installation procedure and/or your PATH. I think you should be able to investigate further using -v and/or strace. The correct 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 have relocated the toolchain since installation then the toolchain will attempt to locate libraries and tools relative to the gcc binary. If it does not find them there then it looks in the "usual places", and those usually contain an "as" suitable only for the host system. If you find an error on the Wiki instructions please let me know and I will correct them. Andrew