Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 908422 - media-libs/openimageio requires media-libs/opencolorio[-static-libs]
Summary: media-libs/openimageio requires media-libs/opencolorio[-static-libs]
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-13 00:22 UTC by Logan Perkins
Modified: 2023-10-27 11:53 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Logan Perkins 2023-06-13 00:22:55 UTC
If you build opencolorio with the static-libs use flag, it does not build the shared libraries.  This is expected, as opencolorio only supports building state xor shared libraries.  However, openimageio then fails the linking stage, as it depends on opencolorio and needs PIC enabled.  



Reproducible: Always

Steps to Reproduce:
1.  Add media-libs/opencolorio static-libs to /etc/portage/package.use/ocio
2.  Emerge media-libs/openimageio (with USE=-opengl as needed)
3.  Observe the linker error.
Actual Results:  
/usr/libexec/gcc/x86_64-pc-linux-gnu/ld: /usr/lib64/libOpenColorIO.a(OCIOYaml.cpp.o): warning: relocation against `_ZTVN4YAML13BadConversionE' in read-only section `.text._ZN4YAML13BadConversionC2ERKNS_4MarkE[_ZN4YAML13BadConversionC5ERKNS_4MarkE]'
/usr/libexec/gcc/x86_64-pc-linux-gnu/ld: /usr/lib64/libOpenColorIO.a(ColorSpace.cpp.o): relocation R_X86_64_PC32 against symbol `__libc_single_threaded@@GLIBC_2.32' can not be used when making a shared object; recompile with -fPIC
/usr/libexec/gcc/x86_64-pc-linux-gnu/ld: final link failed: bad value
collect2: error: ld returned 1 exit status


Expected Results:  
Successful emerge.

It would be possible to compile the static library with -fPIC, or possibly to add a static-libs use flag to openimageio so that it doesn't need PIC (and make the ebuild require static-libs to match between the two).  However, the simplest solution is to change it to simply require [-static-libs] in its dependencies.
Comment 1 Mike Gilbert gentoo-dev 2023-06-13 01:08:16 UTC
(In reply to Logan Perkins from comment #0)
> If you build opencolorio with the static-libs use flag, it does not build
> the shared libraries.  This is expected, as opencolorio only supports
> building state xor shared libraries.

Setting USE="static-libs" should never disable shared libs. If the build system doesn't support enabling both, the ebuild can/should apply some workaround.