comp.lang.ada
 help / color / mirror / Atom feed
* Upgrade to gnat 2015 now project not linking
@ 2015-09-29 12:27 Lucas Redding
  2015-09-29 20:10 ` Shark8
  0 siblings, 1 reply; 10+ messages in thread
From: Lucas Redding @ 2015-09-29 12:27 UTC (permalink / raw)


Hi,

I recently upgraded from GNAT 2013 toolchain to the GNAT 2015 toolchain and now my builds no longer link.

I get the following errors...

gcc.exe: warning: x.o: linker input file unused because linking not done
gcc.exe: warning: GNAT-TEMP-000001.TMP: linker input file unused because linking not done
gcc.exe: warning: x.a: linker input file unused because linking not done

I am using GPS 6.1.1.

I have tried bth GPRBUILD and GNATMAKE but both raise the same issues.

Any ideas?

All help is greatly appreciated.

Regards

Lucas

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Upgrade to gnat 2015 now project not linking
  2015-09-29 12:27 Upgrade to gnat 2015 now project not linking Lucas Redding
@ 2015-09-29 20:10 ` Shark8
  2015-09-30  7:26   ` Lucas Redding
  0 siblings, 1 reply; 10+ messages in thread
From: Shark8 @ 2015-09-29 20:10 UTC (permalink / raw)


On Tuesday, September 29, 2015 at 6:27:08 AM UTC-6, Lucas Redding wrote:
> Hi,
> 
> I recently upgraded from GNAT 2013 toolchain to the GNAT 2015 toolchain and now my builds no longer link.
> 
> I get the following errors...
> 
> gcc.exe: warning: x.o: linker input file unused because linking not done
> gcc.exe: warning: GNAT-TEMP-000001.TMP: linker input file unused because linking not done
> gcc.exe: warning: x.a: linker input file unused because linking not done
> 
> I am using GPS 6.1.1.
> 
> I have tried bth GPRBUILD and GNATMAKE but both raise the same issues.
> 
> Any ideas?
> 
> All help is greatly appreciated.
> 
> Regards
> 
> Lucas

Have you cleaned the [build/lib] directories?
OTOH, it sounds almost like you've got a flag saying "don't link".

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Upgrade to gnat 2015 now project not linking
  2015-09-29 20:10 ` Shark8
@ 2015-09-30  7:26   ` Lucas Redding
  2015-09-30  8:51     ` Georg Bauhaus
  0 siblings, 1 reply; 10+ messages in thread
From: Lucas Redding @ 2015-09-30  7:26 UTC (permalink / raw)


On Tuesday, September 29, 2015 at 9:10:22 PM UTC+1, Shark8 wrote:
> On Tuesday, September 29, 2015 at 6:27:08 AM UTC-6, Lucas Redding wrote:
> > Hi,
> > 
> > I recently upgraded from GNAT 2013 toolchain to the GNAT 2015 toolchain and now my builds no longer link.
> > 
> > I get the following errors...
> > 
> > gcc.exe: warning: x.o: linker input file unused because linking not done
> > gcc.exe: warning: GNAT-TEMP-000001.TMP: linker input file unused because linking not done
> > gcc.exe: warning: x.a: linker input file unused because linking not done
> > 
> > I am using GPS 6.1.1.
> > 
> > I have tried bth GPRBUILD and GNATMAKE but both raise the same issues.
> > 
> > Any ideas?
> > 
> > All help is greatly appreciated.
> > 
> > Regards
> > 
> > Lucas
> 
> Have you cleaned the [build/lib] directories?
> OTOH, it sounds almost like you've got a flag saying "don't link".

Thanks Shark8,

Cleaning the build/lib dirs did not do the trick.

I also suspect that I have a flag saying "don't link" but I can't for the life of me find it.

Thanks nonetheless for your help.

Best regards

Lucas


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Upgrade to gnat 2015 now project not linking
  2015-09-30  7:26   ` Lucas Redding
@ 2015-09-30  8:51     ` Georg Bauhaus
  2015-09-30 17:07       ` Lucas Redding
  0 siblings, 1 reply; 10+ messages in thread
From: Georg Bauhaus @ 2015-09-30  8:51 UTC (permalink / raw)


On 30.09.15 09:26, Lucas Redding wrote:
> I also suspect that I have a flag saying "don't link" but I can't for the life of me find it.

For a start, -c might do.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Upgrade to gnat 2015 now project not linking
  2015-09-30  8:51     ` Georg Bauhaus
