From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <9front-bounces@9front.inri.net> X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from 9front.inri.net (9front.inri.net [168.235.81.73]) by inbox.vuxu.org (Postfix) with ESMTP id 6586224E2C for ; Wed, 8 May 2024 16:24:38 +0200 (CEST) Received: from wopr.sciops.net ([216.126.196.60]) by 9front; Wed May 8 10:22:43 -0400 2024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sciops.net; s=20210706; t=1715178126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to; bh=zApdWJODQC5H7hkL24cUwoLBYWdI/IJskdW1WNtBzO8=; b=Nj1hLrIUZ4KBPucJPPNdg1PIn0Tzs+cRYNDtug8JN0rgUdj55BMmJrEC1FtLbK1u/m000a LWw5f0s87Duov7myJDQKJmQFJzCVvfxB9xsz0UOTw2IYIDrLEy47eEc1WeorlEj4XjpnMg kJBERsaPIXHKyFGjMee9iI+F2an9sww= Received: by wopr.sciops.net (OpenSMTPD) with ESMTPSA id ae5fc260 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for <9front@9front.org>; Wed, 8 May 2024 07:22:05 -0700 (PDT) Message-ID: <94909FDAB9454C00B8D7ECE0602C3978@wopr.sciops.net> Date: Wed, 08 May 2024 16:22:30 +0200 From: qwx@sciops.net To: 9front@9front.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: app hardware-scale API-based callback generator Subject: Re: [9front] Linking error while porting Reply-To: 9front@9front.org Precedence: bulk On Wed May 8 13:23:38 +0200 2024, sirjofri+ml-9front@sirjofri.de wrote: > Hey all, > > I'm trying to port the simon tatham portable puzzle collection using npe and I get incompatible type signatures while linking the files. > > For npe, I had to #undef PI after #including (in npe.h), because puzzles #defines its own PI. Other than that, I didn't change the source repo or npe. > > My sources are here: http://sirjofri.de/oat/tmp/puzzles/ > > repo.url contains the url to the source repo for puzzles. To get started, clone that url to your local filesystem and copy the remaining files into the same directory. > > The other files are an mkfile and plan9.c (for the plan 9 frontend, which is mostly a stub I still have to fill). > > b.rc is a short build script for building the blackbox program. Literally `mk install 6.blackbox`. It's not about that program specifically, it's just the first game in the list. > > The linking errors are all roughly the same, like: > > new_window: incompatible type signatures 71a60b79(blackbox.6) and 846c216a(plan9.6) for thegame > > In this specific case, I double checked the type and the only difference is that one is declared as the struct itself, the other as the typedef'd struct (struct game vs game). I also changed that temporarily, without a difference. The compiler handles typedef's like it should. > > I can't imagine any other reason why it shouldn't work. Thanks to npe, it's the same compiler (6c) for both source files. The compilers/linkers should be up to date (sysupdated yesterday). > > If anyone has any idea what could be wrong, that would be very helpful. Also if I should give you more data, just let me know. > > sirjofri From what I saw, some of these structs are actually not defined in the header but in individual c files. Putting `#pragma incomplete' for a few of them in puzzles.h fixes most linking errors: #pragma incomplete midend #pragma incomplete drawing #pragma incomplete frontend #pragma incomplete random_state One error still remains for a big and complex struct, you might have to go through all type declarations and make sure whatever isn't defined in puzzles.h is marked incomplete. Cheers, qwx