Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22299

size optimization in xcode LLVM

$
0
0

I am compiling a C library with xcode 4.5.1 on os x 10.7.5.

The size of the library compiled with xcode LLVM is significantly bigger than when I just compile it using plain gcc with makefile passing the same optimisation arguments -Os (terminal without xcode). GCC produces a 130K binary where apple LLVM produces a 300K binary. Same source code same compiler options.

Wether I look at the iphone simulator version of the binary, the arm7 version or arm 7s version i still get arounf 300K binaries when compiling with xcode. I have used nm on the .a and .o objects and there are no unwanted extra symbols in there.

I remember that my library compiled to 170K with earlier versions of xcode running gcc.

I haven't read anywhere that apple LLVM/clang compiler produces bigger executable so my guess is that i might not be using the optimization settings in xcode properly. For instance I get same 300K larger binary size wether I use setting -Os in Xcode or -O0. Even more confusing, my debug binaries are smaller than my release version. Debug have -O0 settings.

Clearly I am missing something.

Any suggestions for reducing my binary size welcome.


Viewing all articles
Browse latest Browse all 22299

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>