static compilation is broken!?
Bug #594395 reported by
Jan
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openWNS SDK |
New
|
Undecided
|
Unassigned |
Bug Description
When I try to compile the simulator statically (e.g. playground.py install --static), it will put all the *.a static library files into sandbox/dbg/lib but the executable in sandbox/bin/openwns is only 130kB big - obviously not statically linked. Also, when I try to run it, it complains about missing .so libraries.
Is it currently possible to link statically to get one big executable that contains all necessary library functions?
Cheers
Jan
To post a comment you must log in.
After talking to Maciej, I did some more testing. The above mentioned problem with static compiling only seems to happen if the simulator has previously been compiled non-static. If it is freshly checked our or if "scons -c" has been run before, static compilation succeeds.
However, the current static build is not suitable for running the static binary on machines with slightly different Linux installations. If, e.g., the boost library version is different, the static openwns still would not run because only some libraries are included in the archive (everything between -whole-archive and -no-whole-archive in the example below). Is there a way to include more in the static binary? I tried removing the "-no-whole-archive" part but could not make it compile then.
g++ -o .build/ dbg/openwns- application/ openwns -Wl,--whole-archive -lcopper -lofdmaphy -lwifimac -lwimac -lip -lconstanze -lrise -ltcp -lwns -lglue -ldllbase -lsimpletl -Wl,--no- whole-archive -Wl,-disable- new-dtags .build/ dbg/openwns- application/ src/Main. o -Lsandbox/dbg/lib -lboost_ filesystem- mt -lboost_ program_ options- mt -lm -ldl -lpython2.6 -lutil -lwns -lboost_ date_time- mt -lpthread -lcppunit -lboost_signals-mt
Cheers
Jan