From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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.2 Received: (qmail 5990 invoked from network); 23 Apr 2020 02:33:11 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with UTF8ESMTPZ; 23 Apr 2020 02:33:11 -0000 Received: (qmail 24546 invoked by uid 550); 23 Apr 2020 02:33:08 -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 24525 invoked from network); 23 Apr 2020 02:33:08 -0000 Date: Wed, 22 Apr 2020 22:32:55 -0400 From: Rich Felker To: Tom Storey Cc: musl@lists.openwall.com Message-ID: <20200423023255.GO11469@brightrain.aerifal.cx> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Building for m68k On Thu, Apr 23, 2020 at 12:05:27PM +1000, Tom Storey wrote: > Hi all. > > Is anyone out there particularly familiar with building musl for the m68k? > > I was able to successfully build it, but then later discovered that it > would appear to be targeting 68020+ processors more specifically. I would > like to build for the earlier 680[01]0's. > > Specific examples are to do with (at least) aio where some atomic > instructions are used (e.g. cas - compare and swap) which only exist for > the 68020 and later, but not for earlier processors. > > https://git.musl-libc.org/cgit/musl/tree/src/aio/aio.c#n375 > https://git.musl-libc.org/cgit/musl/tree/arch/m68k/atomic_arch.h > > Thus, adding -m68000 to the CFLAGS env variable when trying to do a rebuild > results in a failure complaining that the 68020+ is required. I dont know > what else is hiding away in the rest of it that will also be > incompatible... :-) > > Any suggestions, pointers, tips would be greatly appreciated. To answer this I think we need to know how Linux support for these models is meant to work (if it even is meant to). If Linux does trap-and-emulate (I'm not aware of any other mechanism it has by which it could make this work) then it might just amount to passing the right -Wa,... to make the assembler accept instructions not supported in the target ISA level. But it could mean there are missing prerequisites that have to be fixed on the kernel side before anything can actually work. Rich