Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.