From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17023 invoked by alias); 23 Feb 2003 12:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17009 invoked by uid 71); 23 Feb 2003 12:26:00 -0000 Date: Sun, 23 Feb 2003 12:26:00 -0000 Message-ID: <20030223122600.17008.qmail@sources.redhat.com> To: bje@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Simon Wright Subject: Re: ada/9406: Documentation suggestion Reply-To: Simon Wright X-SW-Source: 2003-02/txt/msg01155.txt.bz2 List-Id: The following reply was made to PR ada/9406; it has been noted by GNATS. From: Simon Wright 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.