From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29554 invoked from network); 7 Aug 2020 10:46:14 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 7 Aug 2020 10:46:14 -0000 Received: (qmail 13357 invoked by uid 550); 7 Aug 2020 10:46:13 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 13336 invoked from network); 7 Aug 2020 10:46:12 -0000 Date: Fri, 7 Aug 2020 12:46:00 +0200 From: Szabolcs Nagy To: "Gamble, Bradley" Cc: "musl@lists.openwall.com" Message-ID: <20200807104600.GB879655@port70.net> Mail-Followup-To: "Gamble, Bradley" , "musl@lists.openwall.com" References: <1596795338498.26196@ncipher.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1596795338498.26196@ncipher.com> Subject: Re: [musl] Support for PowerPC64 devices lacking AltiVec extentions * Gamble, Bradley [2020-08-07 10:15:38 +0000]: > I was initially encountering exceptions with longjmp()/setjmp() due to the use of lvx/stvx instructions to store and restore vector registers. These vector registers are AltiVec-specific and are not required for devices that do not have the AltiVec extentions, so simply removing them was enough to allow musl to function properly on e5500 devices. > > I initially considered whether a compile-time check in the configure script was possible, however I believe this has to be a run-time check to query whether the processor supports AltiVec extentions and to conditionally store/restore the registers if it does. I see that Arm targets use __hwcap for platform-specific functionality, and in hwcap.h for PowerPC64 there is a "PPC_FEATURE_HAS_ALTIVEC" definition. > > Would this be the correct way to detect this platform-specific behavior? __hwcap is the right check (e.g. used in the arm setjmp) it works if the missing altivec does not affect the call abi of standard c functions (otherwise fixing setjmp/longjmp alone will not help: a separate build of libc is needed targetting your system's call abi).