last day (15 days later) » 

05:48
17
Q: Is it legal to distribute GPL software compiled with a nonfree compiler?

Blacklight MGSuppose there is a GPL program. Say I used a closed source "compiler" to build it. In building so, I pulled in a proprietary library, but I considered it part of my compiler. Because the compiler is also proprietary. Of course, the program can be built using GCC / Clang. However, it won't have my...

Please provide more information on "proprietary build modifications".
Are you asking about your compiler linking in a normal, expected, general-purpose library (say, inlining math functions)? Or are you asking about the compiler patching the program to give it functionality that is not expressed in the source code?
@marcelm Yes exactly, the "compiler" patching the program to give it functionality that is not expressed in the source code.
@ruben2020 same as what I replied to marcelm
Do i wonder - if a prop compiler injects non-default or non-generic modifications - it already is bend - might it not fully work in non-local systems ?
This doesn't directly answer your question, but something to consider: The parts of the GCC compiler which end up getting linked into the final compiled program are under a different license from the rest of the compiler, to avoid this issue in the other direction.
05:48
@user193243 it is designed to build a standard executable, and not pull any shared libraries aside from what a system has.
@GlennWillen That is glibc, under LGPL. But I'm not dynamically linking again. glibc is not a part of GCC, it just often comes together. My own system (Void Linux) is using musl libc, not glibc.
no, not glibc. The gcc runtime library, "libgcc": gnu.org/licenses/gcc-exception-3.1.en.html This is the library with the stuff that's not usually optional, like the code that calls "main" at the start of execution.
There is a real compiler for which this question seems to apply. The Intel C/C++ compiler. As I recall this is/was a non-free compiler that generated code which depended on an extra support library (presumably non-GPL compatible) in a separate shared object called libicc.so but I don't recall the license conditions under which one was allowed to distribute such support code. Most likely it was not GPL compatible and thus presumably not usable for distributing GPL-compatible binaries, but I cannot find a definitive answer to this at the moment, nor on here nor on other SE sites.
A simple rule of thumb is if the end user can modify the source code and recompile in a normal environem, it's probably OK. But if they have to purchase the same proprietary compiler or link with a third-party proprietary library, no go.
I think that depends. If the proprietary library is pulled in and modifies the GPLd code during compilation by way of optimisations, rather than just embedding extra code. That's a different situation.
@ScottishTapWater That is precisely the question, but I think JBYoshi's answer covers it perfectly. It would be considered a "system library", or at least, if I just call it something like EvilC, that would become a "standard interface", in which case an open implementation is necessary. Otherwise it is simply a program compiled in EvilC, and no compiler is provided for building the source code.
@Brandin Yes, Intel C/C++ compiler is exactly the kind of thing I was considering as a reference. But I couldn't find any reference either, because most people using it would be working with proprietary products.
05:48
Can you rephrase 'I pulled in a proprietary library, but I considered it part of my compiler'? I for one fail to follow that in general or technical English. Can you say how the compiler being proprietary might matter? Can you say what using GCC / Clang might change? Can you say how any build modifications are 'provided' by your compiler, not by yourself?
@RobbieGoodwin The key is to understand that this is a specifically crafted plan to bypass the rules by finding loopholes in the wording of GPL. So, in this case, in order to design such a compiler, realistically I'd have to first build a library as separate from the compiler. But then, to bypass the law, I'll create a compiler for a new programming language, EvilC which is a combination of ANSI C + my proprietary library. The compiler being proprietary here is so that only I can make use of my library, which is now part of EvilC. If I released EvilC compiler, my evil plans would be pointless.
@RobbieGoodwin The difference with using GCC/Clang is that they follow an open implementation of the C standard, and while they may add their modifications, they are open source. Now aside from JBYoshi's answer breaking my evil plan by requiring an open implementation of the compiler, Intel's Clear Linux OS for example does not even ship binaries built with Intel C/C++ compiler, even if the source can be compiled with other compilers, since it is C/C++. One reason could be that to use icc, we'd need to modify the source code, which will make it lack a free implementation.
@RobbieGoodwin Another reason could simply be that they don't want to mess with GPL. The official explanation is that it doesn't meet their package inclusion guidelines. My proprietary language can be thought of as similar to Objective-C and Swift, which are Apple specific programming languages, and have little use with other systems (but I do know that they import Cocoa rather than consider Cocoa as part of the language). Except, in my case, instead of porting the code to fit my standard, I'm creating a standard to fit an open source project's code.
No reason you shouldn’t exploit every loop-hole in sight yet Isn’t by-passing the rules rather different from the OQ’s ‘is it legal? Isn’t building a library separate from the compiler quite different from using a closed-source compiler? Isn’t creating a compiler for a new programming language worlds apart? What does GCC/Clang following open implementation of C have to do with non-free compilers? If you’re creating a standard why are you asking about GPL?
@RobbieGoodwin I don't think you understood. See, I'm neither creating a standard, nor am I interested in breaking GPL. My hypothetical idea is to test whether GPL code can be legally converted to nonfree project. That is, for example, the source code of a GPL project remains C/C++, however, the compiler which creates the binary isn't reading the code as ISO C/C++, but instead as a closed standard EvilC. That much seemed legal according to me, since generating the same binary hash is not required to fulfil GPL.
@RobbieGoodwin The reason this question is about GPL is because I wanted to see if GPL can do its duty in such a situation. Reproducible builds can be used to generate the same binary hashes, and that concept seems to have been overlooked when GPLv2/v3 was written. Mandating at least one free reproducible build system would've been a good defense against such a situation, had GPL not been able to defend itself in other ways. Turns out it can hold up, according to the answer. Hence my question.
So you're creating a standard to fit an open source project's code but you're neither creating a standard, nor interested in breaking GPL, and you don't think I understood? Doesn't 'clear as mud' spring to mind. If you don't view identifying a loophole, which will need a better GPL, as being interested in breaking GPL, that suggests you're confusing end and means; method with motive. Back at the Question, can you untangle how it could be legal to distribute anything built with a 'non-free' compiler? More…
Further… What surely i don't understand is how 'to distribute GPL software compiled with a non-free compiler' is close to testing 'whether GPL code can be legally converted to non-free project' when they look more like opposites.
@RobbieGoodwin "So you're creating a standard to fit an open source project's code but you're neither creating a standard, nor interested in breaking GPL, and you don't think I understood?" - You see, I'm not creating a standard, nor am I interested in breaking GPL, because I support free software, and therefore, I find no personal interest in breaking GPL. But I have interest to see if a hypothetical evil person will be able to bypass the protection of GPL via what I think is a loophole. I wasn't confusing method with motive, it's just my choice of words causing misunderstandings.
05:48
Please don't. Please just explain, dismiss or otherhow resolve the blatant contradictions I raised in my last Comment.
@RobbieGoodwin I don't know how to explain it to you better. StackOverflow comments section is not for extended discussions, hence my replies have been moved to the chat. I think you're not familiar with the ways of this site. I did not move it to chat in the same manner as asking you to continue the conversation in WhatsApp. There are no contradictions, you've misinterpreted what I was talking about.
If the program in question can be built with GCC/Clang/etc. OR it can be built with your EvilC compiler (which is closed source/"evil"), could you explain what is the advantage of using the EvilC-built version? E.g. does it have, say, 5-10% better performance in some use cases than the GCC/Clang-compiled version, or does using the EvilC build chain result in a completely different program from an end-user perpsective? Also, are you supplying EvilC to the public (perhaps with a reasonable fee) or are you planning to keep all implementations of this top-secret or something?
Thanks for your view, and mine is that you're less familiar than you imagine with either English or logic. Other opinions are available and until someone Posts some of them, why not go back and explain how I misinterpreted which part of what you're talking about? You can explain, can't you?
@RobbieGoodwin It is already mentioned in the chat. See that reply saying "Let us continue this discussion in chat?" Click the link. My replies just got automatically moved there because StackExchange does not want the comments section to be populated with unnecessary replies. I clearly said that "my replies have been moved to the chat." And it happened automatically, not because I refused to explain in the replies here.

last day (15 days later) »