9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <charles.forsyth@gmail.com>
To: 9fans <9fans@9fans.net>
Subject: Re: [9fans] Can compile Plan9 C compiler for windows10?
Date: Mon, 29 Mar 2021 16:08:17 +0100	[thread overview]
Message-ID: <CAOw7k5gmwXs7eSO6hAg99c75hELpNtP9h5c8jYJPKAquw7AtsA@mail.gmail.com> (raw)
In-Reply-To: <202103291414.12TEEIJP004120@freefriends.org>

[-- Attachment #1: Type: text/plain, Size: 1890 bytes --]

>
> I doubt very much that using the Plan 9 C compilers will bring much
> additional benefit for finding bugs (except bugs in the compiler!).


The cross-file type-checking does sometimes pick up unpleasantness caused
by type mismatches.
It was originally added to allow dynamically-loaded object modules to be
checked against the loading specification.
It has found a few problems elsewhere, including one in Python where one .c
file included a .h with a certain #define
in scope that another .c file didn't define by accident, causing the two .c
files to have completely different memory layouts
for a structure.


> Out of curiousity, why is linking against the system libraries so
> hard?  I assume a port of kenc to Linux would have a driver program
> that would just invoke the system ld(1).  I'd think that getting
> the ABI and generation of ELF (or of standard Linux assembly language)
> correct would be the hard part.
> What am I missing?


It works very differently from what you expect
http://9p.io/sys/doc/compiler.html  <http://9p.io/sys/doc/compiler.html>:

The compiler is a single program that produces an object file. Combined in
the compiler are the traditional roles of preprocessor, lexical analyzer,
parser, code generator, local optimizer, and first half of the assembler.
The object files are binary forms of assembly language, similar to what
might be passed between the first and second passes of an assembler.

Object files and libraries are combined by a loader program to produce the
executable binary. The loader combines the roles of second half of the
assembler, global optimizer, and loader.

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T4d77cc95ab4ed70c-Mae8386c3c15f3973027b8de6
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 3501 bytes --]

  reply	other threads:[~2021-03-29 15:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-28  8:13 saif.resun
2021-03-28  9:09 ` Richard Miller
2021-03-28  9:21   ` Sean Hinchee
2021-03-28 13:16     ` saif.resun
2021-03-28 15:08       ` ron minnich
2021-03-29  6:42         ` arnold
2021-03-29 14:04           ` Russ Cox
2021-03-29 14:14             ` arnold
2021-03-29 15:08               ` Charles Forsyth [this message]
2021-03-29 17:18                 ` arnold
2021-03-29 17:45                   ` Russ Cox
2021-03-29 17:55                     ` arnold
2021-03-29 17:58                     ` John Floren
2021-03-29 15:15               ` ori
2021-03-28 15:16       ` Paul Lalonde
2021-03-29  4:51       ` Ethan Gardener
2021-03-29  4:57     ` Ethan Gardener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOw7k5gmwXs7eSO6hAg99c75hELpNtP9h5c8jYJPKAquw7AtsA@mail.gmail.com \
    --to=charles.forsyth@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).