@ 2015-09-30 17:07       ` Lucas Redding
  2015-09-30 17:20         ` Lucas Redding
  0 siblings, 1 reply; 10+ messages in thread
From: Lucas Redding @ 2015-09-30 17:07 UTC (permalink / raw)


On Wednesday, September 30, 2015 at 9:51:03 AM UTC+1, Georg Bauhaus wrote:
> On 30.09.15 09:26, Lucas Redding wrote:
> > I also suspect that I have a flag saying "don't link" but I can't for the life of me find it.
> 
> For a start, -c might do.

Thanks George,

It turns out that its the -M option in the linking switches.

2013 -M produces both the map file and the executable.
2015 -M only produces the map file, and not the executable.

Conclusion: If you want a map file to go with an executable you need a separate build for each (Map and exe).

I have come to conclusion on this through trial and error. It may be buried somewhere in the documentation, but I certainly have been unable to find it.

Nonetheless after plenty of headaches and heartaches, all systems are now go.

Any further offers of elaboration (not the Ada kind) on this issue are very welcome.

Thanks to all who answered.

Much appreciated

Lucas


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Upgrade to gnat 2015 now project not linking
  2015-09-30 17:07       ` Lucas Redding
@ 2015-09-30 17:20         ` Lucas Redding
  2015-09-30 17:52           ` Lucas Redding
  2015-09-30 19:15           ` Simon Wright
  0 siblings, 2 replies; 10+ messages in thread
From: Lucas Redding @ 2015-09-30 17:20 UTC (permalink / raw)


On Wednesday, September 30, 2015 at 6:07:34 PM UTC+1, Lucas Redding wrote:
> On Wednesday, September 30, 2015 at 9:51:03 AM UTC+1, Georg Bauhaus wrote:
> > On 30.09.15 09:26, Lucas Redding wrote:
> > > I also suspect that I have a flag saying "don't link" but I can't for the life of me find it.
> > 
> > For a start, -c might do.
> 
> Thanks George,
> 
> It turns out that its the -M option in the linking switches.
> 
> 2013 -M produces both the map file and the executable.
> 2015 -M only produces the map file, and not the executable.
> 
> Conclusion: If you want a map file to go with an executable you need a separate build for each (Map and exe).
> 
> I have come to conclusion on this through trial and error. It may be buried somewhere in the documentation, but I certainly have been unable to find it.
> 
> Nonetheless after plenty of headaches and heartaches, all systems are now go.
> 
> Any further offers of elaboration (not the Ada kind) on this issue are very welcome.
> 
> Thanks to all who answered.
> 
> Much appreciated
> 
> Lucas

Hold fire!

I was too quick to come to conclusion. -M does not generate a map file.

I need to look into how to generate a map file in 2015.

I'll be back.

Cheers

