Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 593670 - sci-mathematics/octave-4.0.3: liboctinterp.so missing -lz linkage
Summary: sci-mathematics/octave-4.0.3: liboctinterp.so missing -lz linkage
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Mathematics related packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 593674
  Show dependency tree
 
Reported: 2016-09-13 15:29 UTC by Michał Górny
Modified: 2019-08-25 01:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
sci-mathematics:octave-4.0.3:20160913-134139.log.bz2 (sci-mathematics:octave-4.0.3:20160913-134139.log.bz2,67.38 KB, application/x-bzip)
2016-09-13 15:29 UTC, Michał Górny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-09-13 15:29:31 UTC
Created attachment 445608 [details]
sci-mathematics:octave-4.0.3:20160913-134139.log.bz2

To reproduce, set:

  LDFLAGS="... -Wl,-z,defs"

As a result:

libtool: link: x86_64-pc-linux-gnu-g++-5.4.0 [...] -o .libs/liboctinterp.so.3.1.1

fails with:

/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: corefcn/.libs/libcorefcn.a(corefcn_libcorefcn_la-c-file-ptr-stream.o): undefined reference to symbol 'gzwrite'
/lib64/libz.so.1: error adding symbols: DSO missing from command line

which indicates that the shared library needs to be linked to -lz.

The problem is not noticed without -Wl,-z,defs because apparently -lz is implicitly linked by all programs using the library.

While solving this, please also try to convince upstream into linking their shared libraries with -Wl,-z,defs (when supported by the linker) to prevent these kind of issues in the future.
Comment 1 David Seifert gentoo-dev 2016-09-24 12:45:05 UTC
Please try again.

commit 430460192fa2d64c196a18b34d386d4f244f5755
Author: David Seifert <soap@gentoo.org>
Date:   Sat Sep 24 14:43:45 2016 +0200

    sci-mathematics/octave: Fix zlib underlinking
    
    Gentoo-bug: 593670
    * [QA] Add -Wl,-z,defs to LDFLAGS
    * Make dependency on sys-libs/zlib unconditional
Comment 2 Larry the Git Cow gentoo-dev 2019-08-25 01:12:24 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28712fe5aac4a7328f54bfc23bab8e0a10343a19

commit 28712fe5aac4a7328f54bfc23bab8e0a10343a19
Author:     Benda Xu <heroxbd@gentoo.org>
AuthorDate: 2019-08-25 01:10:13 +0000
Commit:     Benda Xu <heroxbd@gentoo.org>
CommitDate: 2019-08-25 01:12:08 +0000

    sci-mathematics/octave: Bump to 5.1.0.
    
      Adopted to ${PN}-5.1.0-pkgbuilddir.patch with minor changes.
    
      Removed --without-OSMesa as the option is no longer available.
    
      Removed --Wl,-z defs, because upstream designed the related objects
      as loadable plugins.
    
    Reference: http://savannah.gnu.org/bugs/?53627
    Suggested-By: Fabio Rossi
    
    Bug: https://bugs.gentoo.org/593670
    Closes: https://bugs.gentoo.org/661048
    Closes: https://bugs.gentoo.org/679654
    
    Signed-off-by: Benda Xu <heroxbd@gentoo.org>

 sci-mathematics/octave/Manifest                    |   1 +
 .../octave/files/octave-5.1.0-pkgbuilddir.patch    |  43 +++++
 sci-mathematics/octave/octave-5.1.0.ebuild         | 192 +++++++++++++++++++++
 3 files changed, 236 insertions(+)