From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Licensing Paranoia and Manual Compilation Issues Date: Tue, 11 Dec 2018 16:11:48 +0000 Organization: A noiseless patient Spider Message-ID: References: <6bee0ed3-c298-45c9-81b0-92cc90a1f2c6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: reader01.eternal-september.org; posting-host="c1729f28d82404a0f3a538116e1133de"; logging-data="17343"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uZPwn7YDXNTJ4R2vpGCsL4JDVXLMJZnU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) Cancel-Lock: sha1:cP0ON9WB5WZkmz+dJy89ifBEvRg= sha1:O1YquPHpUZ0VT0uvBfjTzss/4uQ= Xref: reader01.eternal-september.org comp.lang.ada:55014 Date: 2018-12-11T16:11:48+00:00 List-Id: 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 > `? `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 `. 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.