Download it now!
Bug 47246 - EasyHack: Remove the duplicate linked objects in gbuild
Summary: EasyHack: Remove the duplicate linked objects in gbuild
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other All
: medium normal
Assignee: Michael Stahl (CIB)
URL:
Whiteboard: target:3.6.0
Keywords: difficultyBeginner, easyHack, skillScript
Depends on:
Blocks:
 
Reported: 2012-03-12 11:33 UTC by Björn Michaelsen
Modified: 2015-12-16 00:18 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Michaelsen 2012-03-12 11:33:43 UTC
Duplicate linked objects are do not have to be a deadly problem, but they can introduce very hard to debug problems. As we set stuff like compile flags and include paths on the linktarget (aka the library) and in the above case the object file is linked in by two libraries, the flags it is compiled with are actually nondeterministic. That is Very Bad(tm)!

So the smoketest/smoketest.cxx will either be compiled with the CFLAGS of Library/libsmoketest.so or with those of CppunitTest/libtest_smoketest.so -- actually it can be compiled different on different machines with the same code. It can even be compiled different on the same machine! So again: This is Very Bad(tm) and we should probably never ever have let that happen.

Now it might be possible that the one doing the initial migration carefully checked that both libs are compiled exactly the same on all platforms (I highly doubt that), but even then this totally unproof against future changes. Someone might innocently add a define to the compile flags of one library and create a terribly hard to reproduce heisenbug.

So this has to go, it should never have been there in the first place. How can this be removed?

There are two possibilities:
a) create a smoketest/smoketest_libtest_smoketest.cxx with this content:
   
    #include "smoketest.cxx"

   and then use that file instead of smoketest/smoketest.cxx in
   CppunitTest/libtest_smoketest. That way, the object gets build twice (with
   possibly different flags and defines) and everything is fine.
   Ugly, but does the job.
b) create a static library smoketest and add the smoketest/smoketest.cxx to it.
   Now instead link that static library into both of the dynamic ones and
   everything is fine.

Once all the warnings are gone, we should probably make gbuild abort if it detects one of those.
Comment 2 Michael Stahl (CIB) 2012-03-12 12:19:35 UTC
hi Bjoern,

thanks for writing this description for why these warnings are bad,
but i'm afraid i've fixed most of these today before you even filed this bug.

well, perhaps some are still around that don't happen on Linux
or require some esoteric configuration to trigger...
Comment 3 Björn Michaelsen 2012-03-13 06:54:46 UTC
Resolving, also duplicate objects are now an error:

http://cgit.freedesktop.org/libreoffice/core/commit/?id=58f5a26e2d4d6998a30e423ac67335cf62e97226
Comment 4 Not Assigned 2012-03-13 06:57:00 UTC
Bjoern Michaelsen committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=58f5a26e2d4d6998a30e423ac67335cf62e97226

fdo#47246: abort on duplicate linked objects
Comment 5 Not Assigned 2012-03-13 10:40:18 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f33b3791edf7ae8eba979c16d3338ef7c0b4a768

Related fdo#47246: Extract objects used in both svp and gtk3 plugins
Comment 6 Not Assigned 2012-03-14 04:39:05 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5cc6398985181574b68ab15386176fb806386490

fdo#47246: desktop: factor out a winlauncher static library
Comment 7 Not Assigned 2012-03-14 05:28:55 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fe4be5047988782f3143a1af505c5eecb3f2af5a

fdo#47246: dtrans: fix multiply linked ImplHelper
Comment 8 Not Assigned 2012-03-14 08:30:12 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=813a57cb1afa16bb306ced96d367fa1f55906620

fdo#47246: desktop: factor out a winextendloadenv static library
Comment 9 Not Assigned 2012-03-14 08:30:45 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5142e628b563a9876e8884c5dd4914eff4a2f307

fdo#47246: fpicker: merge fop library into fps:
Comment 10 Not Assigned 2012-03-14 13:15:21 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=16e3e5437efe38308615d42924baa735f94b2484

fdo#47246: ucpodma: fix duplicate linked object
Comment 11 Not Assigned 2012-03-14 13:15:48 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a13a88bd2c673d059b60e339dcf3b8fabf991f18

fdo#47246: canvas: split out static library directxcanvas
Comment 12 Not Assigned 2012-03-15 02:38:20 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f04e6b0e965e3a4301e705fb41a15c5560765b5b

fdo#47246: fpicker: merge fop into fps: remove Fopentry.cxx
Comment 13 Rainer Bielefeld Retired 2012-04-05 08:12:35 UTC
I added Fix submitter as assignee because this will ease queries and bug tracking.
Comment 14 Björn Michaelsen 2012-04-10 11:10:19 UTC
I didnt fix, Michael did. I only elaborated on the issue.
Comment 15 Not Assigned 2012-05-16 04:41:33 UTC
Riccardo Magliocchetti committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b576aa1318ebdfea8349c23da7a8b1237156a8f9

fdo#47246: vcl: fix --enable-headless build
Comment 16 Robinson Tryon (qubit) 2015-12-16 00:18:20 UTC
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner SkillScript )
[NinjaEdit]