From: crossd@gmail.com (Dan Cross)
Subject: [TUHS] 2.11BSD cross compiling update
Date: Sat, 14 Jan 2017 02:17:23 -0500 [thread overview]
Message-ID: <CAEoi9W7x+G1r5BEctWkhFTRY96do=MKBUHVo-VfeNGDjvRHm2A@mail.gmail.com> (raw)
In-Reply-To: <CAH1jEzYgZ_EN0c5LimnYxDtBO9rFHHM60Q5zDbbuCzBkw2zWfA@mail.gmail.com>
On Fri, Jan 13, 2017 at 12:57 PM, Nick Downing <downing.nick at gmail.com>
wrote:
> [snip]
>
> So what I ended up doing was to port a tiny subset of 2.11BSD libc to
> Linux, including its types. I copied the ctime.c module and prefixed
> everything with "cross_" so there was "cross_time_t" and so forth, and
> "#include <time.h>" became "#include <cross/time.h>", in turn this
> depends on "#include <cross/sys/types.h>" and so on. That way, the
> original logic worked unchanged.
>
> I decided to also redo the cross compilation tools (as, cc, ld, nm,
> ranlib and so on) using the same approach, since it was conceptually
> elegant. This involved making e.g. "cross_off_t" and "struct
> cross_exec" available by "#include <cross/a.out.h>", and obviously the
> scheme extends to whatever libc functions we want to use. In
> particular we use floating point, and I plan to make a "cross_atof()"
> for the C compiler's PDP-11-formatted floating-point constant
> handling, etc. (This side of things, like the cross tools, was
> working, but was not terribly elegant before).
>
> So then I got to thinking, actually this is an incredibly powerful
> approach. [snip]
>
That sounds incredibly tedious. Can you specify a compiler flag to disable
searching the host /usr/include? Then you could set your own include path
and not have conflicts with headers from the host system. With, say, GCC
one could use `-ffreestanding` or `-nostdinc` and the like.
- Dan C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170114/ebd869d8/attachment.html>
next prev parent reply other threads:[~2017-01-14 7:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 17:57 Nick Downing
2017-01-13 19:02 ` Steve Simon
2017-01-13 19:53 ` Random832
[not found] ` <CAH1jEzYcBatLzcU1VYRmNVaMde4xt2C5FrqszOLn4P+cbXjiXQ@mail.gmail.com>
[not found] ` <CAH1jEzZv3+ZE7JGm5UJbrkMpGi_zqBHMWTMiQCbMoQBbW=_=yA@mail.gmail.com>
[not found] ` <CAH1jEzaYbjA=kJQs7pscqiP-xAWa7Q0d9yHhCu9=Gm_FyXYQWg@mail.gmail.com>
[not found] ` <CAH1jEzY63qWLgoJERrSaD19T8L2wKRXVN97_cAN-wHqf54a9Rw@mail.gmail.com>
[not found] ` <CAH1jEzbAxghDUV+zdf5MA4+JR9jiNN3Xci3JsAmeT+7p4XO_xQ@mail.gmail.com>
[not found] ` <CAH1jEzZtXfEnHTfKtCzq2AOWCgxiWbAjq1C+puOi=dXSbyGHvQ@mail.gmail.com>
[not found] ` <CAH1jEzbqRX=+XLVov+cXU2FWarun2gm8i6nxRRUJSEy0D=PF-Q@mail.gmail.com>
[not found] ` <CAH1jEzYzt+5ANeGM5nBZY0uHFnFsLt-QyPSLnazCVbxzjfEQ8A@mail.gmail.com>
[not found] ` <CAH1jEzbjFqie_KwAw5Qa3b__17hdqbLnHw2KPQEffTokvXS4Fw@mail.gmail.com>
[not found] ` <CAH1jEzZ1t=A3JBCne1Qi9VhOviOZJQzw0Qq+G52PBDAbg3+jPQ@mail.gmail.com>
2017-01-14 4:41 ` Nick Downing
2017-01-14 5:40 ` Random832
2017-01-14 12:57 ` Joerg Schilling
2017-01-14 7:17 ` Dan Cross [this message]
2017-01-14 8:05 ` Nick Downing
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='CAEoi9W7x+G1r5BEctWkhFTRY96do=MKBUHVo-VfeNGDjvRHm2A@mail.gmail.com' \
--to=crossd@gmail.com \
/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).