Clang/LLVM using the built in assembler builds all of FreeBSD
lists.cs.uiuc.edu
lists.cs.uiuc.edu
However, as a server admin, I've become fond of the extra layer of protection ProPolice (gcc's "-fstack-protector" option) provides. I know it's a small thing, but does anyone know if clang has a similar feature?
Also, are there any non-default optizations I can try out? With the stock gcc in FreeBSD, I've been able to get away with using "-O3" on everything with no build failures or instability.
https://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-54.1/...
As for non-default optimizations, this passage from the following article best explains how much there is for you to explore:
Which LLVM passes to use, and which order to run them, with what analysis in between, is a huge search problem, though. There are roughly 200 optimization and analysis flags, and these, mostly, can be run in any order, any number of times. If we want to run say, twenty of the passes (about what -O3 does), that’s what, about 10^46 arrangements!
http://donsbot.wordpress.com/2010/03/01/evolving-faster-hask...
But emancipated co-existence would be neat.
AFAIK, your comment is spot on for Linux, though.
However, when someone mentions "most/all" free operating systems, then Linux and related ecosystems are one hell of a big elephant in the room.
You are correct regarding many of the 'ports' (packaging system) though as there will no doubt be some GCC idiosyncratic code in many of them.
So this is definitely something they are already testing.
The clang devs try to support them nonetheless for compatibility, except, for what I understand, a few that are explicitly unsupported by design.
Here's a list of extensions, if you're curious... http://linuxdevcenter.com/pub/a/linux/excerpts/9780596009588...
As the mailing list message specified clang is going to be the default on i386 and x86_64. GCCisms will eventually go away and the code base will be cleaner and more manageable based upon it.
As states in the FreeBSD status report for this last quarter there are already experimental tests being run on the FreeBSD ports build system whereby clang/LLVM are used to compile all of the ports in an attempt to see how far clang/LLVM can get.
LLVM can compile to intermediate code in order to make code optimizing passes more generic and better-defined, to cleaner separate compiler components and phases, to better abstract multiple architectures and to impose restrictions that make some analysis and optimization easier (like enforcing Static Single Assignment for forms), you can create a VM that runs IR directly and distribute that, among many other reasons. So IR does eventually make it to machine code, otherwise it won't be able to do anything.
Why LLVM is better than GCC is a different question. It's better, in my opinion, for being a much cleaner, more well-architected, modern, and much much better modularized code base. Also, I am a happy person when I read Clang docs on parsing vs when I read GCC docs on how to manipulate GIMPLE trees. There are also more objective metrics, like the front end being a very nice, portable library for parsing C-derived languages and exposing more functionality via libclang. (This makes very code-aware IDEs more possible and much easier to write, the use of C syntax for custom work, making custom code scanners and analyzers far easier, etc, etc)
Find more out at http://www.llvm.org
The level of this intermediate representation varies between compilers -- GCC uses a very simplified and strict form of c, while many others use an IR that is closer to assembly. LLVM is not really a competitor to JVM or .NET, but an attempt to define an unified IR that many languages can compile into, be optimized in, and then be compiled into various different machine codes. So that when you write a compiler for a language you only have to write the top layers until your code turns to IR, or if you make a compiler for new platform you only have to write the bottom layers to turn IR into machine code, and in both cases you get free use of all the various IR-level compiler optimizations that have been already built into LLVM.
tinycc is one of the only compilers that directly translates to machine code. This makes it compile very quickly, makes the code base smaller, and as a bonus allows it to be a pretty decent c script 'interpreter'. But it also means that it does not optimise as well.
Tinycc was originally submitted as the winning entry in an obfuscated C code contest - but is surprisingly readable now. Worth a read.
(macroexpand '(loop for x in list minimize (sin x)))
The output depends on your Lisp compiler, but it can get pretty wild. This is why we have the macroexpand-1 function, to just expand the first macro it finds and stop before all collapses into madness.A compiler writer could get a lot of mileage out of this sort of thing. For example, a LET special form could be implemented as a macro that expands to a call to an anonymous function. All the looping forms could be turned into lambdas and recursion. As long as the compiler can handle that sort of thing nicely, this could really simplify the compiler code.
LLVM is much more than that, however. You might want to use it as a JITting interpreter of the IR instead of as a native compiler with all the benefits that may result from this. You may also use it as a sophisticated optimization framework (including cross-object, link-time optimization) taking IR and giving (optimized) IR back.
I understand it never happened, but I am afraid someone somewhere may contribute something relevant and then have the patents bought by a troll.
http://news.ycombinator.com/item?id=1833560
Why don't we pick up where you left off: you can tell us what compilers you use yourself, and tell us how you are protected from the same.
Being able to fork is the ultimate defense to certain corporate evils, but a license that doesn't provide some protection against patents, obviously, won't protect you against that specific evil.
BTW, I use GCC most of the time. And I am shielded from any patented technology Apple may have contributed to it since the NeXT days by the redistribution clause of the GPL.
In you example, if IBM, Microsoft or Intel contributed their own patented tech to GCC, they wouldn't be able to sue any user of the GPL'ed code.
My doubts are about BSD-ish licenses - if contributing your patented tech to a BSD project doesn't put you in position to sue downstream users that didn't receive the right to use it directly from you.
I see no reason to trust a company to behave responsibly towards a community if and when it no longer needs it.
Your insistence in stating the obvious - that nothing protects users from third-party patents - while refusing to acknowledge the question of how much BSD-like licenses protect users from patents owned by those who contribute code to BSD-licensed projects is disturbing.
I think the onus is on you, as the advocate of this clause, to name one actual patent troll case that would have been prevented by it. SCO wouldn't have been prevented. The recent Oracle action against Google would not have been prevented. So which one?
You need to provide protection from actual, plausible danger to justify the doubt, uncertainty, and fear that you are keen to spread.