[cfe-dev] linking and stripping compared to GCC 4.4

Henry Mason thefridgeowl at gmail.com
Mon Nov 29 11:00:04 PST 2010


On Nov 27, 2010, at 8:05 AM, Luc Bourhis wrote:
> ~> g++ -c -DBOOST_PYTHON_MAX_BASES=2 -fPIC -fno-strict-aliasing -DNDEBUG -march=native -O3 -DBOOST_ALL_NO_LIB -DBOOST_DISABLE_THREADS -I../cctbx/boost -I/usr/include/python2.6 demo.cpp
> ~> g++ -o demo.so -shared demo.o -L../cctbx/cctbx_build/lib -lboost_python~>> g++ -o demo_strip.so -s -shared demo.o -L../cctbx/cctbx_build/lib -lboost_python
> ~> ls -lhS
> total 540K
> -rw-r--r-- 1 luc devcom 240K Nov 27 07:50 demo.o
> -rwxr-xr-x 1 luc devcom 170K Nov 27 07:50 demo.so*
> -rwxr-xr-x 1 luc devcom 121K Nov 27 07:50 demo_strip.so*
> -rw-r--r-- 1 luc devcom  902 Nov 27 07:18 demo.cpp
> ~> g++ --version
> g++ (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10)
> 
> to
> 
> ~> clang++ -c -DBOOST_PYTHON_MAX_BASES=2 -fPIC -fno-strict-aliasing -DNDEBUG -O3 -DBOOST_ALL_NO_LIB -DBOOST_DISABLE_THREADS -I/Users/luc/Developer/cctbx/boost -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 demo.cpp
> ~> clang++ -o demo.so -w -bundle -undefined dynamic_lookup demo.o -L$cctbx_build_clang_pch/lib -lboost_python
> ~> clang++ -o demo_strip.so -s -w -bundle -undefined dynamic_lookup demo.o -L$cctbx_build_clang_pch/lib -lboost_python
> ~> ls -lhS
> total 1184
> -rwxr-xr-x  1 luc  luc   203K Nov 27 16:56 demo.so
> -rwxr-xr-x  1 luc  luc   202K Nov 27 16:56 demo_strip.so
> -rw-------  1 luc  luc   178K Nov 27 16:56 demo.o
> -rw-r--r--@ 1 luc  luc   952B Nov 27 05:13 demo.cpp

Any reason why demo.cpp is 952 bytes for clang and 902 bytes for gcc?

Also, it looks like you're comparing Mac OS X to Linux. The binary format on each is very different.

-Henry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101129/3d2313c7/attachment.html>


More information about the cfe-dev mailing list