public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Paul Edwards" <mutazilah@gmail.com>
To: <gcc@gcc.gnu.org>
Subject: Re: i370 port - in search of hooks
Date: Fri, 11 Sep 2009 17:35:00 -0000	[thread overview]
Message-ID: <E3F9F5E66518469CB6C5690ED46DB38B@Paullaptop> (raw)
In-Reply-To: <Pine.LNX.4.64.0906051459030.7321@digraph.polyomino.org.uk>

I'm making quite good progress with cleaning up the 3.4.6 i370
port.  I've even got optimization working to some degree.

Meanwhile, on a different machine (a Linux machine I program
on on the way to/from work), I have managed to build 4.4.0,
which means I have an environment to work on a more modern
version of GCC.

That modern version is what I would like to ask about today.
Leaving aside the issue of the actual target, I'm more interested
in the intrusive hooks I expect I will need (I won't know until
I start doing the work, and I can't do that until I find out whether
4.4 is good enough - chicken and egg).  Here is what I needed
for 3.4.6:


1. Ability to build a standalone executable.  Simply put, I need
gcc to do a function call like this:

#ifdef SINGLE_EXECUTABLE
     {
         int cnt = 0;

         while (commands[i].argv[cnt] != NULL)
         {
             cnt++;
         }
         if (strcmp(string, "cc1") == 0)
         {
             ret_code = toplev_main(cnt, commands[i].argv);
             if (ret_code != 0) break;
         }
      }
#else

Doesn't need to be exactly like that, but some sort of hook to be
made available so that I can bypass system() or any variation of
that.  C90 doesn't guarantee that system() will do anything in
particular.  And my C environment indeed doesn't work too well
if you try that.  Can't have two programs opening and closing
the same DDNAME.  Can only have 100 characters worth of
parameters too.


2. A completely different way of handling include files.  After going
through the normal remap process, I then want the following
transformations:

#include "fred.h"

gets translated into an fopen("dd:include(fred)", "r")

#include <fred.h>

gets translated into an fopen("dd:sysincl(fred)", "r")

None of this checking to see if something is a directory etc.  There's
no such call available in C90, nor my C library on MVS.  The code
above looks trivial enough, but when it's time to actually find where
to put that, it's non-trivial.


3. There is some complicated parameter lookup facility - it does a binary
search on the parameters.  This requires a whole lot of infrastructure to
be present to generate the code.  Infrastructure which I don't have.  I'd
like a simple sequential search to be available as an option I can
activate.


4. There are a whole lot of includes that don't exist, like sys/types.h, and
I'd like them to be masked out like all other includes are done (even
things that are part of C90 have masks!!!).


5. It'd be cool if some of the names could be unique in the first 8 
characters
(C90 guarantees 6 for externals, but I have the luxury of 8).  I have a
mostly non-intrusive way of remapping everything, but there are a few
that I need to do intrusively, because I can't #define away something
that is already #defined.  Problem is compounded by the fact that
I link together code that normally isn't linked together.  Note that I don't
need things like an assembler and linker linked in together - I just need
the stuff required for the "-S" option to work.  ie text file (ie C code) 
in,
and text file (ie assembler code) out - a text processing program that
should be (and in fact, has already been made that way) possible to
do in pure C90.


6. It would be nice if all the non-C90 Posix functions were masked out,
but so far I have been able to kludge around that without requiring a
lot of intrusive changes.  It would be good to get the worst of them
out though.


My questions are:

1. Are changes like the above likely to be accepted into the head version
going forward?

2. If they are, what version should I work on to get that to happen?


Ideally I'd like to work on a stable version, perhaps 4.4, and later have
those changes merged onto the head.  But I fear if I do that I will end
up in the same position I am in now with 3.4.6, ie too many changes
such that my patches are never actually relevant.

But it's quite daunting to get this working at all.

So I thought that what I might be able to do instead is get the hooks
in place first.  Not necessarily all at once.  Possibly over the course
of a year.

Eventually all the hooks will exist, there will be a stable release cut
containing all the hooks I need, and then I may be in with a chance of
getting i370 working on that environment.  That would also be done
over the course of a year or whatever, as the GMP and MPFR need to
be set up on MVS too (just having a S/390 port is not sufficient - I
need S/370 HLASM).

