public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
To: bje@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: ada/9406: Documentation suggestion
Date: Sun, 23 Feb 2003 12:26:00 -0000	[thread overview]
Message-ID: <20030223122600.17008.qmail@sources.redhat.com> (raw)

The following reply was made to PR ada/9406; it has been noted by GNATS.

From: Simon Wright <simon@pushface.org>
To: bosch@gnat.com
Cc: bosch@gcc.gnu.org, bje@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
   gcc-prs@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: ada/9406: Documentation suggestion
Date: Sun, 23 Feb 2003 12:16:03 GMT

 I've obviously failed to make my point! I'll have another go and shut up ..
 
 This is the present document:
 
    If the main program is in some language other than Ada, Then you
    may have more than one entry point in the Ada subsystem. You must
    use a special option of the binder to generate callable routines to
    initialize and finalize the Ada units (see Binding with Non-Ada
    Main Programs). Calls to the initialization and finalization
    routines must be inserted in the main program, or some other
    appropriate point in the code. The call to initialize the Ada units
    must occur before the first Ada subprogram is called, and the call
    to finalize the Ada units must occur after the last Ada subprogram
    returns. You use the same procedure for building the program as
    described previously. In this case, however, the binder only places
    the initialization and finalization subprograms into file b~xxx.adb
    instead of the main program. So, if the main program is not in Ada,
    you should proceed as follows:
 
    1. Compile the other language files to generate object files. For
       instance:
 
           gcc -c file1.c
           gcc -c file2.c
           
 
    2. Compile the Ada units to produce a set of object files and ALI
       files. For instance:
 
           gnatmake -c entry_point1.adb
           gnatmake -c entry_point2.adb
           
 
    3. Run the Ada binder on the Ada main program. For instance:
 
           gnatbind -n entry_point1.ali entry_point2.ali
           
 
    4. Link the Ada main program, the Ada objects and the other
       language objects. You only need to give the last entry point
       here. For instance:
 
           gnatlink entry_point2.ali file1.o file2.o
           
 
 Now (3) and (4) *cannot be right* because this is in a section where
 *there is no ada main program*, OK?
 
 My point about Ada subprograms being called indirectly by the non-Ada
 main program is not that there might be calls via Ada, which are
 obviously going to be handled, but that there might be calls via (a
 chain of) non-Ada units, and the user needs to account for them as
 well. And for variables (the second line of the first para above talks
 about "entry points", a naive user might not recognise that variables
 count).
 
 I see your point about partitions though I must say it was far from
 obvious that I should be looking there. Perhaps the UM should have a
 reference to the RM.


             reply	other threads:[~2003-02-23 12:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-23 12:26 Simon Wright [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-02-27 14:16 Ben Elliston
2003-02-23 14:56 Geert Bosch
2003-02-20 22:46 Geert Bosch
2003-02-20 21:46 Simon Wright
2003-02-19 20:56 bosch
2003-02-18 14:06 bje
2003-02-18 12:09 bje
2003-01-22 20:56 simon

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=20030223122600.17008.qmail@sources.redhat.com \
    --to=simon@pushface.org \
    --cc=bje@gcc.gnu.org \
    --cc=gcc-prs@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).