tensor5 / arch-atom

Repository of Atom and Electron binary packages for Arch Linux
48 stars 5 forks source link

Unused shared libraries #1

Closed tensor5 closed 8 years ago

tensor5 commented 8 years ago

These are namcap warnings for atom and electron packages, reproducible with

$ ldd -r -u /usr/lib/electron/electron
Unused direct dependencies:
    /usr/lib/libplc4.so
    /usr/lib/libexpat.so.1
$ ldd -r -u /usr/lib/atom/node_modules/scrollbar-style/build/Release/scrollbar-style-observer.node
Unused direct dependencies:
    /usr/lib/libpthread.so.0

(same output with keyboard-layout-observer.node and cached-run-in-this-context.node).

tensor5 commented 8 years ago

In electron-0.35.4-1, /usr/lib/libcups.so.2 also appeared in the list of unused direct dependencies; this was fixed in ccb6897 by removing a -lcups. Removing -lplc4 and -lexpat in the same file causes a link error.

tensor5 commented 8 years ago

As of Electron 1.2.0 (02abadd59ac7c616ec3c523951be514d78246f11) there are no more unused direct dependencies in that binary. However, for a more stable solution we should get rid of the -Wl,--whole-archive flag in brightray.gyp.

tensor5 commented 8 years ago

The -Wl,--whole-archive flag was removed from Electron in 10d31b6d51e0cffa9b960d41d0838f4ab1f21bf2. This fixes one part of this issue.

tensor5 commented 8 years ago

Currently the only unused shared libraries are in Atom; this is the relevant namcap output:

atom W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/atom/node_modules/spellchecker/build/Release/spellchecker.node')
atom W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/atom/node_modules/scrollbar-style/build/Release/scrollbar-style-observer.node')
atom W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/atom/node_modules/nslog/build/Release/nslog.node')
atom W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/atom/node_modules/marker-index/build/Release/marker_index.node')
atom W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/atom/node_modules/keyboard-layout/build/Release/keyboard-layout-observer.node')
atom W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/atom/node_modules/cached-run-in-this-context/build/Release/cached-run-in-this-context.node')

According to this GCC bug report this is a consequence of the fact that pthread symbols are referenced through weak symbols, therefore we cannot do anything here other than closing the issue.

NicoHood commented 8 years ago

The linked bug is closed as EOL, but it still exists even on arch. Is there any more information about that, as this github issue is the first hit about this issue?

I've seen this error in multiple packages now and its really annoying.

tensor5 commented 8 years ago

It bothers me too, but apparently according to the link above this is a "feature" of GCC C++ runtime.