comp.lang.ada
 help / color / mirror / Atom feed
* Licensing Paranoia and Manual Compilation Issues
@ 2018-12-11 11:46 alexander
  2018-12-11 16:11 ` Simon Wright
  2018-12-11 18:50 ` G. B.
  0 siblings, 2 replies; 12+ messages in thread
From: alexander @ 2018-12-11 11:46 UTC (permalink / raw)


I've read some threads on here regarding the licensing situation of AdaCore's Libre compiler. For my upcoming project, I'm going to need (= very strong desire) to use Ada and I'm also going to need to be able to license the executable produced thereof in any way I desire.

In regards to the aforementioned, I have two questions. I realize I come forth as somewhat paranoid in the upcoming paragraphs (which undoubtedly I am). The licensing situation worries me a great deal.

1. ```As for the compiler build provided by (the GetAdaNow Mac OS X section's link to Sourceforge)[1]; which parts of that GCC build for compiling Ada can you safely use and still be covered by the "GCC Runtime Library Exception"? I can see it states you can use `GNATCOLL` and `XMLAda`. I'm assuming the standard library is included as well. Can you on the other hand use all console commands? `gnat <command>`? `gprbuild`? Or would these inject "non-runtime library exception'd" GPL code into the executable?```

2. ```I've been attempting to compile and link some code through the use of the `gcc` command solely, but haven't been successful in doing so. I have, on the other hand, been able to successfully generate an executable by utilizing the `gnatbind` and `gnatlink` commands consecutively after compiling with `gcc -c <file>`. Is it possible to use only the `gcc` command for the matter, or do you need to also throw in a few calls to the `gnat` commands?

When executing the following commands...
$ gcc -c src/main.adb -o obj/main.o
$ gcc -o main obj/main.o

I wind up with the following error (on the second command, which should be a GCC link):
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
     (maybe you meant: __ada_main)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

A similar error occurs when I attempt to create `.so` libraries manually using the `-shared` compiler switch. With all that being said, is it simply not possible to do these things through solely `gcc`, or am I missing something?```

It may be worth noticing that I've fallen in love with Ada to the utmost degree over the past year. As such, I'm planning on, at the very least, stalking "comp.lang.ada" like some creepy figure. You'll probably see more from me beyond these first two questions, is what I'm saying.

[1] https://sourceforge.net/projects/gnuada/files/GNAT_GCC%20Mac%20OS%20X/8.1.0/native-2017/

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

* Re: Licensing Paranoia and Manual Compilation Issues
  2018-12-11 11:46 Licensing Paranoia and Manual Compilation Issues alexander
