[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#749574: gnat-4.9: Gnatlink fails with CONSTRAINT_ERROR in gnatlink.adb



Source: gnat-4.9
Severity: normal

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?

Use of the -D option to gnatmake, to locate (most) intermediate files in a
separate directory.  This worked up to a certain point, then failed despite
reducing testcase to 3 small files.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?
Use the -D option to locate .o,.ali files in a subdirectory
Eliminating the -D option allowed a successful build (with a cluttered
directory)
   * What was the outcome of this action?

brian@Gannet:~/Ada/bug$ mkdir objs
brian@Gannet:~/Ada/bug$ gnatmake -D objs mai_read_config.adb
gcc-4.8 -c -o /home/brian/Ada/bug/objs/mai_read_config.o mai_read_config.adb
gcc-4.8 -c -o /home/brian/Ada/bug/objs/mai_driver.o mai_driver.adb
gnatbind -aO/home/brian/Ada/bug/objs -x
/home/brian/Ada/bug/objs/mai_read_config.ali
gnatlink /home/brian/Ada/bug/objs/mai_read_config.ali
Exception name: CONSTRAINT_ERROR
Message: gnatlink.adb:2094 range check failed

gnatlink: INTERNAL ERROR. Please report
gnatmake: *** link failed.

Seen with Debian gnat-4.8 (gcc4.8.2) - constraint error at gnatlink.adb line
2094
Seen with Debian gnat-4.9  - constraint error at at gnatlink.adb line 2195
NOT seen with home-built upstream gnat-4.9 snapshot (gcc-4.9-20140112)

   * What outcome did you expect instead?

brian@Gannet:~/Ada/bug$ export PATH=/opt/gcc4_9/bin:$PATH
brian@Gannet:~/Ada/bug$ gnatmake -D objs mai_read_config.adb
gcc -c -o /home/brian/Ada/bug/objs/mai_read_config.o mai_read_config.adb
gcc -c -o /home/brian/Ada/bug/objs/mai_driver.o mai_driver.adb
gnatbind -aO/home/brian/Ada/bug/objs -x
/home/brian/Ada/bug/objs/mai_read_config.ali
gnatlink /home/brian/Ada/bug/objs/mai_read_config.ali

*** End of the template - remove these template lines ***



-- System Information:
Debian Release: jessie/sid
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
with Mai_Driver;

procedure MAI_Read_Config is
begin
   MAI_Driver.Open(Addr => 0);
   MAI_Driver.Close;
end MAI_Read_Config;
package MAI_driver is

   procedure Open(Addr : natural);	
   procedure Close;

end MAI_driver;
package body MAI_driver is

   procedure Open(Addr : natural) is 
   begin
      null;
   end Open;
	
   procedure Close is 
   begin
      null;
   end Close;

end MAI_driver;

Reply to: