From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: tuhs-bounces@minnie.tuhs.org X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, T_DKIMWL_WL_MED autolearn=ham autolearn_force=no version=3.4.1 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id ba33eca2 for ; Sun, 22 Jul 2018 20:49:35 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id 491DCA188F; Mon, 23 Jul 2018 06:49:34 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 3A0B6A1876; Mon, 23 Jul 2018 06:49:10 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=majumdar-org-uk.20150623.gappssmtp.com header.i=@majumdar-org-uk.20150623.gappssmtp.com header.b=R/609vKe; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id E55EFA1876; Mon, 23 Jul 2018 06:49:06 +1000 (AEST) Received: from mail-ua0-f196.google.com (mail-ua0-f196.google.com [209.85.217.196]) by minnie.tuhs.org (Postfix) with ESMTPS id 96E719E3A6 for ; Mon, 23 Jul 2018 06:49:05 +1000 (AEST) Received: by mail-ua0-f196.google.com with SMTP id p22-v6so10531642uao.7 for ; Sun, 22 Jul 2018 13:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=majumdar-org-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Mm13Pe7WvmjBLauRmnoKlwj340W6pRDVXq6Rq/tnCq8=; b=R/609vKeL+CETtpBRWucvZYcl5KPM/JLcu2exr+tOTO24A1P5cDi22pwWwe+ROdolO FEJzSNCW5QxqNJCN9+KT/Ewg+3ZxsRlupOj0GT4eSs4AFuSayEjeX1FulzoYq3yPFXWJ 0V76kTsuva60/2ARXSOOZRqfqBQQIrcB7C2LiRa72z5MDanDwAy9FddP2IubzDCuz6Jz 4xsjib1KzWvpsciLFJaGBLFyZdp1Gib2GInT1NzYfYwnT01mG9L+z/Xx7/XEXKZuXTob LxgCDyhSbV87ik7hucwCp78ZGwCs9/pZSvFdadgIqdyxxaz+meTqLq90m0K0rIj30zUY +GVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Mm13Pe7WvmjBLauRmnoKlwj340W6pRDVXq6Rq/tnCq8=; b=iGjkWe89oReP69f2VzWM326RDTFxjqe/nC4zsmU4b+Okffdq7mEDJ3ar0P3UWm5iSK Md6hvyKTRJwF0XpJJU9N7EB3ZfIWi6LXm+tUs8J1MZ8beyXr3s6+PaYac/VxpXWkgxuF vIYRhJxg2e3lh1mFIKPhxN8FnU0hTmtxCvaOpR/h0uxePE59Jri8JRdHSSkGYJsT03gN rlaJgHdTL8VSlkXYixIMABxcV2oshiR38fyQsU1TaYmVgrRgBGjdFNFuWmOslPugpELu C7OLfDv2vs0SJ/0nxSErzDYMb215N8T0QLCJcZ4Xu4BYe0uPPqrg8BeOIhNM+3Y6jHQa VfPw== X-Gm-Message-State: AOUpUlHuyXWLMrn//DQf8Zi95RKfMj5UcfZQPApOHOFTrBV77lH21++k pUovKQAC0khDC2IgxQsrLQZeFCjgxpenuzUAd+Wa+w== X-Google-Smtp-Source: AAOMgpf37ZnLdho/uLxbzQCR6BwzZEEU+Q/CMkTAmWswNydk3gEl/l79bGb5IwdxK37EtIPe/ScCfM8+KhlYahCffA0= X-Received: by 2002:ab0:4c6c:: with SMTP id d44-v6mr6924651uag.102.1532292544538; Sun, 22 Jul 2018 13:49:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:a5:0:0:0:0:0 with HTTP; Sun, 22 Jul 2018 13:49:04 -0700 (PDT) In-Reply-To: <8ECDA62D-1B54-4391-A226-D3E9ABEE4C07@planet.nl> References: <8ECDA62D-1B54-4391-A226-D3E9ABEE4C07@planet.nl> From: Dibyendu Majumdar Date: Sun, 22 Jul 2018 21:49:04 +0100 Message-ID: To: Paul Ruizendaal Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [TUHS] Looking for final C compiler by Dennis Ritchie X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" Hi Paul, On 20 July 2018 at 11:04, Paul Ruizendaal wrote: >> I will try to port the C compiler to amd64 - while preserving as much of >> the original code as I can. But not sure if this is even feasible. > > If that is your goal, you might want to start with the version included w= ith 2.11BSD. It is essentially the same as the version from V7, but with 15= more years of bug fixes. I used that source to port V6 Unix to the TI990 a= rchitecture back in 2014/2015 and the good thing about it is that it still = compiles with a modern gcc. I found similarities between the 2.11BSD and 10th edition sources - presumably 2.11BSD was based on (or incorporated) changes in the 10th edition? BTW did you publish your work? > For your project, I think you would be able to use the first pass =E2=80= =98c0=E2=80=99 almost unchanged. I have been able to get c0 working. I had to work around the use of sbrk() as this is not supported on Windows. I also changed the output to text format - mainly so that I can see what is being generated. > The second pass =E2=80=98c1=E2=80=99 would need major restructuring. It m= ainly builds a tree for each expression and then performs various transform= ations, many of which are PDP11 specific (but also portable ones, like hand= ling of constant expressions). It then covers the tree with code fragments = selected from a library. This library (=E2=80=98optable') would need a full= rewrite as well. This part will be more difficult I suspect - but I will only start on this after I have converted c0 to output 64-bit compliant intermediate code. It seems that Dennis Ritchie wrote a paper 'A Tour through the Unix C Compiler' which is quite useful in understanding the compiler. I have converted the doc to Markdown format as well which makes it easier to read. Thanks and Regards Dibyendu