[Users] [Bug 3819] New: Duplicate definition of global pygtk symbols

noreply at thewildbeast.co.uk noreply at thewildbeast.co.uk
Sat Apr 29 21:23:52 CEST 2017


http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=3819

            Bug ID: 3819
           Summary: Duplicate definition of global pygtk symbols
    Classification: Unclassified
           Product: Claws Mail
           Version: other
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Other
          Assignee: users at lists.claws-mail.org
          Reporter: hanno at hboeck.de

Created attachment 1748
  -->
http://www.thewildbeast.co.uk/claws-mail/bugzilla/attachment.cgi?id=1748&action=edit
claws-mail-3.15.0-fix-no-common.patch

When including the pygtk headers they create some global symbols. See e.g. this
in pygtk.h:
#if defined(NO_IMPORT) || defined(NO_IMPORT_PYGTK)
extern struct _PyGtk_FunctionStruct *_PyGtk_API;
#else
struct _PyGtk_FunctionStruct *_PyGtk_API;
#endif

If these headers get included multiple times then the symbol is defined
multiple times, which is not strictly correct C. Other files using the same
global symbol have to mark it with "extern". pygtk does that if some #define
commands are set. claws includes these headers in two files
(src/plugins/python/clawsmailmodule.c, src/plugins/python/python-hooks.c).

Now by default gcc is lax with this and will accept duplicate symbols. However
it can be turned into a more strict mode with the "-fno-common" flag. To
reproduce:

./configure CFLAGS="-O2 -fno-common"; make

It will show an error like this:
.libs/python_la-python-hooks.o:(.bss+0x8): multiple definition of
`_PyGObject_API'
.libs/python_la-clawsmailmodule.o:(.bss+0x8): first defined here
.libs/python_la-python-hooks.o:(.bss+0x0): multiple definition of `_PyGtk_API'
.libs/python_la-clawsmailmodule.o:(.bss+0x0): first defined here


To fix this the proper #define commands need to be set in one of the files
including the pygtk headers. I have attached a patch to do that in
clawsmailmodule.c. Please apply.

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Users mailing list