[Development] Platform / compiler support

Craig.Scott at csiro.au Craig.Scott at csiro.au
Tue Nov 8 23:03:52 CET 2011


It occurred to me after my previous email that people may not be aware of what the LSB compilers do, so let me provide just a little bit of info to explain why they should be considered explicitly in addition to plain GCC compilers. In a nutshell, when you build your app with the LSB compilers, it will fail to build if your code uses types, interfaces, etc. that are not covered by the LSB. In addition, it invokes the linker in such a way that you get warnings when linking to libraries that are not in the LSB and it also tries to pull in those non-LSB libraries statically instead of dynamically (you can override this where needed). So the LSB compilers should have the same compiler *features* as the underlying gcc, but the supported interfaces, etc. are restricted to just those in the LSB.

For Qt source code, supporting the LSB compiler ends up being similar to supporting GCC, with a few special cases where you need to put in LSB-specific bits (eg an alternative implementation for a function call that the LSB does not provide). On the plus side, if it builds with LSB compilers, then the code should also build with GCC. Of course, you can shoot yourself in the foot by changing the code that gets compiled between the LSB and non-LSB compiler (eg #ifdef blocks that build with LSB but not with non-LSB), but that's a different issue. ;)


On 09/11/2011, at 8:48 AM, Scott, Craig (CMIS, Clayton) wrote:

> 
> On 08/11/2011, at 9:06 PM, João Abecasis wrote:
> 
>> Dr Craig Scott wrote:
>>> On 08/11/2011, at 1:31 AM, João Abecasis wrote:
>>>> At the bare minimum, I think we should strive to support these compilers:
>>>> 
>>>> - GCC 4.2 and up
>>>> - MSVC 2008 and later
>>>> - Clang (trunk)
>>>> 
>>>> On the page above I also put in a list of platforms, splitting them between Desktop, Embedded and Mobile. The latter two categories only have a placeholder row, while for Desktop I put in the following platform-compiler mappings:
>>>> 
>>>> - Linux: gcc 4.4 (Debian stable)
>>>> - Microsoft Windows 7: MSVC 2008
>>>> - Mac OS X Lion: gcc 4.2, clang 2.9
>>> 
>>> I would strongly suggest that the LSB makes an appearance somewhere in the supported platform/compiler listing. To my knowledge, it is the only truly cross-distribution standard that exists for Linux.
>> 
>> Does the LSB specify a compiler?
> 
> 
> Yes....... to an extent! The LSB builds are performed using the lsbcc and lsbc++ "compilers". I say "compilers" because what they generally do is forward to some other compiler with some additional flags merged into the command line to make that compiler build in "LSB mode". In the vast majority of cases, the underlying compilers are the GNU compilers (gcc and g++), but the LSB standard doesn't explicitly require that to be the case. That said, I think  you'd be pretty safe if you assumed GNU compilers for the purposes of the platform discussions for Qt. The LSB SDK provided by the linux foundation does indeed use the GNU compilers under the covers, so it seems reasonable for us to make this assumption within Qt.
> 
> --
> Dr Craig Scott
> Computational Software Engineering Team Leader, CSIRO (CMIS)
> Melbourne, Australia
> 
> 
> 

--
Dr Craig Scott
Computational Software Engineering Team Leader, CSIRO (CMIS)
Melbourne, Australia






More information about the Development mailing list