@ 2018-12-11 16:11 ` Simon Wright
  2018-12-11 16:31   ` Lucretia
  2018-12-11 18:50 ` G. B.
  1 sibling, 1 reply; 12+ messages in thread
From: Simon Wright @ 2018-12-11 16:11 UTC (permalink / raw)


Let me start by saying that I'm not a lawyer.

alexander@junivörs.com writes:

> 1. ```As for the compiler build provided by (the GetAdaNow Mac OS X
> section's link to Sourceforge)[1]; which parts of that GCC build for
> compiling Ada can you safely use and still be covered by the "GCC
> Runtime Library Exception"? I can see it states you can use `GNATCOLL`
> and `XMLAda`. I'm assuming the standard library is included as
> well. Can you on the other hand use all console commands? `gnat
> <command>`? `gprbuild`? Or would these inject "non-runtime library
> exception'd" GPL code into the executable?```

They may (do) *generate* source code that gets included in the
executable (gnatbind does this). But that isn't code that's provided
with the compiler and might have a copyright issue; it's no different in
principle from object code generated directly by the compiler.

> 2. ```I've been attempting to compile and link some code through the
> use of the `gcc` command solely, but haven't been successful in doing
> so. I have, on the other hand, been able to successfully generate an
> executable by utilizing the `gnatbind` and `gnatlink` commands
> consecutively after compiling with `gcc -c <file>`. Is it possible to
> use only the `gcc` command for the matter, or do you need to also
> throw in a few calls to the `gnat` commands?
>
> When executing the following commands...  $ gcc -c src/main.adb -o
> obj/main.o $ gcc -o main obj/main.o
>
> I wind up with the following error (on the second command, which
> should be a GCC link): Undefined symbols for architecture x86_64:
> "_main", referenced from: implicit entry/start for main executable
> (maybe you meant: __ada_main) ld: symbol(s) not found for architecture
> x86_64 collect2: error: ld returned 1 exit status
>
> A similar error occurs when I attempt to create `.so` libraries
> manually using the `-shared` compiler switch. With all that being
> said, is it simply not possible to do these things through solely
> `gcc`, or am I missing something?```

Building even hello_world* is sufficiently complex that you need
gnatbind, gnatlink. As you've seen, you can use gcc for the actual
compilation.

Building a dynamic library (do you mean .so? are you on a Mac or Linux?
You mention my darwin 8.1.0 release) is more so.

To see what gnatbind gets up to while doing its work, look at the b__*
(or b~*) files it generates. Not much fun or point in generating those
by hand.

* You can build a simple null program for an embedded system on an MCU
  without gnatbind, gnatlink. But you have to bother about storage
  mappings, prcessor startup, linker scripts etc instead.

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

* Re: Licensing Paranoia and Manual Compilation Issues
  2018-12-11 16:11 ` Simon Wright
@ 2018-12-11 16:31   ` Lucretia
  2018-12-11 19:21     ` Simon Wright
  0 siblings, 1 reply; 12+ messages in thread
From: Lucretia @ 2018-12-11 16:31 UTC (permalink / raw)


On Tuesday, 11 December 2018 16:11:51 UTC, Simon Wright  wrote:
> Let me start by saying that I'm not a lawyer.

What version is that compiler on sourceforge? Is it from FSF directly, i.e. gcc.gnu.org? Or is it GNAT-GPL/CE, i.e. from AdaCore.com? If the latter, the licence is GPL-3.0 no linking exception, otherwise it's GPL-3.0 with linking exception. Basically, avoid anything GPL-3.0 no linking exception, especially Adacore's libraries.

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

* Re: Licensing Paranoia and Manual Compilation Issues
  2018-12-11 11:46 Licensing Paranoia and Manual Compilation Issues alexander
  2018-12-11 16:11 ` Simon Wright
@ 2018-12-11 18:50 ` G. B.
  1 sibling, 0 replies; 12+ messages in thread
From: G. B. @ 2018-12-11 18:50 UTC (permalink / raw)


<alexander@xn--junivrs-e1a.com> wrote:
> I've read some threads on here regarding the licensing situation of
> AdaCore's Libre compiler. For my upcoming project, I'm going to need (=
> very strong desire) to use Ada and I'm also going to need to be able to
> license the executable produced thereof in any way I desire.

For licensing in arbitrary ways, the aforementioned Ada distribution is not
the suitable one. Another compiler distribution might meet your needs,
including some FSF GNAT. GPL means tit-for-tat and thus intentionally puts
restrictions on licensing, no back doors.


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

* Re: Licensing Paranoia and Manual Compilation Issues
  2018-12-11 16:31   ` Lucretia
@ 2018-12-11 19:21     ` Simon Wright
  2018-12-11 20:50       ` alexander
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Wright @ 2018-12-11 19:21 UTC (permalink / raw)


Lucretia <laguest9000@googlemail.com> writes:

> On Tuesday, 11 December 2018 16:11:51 UTC, Simon Wright  wrote:
>> Let me start by saying that I'm not a lawyer.
>
> What version is that compiler on sourceforge? Is it from FSF directly,
> i.e. gcc.gnu.org? Or is it GNAT-GPL/CE, i.e. from AdaCore.com? If the
> latter, the licence is GPL-3.0 no linking exception, otherwise it's
> GPL-3.0 with linking exception. Basically, avoid anything GPL-3.0 no
> linking exception, especially Adacore's libraries.

It's vanilla FSF with Adacore libraries, some of which have the runtime
library exception, some of which don't (as noted at the link).

The Adacore sources, at https://github.com/AdaCore, are on the whole
GPLv3 with the runtime exception. I've taken care to report the status:
from https://sourceforge.net/projects/gnuada/files/GNAT_GCC%20Mac%20OS%20X/8.1.0/native-2017/,

========================================================================

Tools included:

Full GPL:
  ASIS from https://github.com/simonjwright/ASIS at [8ba68f3].
  AUnit and GDB from GNAT GPL 2017.
  Gprbuild from https://github.com/AdaCore/gprbuild at commit [1e551df]
     (note, libgpr is GPL with Runtime Library Exception[1]).

GPL with Runtime Library Exception[1]:
  GNATCOLL from:
    https://github.com/AdaCore/gnatcoll-core at commit [a093d11].
    https://github.com/AdaCore/gnatcoll-bindings at commit [2c426fe].
    https://github.com/AdaCore/gnatcoll-db at commit [b66441c].
  XMLAda from https://github.com/AdaCore/xmlada at commit [8a4b2bf]


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

* Re: Licensing Paranoia and Manual Compilation Issues
  2018-12-11 19:21     ` Simon Wright
@ 2018-12-11 20:50       ` alexander
  2018-12-11 23:45         ` Simon Wright
  0 siblings, 1 reply; 12+ messages in thread
From: alexander @ 2018-12-11 20:50 UTC (permalink / raw)


> Building a dynamic library (do you mean .so? are you on a Mac or Linux? 
> You mention my darwin 8.1.0 release) is more so. 

Yes. According to (this page)[1] it's accomplishable using the following command:

$ gcc -shared -o libmy_lib.so *.o

but that causes an error mentioning how there are "Undefined symbols for architecture x86_64:".

> For licensing in arbitrary ways, the aforementioned Ada distribution is not 
> the suitable one. Another compiler distribution might meet your needs, 
> including some FSF GNAT. GPL means tit-for-tat and thus intentionally puts 
> restrictions on licensing, no back doors.

GPL on its own, I must say, does serve a purpose. It's nice for the author to be able to share their source or works and still be certain nobody can (legally anyway) steal their work and distribute it for a fee themselves.

When it comes to source code licensed under GPL lacking the runtime library exception, on the other hand, I can't say I'm too fond of it. Compilers on their own, featuring a standard library, should always be free to use; whereupon the user may licence their executable in any way they want.

[1] http://beru.univ-brest.fr/~singhoff/DOC/LANG/ADA/gnat_ugn_20.html

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

* Re: Licensing Paranoia and Manual Compilation Issues
  2018-12-11 20:50       ` alexander
@ 2018-12-11 23:45         ` Simon Wright
  2018-12-12  9:34           ` alexander
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Wright @ 2018-12-11 23:45 UTC (permalink / raw)


alexander@junivörs.com writes:

> I wrote:
>> Building a dynamic library (do you mean .so? are you on a Mac or
>> Linux?  You mention my darwin 8.1.0 release) is more so.
>
> Yes. According to (this page)[1] it's accomplishable using the
> following command:
>
> $ gcc -shared -o libmy_lib.so *.o
>
> but that causes an error mentioning how there are "Undefined symbols
> for architecture x86_64:".

> [1] http://beru.univ-brest.fr/~singhoff/DOC/LANG/ADA/gnat_ugn_20.html

Because that page (and even the latest one at [2]) is wrong.

Almost all Ada code requires the services of the Ada runtime, and you
need to reference the runtime at the link stage.

$ gcc -shared -o libmy_lib.dylib *.o -L<whereever> -lgnat -lgnarl

(<whereever>: e.g. /opt/gcc-8.1.0/lib/gcc/x86_64-apple-darwin15/8.1.0/adalib)

This is why it is *so* much easier to use gprbuild (I see that that
reference talks about using gnatmake; that's because gnatmake is part of
GCC Ada, and gprbuild isn't. But modern gnatmakes will delegate to
gprbuild if they find one, at any rate if libraries are involved; they
can't generate libraries, because it's too complicated for Adacore to
maintain in two places, the GCC tree and the gprbuild tree).

If you want to see what's going on you can use -v.

[2] http://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn/the_gnat_compilation_model.html#general-ada-libraries

> Someone else wrote:
>> For licensing in arbitrary ways, the aforementioned Ada distribution
>> is not the suitable one. Another compiler distribution might meet
>> your needs, including some FSF GNAT. GPL means tit-for-tat and thus
>> intentionally puts restrictions on licensing, no back doors.
>
> GPL on its own, I must say, does serve a purpose. It's nice for the
> author to be able to share their source or works and still be certain
> nobody can (legally anyway) steal their work and distribute it for a
> fee themselves.
>
> When it comes to source code licensed under GPL lacking the runtime
> library exception, on the other hand, I can't say I'm too fond of
> it. Compilers on their own, featuring a standard library, should
> always be free to use; whereupon the user may licence their executable
> in any way they want.

I don't understand. The first para says it's good, the second says it's
bad.

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

* Re: Licensing Paranoia and Manual Compilation Issues
  2018-12-11 23:45         ` Simon Wright
@ 2018-12-12  9:34           ` alexander
  2018-12-12 17:44             ` Simon Wright
  2018-12-13  9:21             ` Björn Lundin
  0 siblings, 2 replies; 12+ messages in thread
From: alexander @ 2018-12-12  9:34 UTC (permalink / raw)


> I don't understand. The first para says it's good, the second says it's
> bad.

Perhaps I've misunderstood something regarding the licensing situation. Is not the reason you cannot use a bunch of AdaCore developed packages due to the fact that it's licensed under GPL without the runtime library exception, ultimately meaning your executable must be licensed under GPL too?

Let's assume someone made a tool to aid people with a repetitive task in Ada. Give that the GPL license and it'd be impossible for someone to "steal" (redistribute for a fee) the original author's code, still allowing people to learn from the code that makes up the tool.

In the second situation, I'm speaking of any library package offering nigh on essential functionality to a programming language (in this case Ada), that does not contain the runtime library exception. I believe that all code developed to ship with a compiler should contain that exception.

I will make sure to await further responses before I justify my belief mentioned in the previous paragraph, should I prove to having gotten something wrong.

---

Whilst quickly scouring the Internet for some information that would substantiate the claim that some library package files do not contain the runtime library exception, I came across the (`GNAT.Regpat` source)[1], which does contain some form of the runtime library exception.

I presume perhaps that is an older source file than the one shipped with the compiler at this day (Copyright (c) 1996-2002)?

[1] https://www2.adacore.com/gap-static/GNAT_Book/html/rts/g-regpat__adb.htm

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

* Re: Licensing Paranoia and Manual Compilation Issues
  2018-12-12  9:34           ` alexander
@ 2018-12-12 17:44             ` Simon Wright
  2018-12-13  9:21             ` Björn Lundin
  1 sibling, 0 replies; 12+ messages in thread
From: Simon Wright @ 2018-12-12 17:44 UTC (permalink / raw)


alexander@junivörs.com writes:

> Perhaps I've misunderstood something regarding the licensing
> situation. Is not the reason you cannot use a bunch of AdaCore
> developed packages due to the fact that it's licensed under GPL
> without the runtime library exception, ultimately meaning your
> executable must be licensed under GPL too?

> In the second situation, I'm speaking of any library package offering
> nigh on essential functionality to a programming language (in this
> case Ada), that does not contain the runtime library exception. I
> believe that all code developed to ship with a compiler should contain
> that exception.

AdaCore provide software to their customers with the runtime library
exception. When they make a CE release, they run a tool over all the
sources which removes the exception (you'll see this by the blank
section in the middle of the header comments).

This is their business, their choice.

The FSF source tree (compiler, runtime, tools) contains the exception.

It used to be that you could only get additional package sources
(GNATColl etc) via the CE releases. Nowadays, many of these packages are
available via Github, and most (all?) have the runtime library exception
included.

Some, such as ASIS, are still only available via the CE route.

> Whilst quickly scouring the Internet for some information that would
> substantiate the claim that some library package files do not contain
> the runtime library exception, I came across the (`GNAT.Regpat`
> source)[1], which does contain some form of the runtime library
> exception.
>
> I presume perhaps that is an older source file than the one shipped
> with the compiler at this day (Copyright (c) 1996-2002)?
>
> [1] https://www2.adacore.com/gap-static/GNAT_Book/html/rts/g-regpat__adb.htm

I've not had access to GAP but maybe the sources would have had the same
bowdlerisation as CE. Anyway, that set of pages was made in 2004, and
the current state of g-regpat.adb in CE/FSF is as I stated above.

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

* Re: Licensing Paranoia and Manual Compilation Issues
  2018-12-12  9:34           ` alexander
  2018-12-12 17:44             ` Simon Wright
@ 2018-12-13  9:21             ` Björn Lundin
  2018-12-13 10:30               ` alexander
  1 sibling, 1 reply; 12+ messages in thread
From: Björn Lundin @ 2018-12-13  9:21 UTC (permalink / raw)


On 2018-12-12 10:34, alexander@xn--junivrs-e1a.com wrote:
> Let's assume someone made a tool to aid people with a repetitive task in Ada. Give that the GPL license and it'd be impossible for someone to "steal" (redistribute for a fee) the original author's code, still allowing people to learn from the code that makes up the tool.

You can always "steal" GPL code, and redistribute it for a fee as you
see fit.
The freedom in GPL is not free as free beer, but free as free speach.
So you would need to provide the sources to the customers you sell to.
And I think, a fairly easy way to reproduce an executable/library.

You code depending on GPL (linked with) will inherit the GPL license.
But you can charge your customers whatever you want.

However you likely need to provide something better that the original
code for people _wanting_ to pay you, I guess.


-- 
--
Björn


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

* Re: Licensing Paranoia and Manual Compilation Issues
  2018-12-13  9:21             ` Björn Lundin
@ 2018-12-13 10:30               ` alexander
  2018-12-13 10:32                 ` alexander
  0 siblings, 1 reply; 12+ messages in thread
From: alexander @ 2018-12-13 10:30 UTC (permalink / raw)


> You can always "steal" GPL code, and redistribute it for a fee as you
> see fit.
> The freedom in GPL is not free as free beer, but free as free speach.
> So you would need to provide the sources to the customers you sell to.
> And I think, a fairly easy way to reproduce an executable/library.
> 
> You code depending on GPL (linked with) will inherit the GPL license.
> But you can charge your customers whatever you want.
> 
> However you likely need to provide something better that the original
> code for people _wanting_ to pay you, I guess.

I don't know wherefrom I got my information that you can't sell a GPL application. Thank you for clarifying this!

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

* Re: Licensing Paranoia and Manual Compilation Issues
  2018-12-13 10:30               ` alexander
@ 2018-12-13 10:32                 ` alexander
  0 siblings, 0 replies; 12+ messages in thread
From: alexander @ 2018-12-13 10:32 UTC (permalink / raw)


> I don't know wherefrom I got my information that you can't sell a GPL application. Thank you for clarifying this! 

Or rather, clarifying the contrary; correcting me.

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

end of thread, other threads:[~2018-12-13 10:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 11:46 Licensing Paranoia and Manual Compilation Issues alexander
2018-12-11 16:11 ` Simon Wright
2018-12-11 16:31   ` Lucretia
2018-12-11 19:21     ` Simon Wright
2018-12-11 20:50       ` alexander
2018-12-11 23:45         ` Simon Wright
2018-12-12  9:34           ` alexander
2018-12-12 17:44             ` Simon Wright
2018-12-13  9:21             ` Björn Lundin
2018-12-13 10:30               ` alexander
2018-12-13 10:32                 ` alexander
2018-12-11 18:50 ` G. B.

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