Hopefully at the end of that process, I'll have an i370 port that is done
in a "standard" way so that updating to the latest GCC is fairly trivial
*regardless* of whether the i370 port is included in GCC proper due
to the yet more technical challenges that requires, another job for
another year.  :-)

This is a parallel effort to my 3.4.6 work which is done on a different
PC at a different time.  3.4.6 is mostly about getting it to run on
real MVS.  4.4/x is simply to get a cross-compile to work for now.

Thanks.  Paul.

  parent reply	other threads:[~2009-09-11 17:35 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05 12:45 i370 port Paul Edwards
2009-06-05 14:33 ` Joseph S. Myers
2009-06-05 14:57   ` Paul Edwards
2009-06-05 15:03     ` Joseph S. Myers
2009-06-05 15:24       ` Paul Edwards
2009-06-05 15:47         ` Joseph S. Myers
2009-09-11 17:35       ` Paul Edwards [this message]
2017-03-31 10:34       ` Paul Edwards
2009-09-12 12:41   ` Paul Edwards
2009-06-05 15:21 ` Ulrich Weigand
2009-06-05 15:39   ` Paul Edwards
2009-06-05 15:49     ` Daniel Jacobowitz
2009-06-05 15:57       ` Paul Edwards
2009-06-05 20:20         ` Joseph S. Myers
2009-06-05 20:45           ` Paul Edwards
2009-06-06 15:00       ` Paul Edwards
2009-06-15 17:46         ` Ulrich Weigand
2009-06-19  0:06           ` Paul Edwards
2009-06-19 12:28             ` Ulrich Weigand
2009-07-18 11:28               ` Paul Edwards
2009-07-20 14:27                 ` Ulrich Weigand
2009-08-08 12:04                   ` Paul Edwards
2009-08-10 21:25                     ` Ulrich Weigand
2009-08-11  0:34                       ` Paul Edwards
2009-08-11 15:21                         ` Ulrich Weigand
2009-08-12 11:52                           ` Paul Edwards
2009-08-12 15:27                             ` Paolo Bonzini
2009-08-12 16:35                             ` Ulrich Weigand
2009-08-12 17:27                               ` Paul Edwards
2009-08-12 17:56                                 ` Paolo Bonzini
2009-08-12 19:46                                 ` Ulrich Weigand
2009-08-12 20:31                                   ` Paul Edwards
2009-08-19 12:07                               ` Paul Edwards
2009-08-19 12:27                                 ` Paolo Bonzini
2009-08-20 12:49                               ` Paul Edwards
2009-08-20 22:48                                 ` Ulrich Weigand
2009-08-21  2:37                                   ` Paul Edwards
2009-08-21 16:46                                     ` Ulrich Weigand
2009-06-05 15:44   ` Joseph S. Myers
2009-06-05 15:52     ` Paul Edwards
2009-09-08 15:55     ` Paul Edwards
2009-09-14 15:32       ` Ulrich Weigand
2021-09-02  8:15   ` s390 port Paul Edwards
2021-09-02 14:34     ` Ulrich Weigand
2021-09-02 14:50       ` Paul Edwards
2021-09-02 14:53         ` Ulrich Weigand
2021-09-02 15:01           ` Paul Edwards
2021-09-02 15:13             ` Ulrich Weigand
2021-09-02 15:26               ` Paul Edwards
2021-09-02 19:46                 ` Ulrich Weigand
2021-09-02 20:05                   ` Paul Edwards
2021-09-02 20:16                     ` Andreas Schwab
2021-09-03 11:18                     ` Ulrich Weigand
2021-09-03 11:35                       ` Paul Edwards
2021-09-03 12:12                         ` Ulrich Weigand
2021-09-03 12:38                           ` Paul Edwards
2021-09-03 12:53                             ` Jakub Jelinek
2021-09-03 13:12                               ` Paul Edwards
2022-12-20  4:27                           ` Paul Edwards

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=E3F9F5E66518469CB6C5690ED46DB38B@Paullaptop \
    --to=mutazilah@gmail.com \
    --cc=gcc@gcc.gnu.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).