On 10/30/2012 11:11 PM, David Ostrovsky wrote:
On 30.10.2012 22:03, Kohei Yoshida wrote:
So, this script can add -g to the CXXFLAGS, but unfortunately the
symbols get stripped during linking because of -Wl,-S option passed to
the linker.

grep -r LINKERSTRIPDEBUGFLAGS *
LinkTarget.mk:gb_LinkTarget__get_stripldflags=$(if $(call
gb_LinkTarget__debug_enabled,$(1)),,$(gb_LINKERSTRIPDEBUGFLAGS))
platform/unxgcc.mk:gb_LINKERSTRIPDEBUGFLAGS := -Wl,-S

But why something like that would be needed anyway? If you don't want
symbols, don't use -g and If you do have symbols don't strip it!
I would recommend to follow the rule of least surprise: no one expects
the symbols to be stripped.
Would it be an option to remove that magic behaviour or at least turn it
off per default?

Yes, I was wondering similarly when reading this thread. My guess was that gb_LINKERSTRIPDEBUGFLAGS was a relic from past attempts at getting all these settings into a useful state, and that we should just get rid of it. But looking closer, it only got added recently with Lubos's <http://cgit.freedesktop.org/libreoffice/core/commit/?id=84b4293e3dc6edd59e7d09383320361aaeed9e87> "allow LDFLAGS from gbuild to be selective too":

+# similar for LDFLAGS, use linker optimization flags in non-debug case,
+# but moreover strip debug from libraries for which debuginfo is not wanted
+# (some libraries reuse .o files from other libraries, notably unittests)
+gb_LinkTarget__get_stripldflags=$(if $(call 
gb_LinkTarget__debug_enabled,$(1)),,$(gb_LINKERSTRIPDEBUGFLAGS))
+gb_LinkTarget__get_debugldflags=$(if $(call 
gb_LinkTarget__debug_enabled,$(1)),,$(gb_LINKEROPTFLAGS) $(call 
gb_LinkTarget__get_stripldflags,$(1)))

Stephan
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to