Lucas


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Upgrade to gnat 2015 now project not linking
  2015-09-30 17:20         ` Lucas Redding
@ 2015-09-30 17:52           ` Lucas Redding
  2015-09-30 19:15           ` Simon Wright
  1 sibling, 0 replies; 10+ messages in thread
From: Lucas Redding @ 2015-09-30 17:52 UTC (permalink / raw)


On Wednesday, September 30, 2015 at 6:20:39 PM UTC+1, Lucas Redding wrote:
> On Wednesday, September 30, 2015 at 6:07:34 PM UTC+1, Lucas Redding wrote:
> > On Wednesday, September 30, 2015 at 9:51:03 AM UTC+1, Georg Bauhaus wrote:
> > > On 30.09.15 09:26, Lucas Redding wrote:
> > > > I also suspect that I have a flag saying "don't link" but I can't for the life of me find it.
> > > 
> > > For a start, -c might do.
> > 
> > Thanks George,
> > 
> > It turns out that its the -M option in the linking switches.
> > 
> > 2013 -M produces both the map file and the executable.
> > 2015 -M only produces the map file, and not the executable.
> > 
> > Conclusion: If you want a map file to go with an executable you need a separate build for each (Map and exe).
> > 
> > I have come to conclusion on this through trial and error. It may be buried somewhere in the documentation, but I certainly have been unable to find it.
> > 
> > Nonetheless after plenty of headaches and heartaches, all systems are now go.
> > 
> > Any further offers of elaboration (not the Ada kind) on this issue are very welcome.
> > 
> > Thanks to all who answered.
> > 
> > Much appreciated
> > 
> > Lucas
> 
> Hold fire!
> 
> I was too quick to come to conclusion. -M does not generate a map file.
> 
> I need to look into how to generate a map file in 2015.
> 
> I'll be back.
> 
> Cheers
> 
> Lucas

Ok. It looks like gprbuild is being used even though you specify gnatmake in the build settings target and -M is incompatible with GPRBUILD.

I changed my build\settings\target for "build main" to gprbuild and I added the switch --create-map-file and viola, I now have both a map file and an executable.

Final Conclusion: Use gprbuild and make sure you do not use -M in the linker switches. Instead use --create-map-file switch in the  build\settings\target for "build main" command line.

Thanks again

All the best

Lucas


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Upgrade to gnat 2015 now project not linking
  2015-09-30 17:20         ` Lucas Redding
  2015-09-30 17:52           ` Lucas Redding
@ 2015-09-30 19:15           ` Simon Wright
  2015-10-01  6:26             ` Lucas Redding
  2015-10-01  8:22             ` Simon Wright
  1 sibling, 2 replies; 10+ messages in thread
From: Simon Wright @ 2015-09-30 19:15 UTC (permalink / raw)


Lucas Redding <lucas.redding@gmail.com> writes:

> Hold fire!
>
> I was too quick to come to conclusion. -M does not generate a map file.
>
> I need to look into how to generate a map file in 2015.
>
> I'll be back.

Gprbuild can do this.

You should be able to say, in package Builder, something like

   package Builder is
      for Default_Switches ("ada") use
        ("--create-map-file=" & project'Project_Dir & project'Name & ".map");
   end Builder;

(that's one of mine; it assumes there's only one main program, named
after the project, and works round the problem that the link is done in
the build directory).

assuming that the configuration is set up to know how to specify a map
file; if not, you could try (for GNU ld)

   package Linker is
      for Map_File_Option use "-Wl,-Map,";
   end Linker;

It occurs to me one could try to combine these:

   package Linker is
      for Map_File_Option use "-Wl,-Map,project'Project_Dir";
   end Linker;

and

   package Builder is
      for Default_Switches ("ada") use ("--create-map-file");
   end Builder;

If this works, you could omit (this part of) package Builder and just
use --create-map-file on the command line.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Upgrade to gnat 2015 now project not linking
  2015-09-30 19:15           ` Simon Wright
@ 2015-10-01  6:26             ` Lucas Redding
  2015-10-01  8:22             ` Simon Wright
  1 sibling, 0 replies; 10+ messages in thread
From: Lucas Redding @ 2015-10-01  6:26 UTC (permalink / raw)


Thanks Simon, 

Very useful indeed. See my final conclusion where I have added --create-map-file to the command line. Adding it to the builder is much better. I'm off to do just that. 

Thanks again.

Lucas


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Upgrade to gnat 2015 now project not linking
  2015-09-30 19:15           ` Simon Wright
  2015-10-01  6:26             ` Lucas Redding
@ 2015-10-01  8:22             ` Simon Wright
  1 sibling, 0 replies; 10+ messages in thread
From: Simon Wright @ 2015-10-01  8:22 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

>    package Linker is
>       for Map_File_Option use "-Wl,-Map,project'Project_Dir";
>    end Linker;

Should have been

   for Map_File_Option use "-Wl,-Map," & project'Project_Dir;


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-10-01  8:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-29 12:27 Upgrade to gnat 2015 now project not linking Lucas Redding
2015-09-29 20:10 ` Shark8
2015-09-30  7:26   ` Lucas Redding
2015-09-30  8:51     ` Georg Bauhaus
2015-09-30 17:07       ` Lucas Redding
2015-09-30 17:20         ` Lucas Redding
2015-09-30 17:52           ` Lucas Redding
2015-09-30 19:15           ` Simon Wright
2015-10-01  6:26             ` Lucas Redding
2015-10-01  8:22             ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox