Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 913918 - media-libs/opencv-4.8.0-r1 fails to compile with lto-wrapper related error
Summary: media-libs/opencv-4.8.0-r1 fails to compile with lto-wrapper related error
Status: RESOLVED DUPLICATE of bug 811162
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-10 07:14 UTC by Kfir Ozer
Modified: 2023-10-09 12:01 UTC (History)
1 user (show)

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


Attachments
emerge --info (emerge-info.txt,7.77 KB, text/plain)
2023-09-10 07:14 UTC, Kfir Ozer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kfir Ozer 2023-09-10 07:14:09 UTC
I tried to emerge opencv with cuda and with lto flag, i got an error related to lto, try to compile without and everything worked fine.

i'm using gcc-12.3.1 to compile it since i have latest cuda (12.2.2) installed and it requires gcc-12.




Reproducible: Always

Steps to Reproduce:
USE="lto cuda" emerge opencv
Actual Results:  
lto-wrapper: warning: using serial compilation of 45 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
{standard input}: Assembler messages:
{standard input}:352760: Error: symbol `fatbinData' is already defined
lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
 * ERROR: media-libs/opencv-4.8.0-r1::gentoo failed (compile phase):
 *   ninja -v -j25 -l0 failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 5435:  Called cmake-multilib_src_compile
 *   environment, line 1342:  Called multilib-minimal_src_compile
 *   environment, line 4244:  Called multilib_foreach_abi 'multilib-minimal_abi_src_compile'
 *   environment, line 4511:  Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 4204:  Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 4202:  Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_compile'
 *   environment, line  586:  Called multilib-minimal_abi_src_compile
 *   environment, line 4238:  Called multilib_src_compile
 *   environment, line 4731:  Called cmake_src_compile
 *   environment, line 1460:  Called cmake_build
 *   environment, line 1427:  Called eninja
 *   environment, line 2058:  Called die
 * The specific snippet of code:
 *       "$@" || die -n "${*} failed"
 * 
 * If you need support, post the output of `emerge --info '=media-libs/opencv-4.8.0-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/opencv-4.8.0-r1::gentoo'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="" JAVA_HOME="/etc/java-config-2/current-system-vm"
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info =opencv-4.8.0
 * The complete build log is located at '/var/tmp/portage/media-libs/opencv-4.8.0-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/opencv-4.8.0-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/media-libs/opencv-4.8.0-r1/work/opencv-4.8.0_build-abi_x86_64.amd64'
 * S: '/var/tmp/portage/media-libs/opencv-4.8.0-r1/work/opencv-4.8.0'

>>> Failed to emerge media-libs/opencv-4.8.0-r1, Log file:

>>>  '/var/tmp/portage/media-libs/opencv-4.8.0-r1/temp/build.log'

 * Messages for package media-libs/opencv-4.8.0-r1:

 * ERROR: media-libs/opencv-4.8.0-r1::gentoo failed (compile phase):
 *   ninja -v -j25 -l0 failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 5435:  Called cmake-multilib_src_compile
 *   environment, line 1342:  Called multilib-minimal_src_compile
 *   environment, line 4244:  Called multilib_foreach_abi 'multilib-minimal_abi_src_compile'
 *   environment, line 4511:  Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 4204:  Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 4202:  Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_compile'
 *   environment, line  586:  Called multilib-minimal_abi_src_compile
 *   environment, line 4238:  Called multilib_src_compile
 *   environment, line 4731:  Called cmake_src_compile
 *   environment, line 1460:  Called cmake_build
 *   environment, line 1427:  Called eninja
 *   environment, line 2058:  Called die
 * The specific snippet of code:
 *       "$@" || die -n "${*} failed"
 * 
 * If you need support, post the output of `emerge --info '=media-libs/opencv-4.8.0-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/opencv-4.8.0-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-libs/opencv-4.8.0-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/opencv-4.8.0-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/media-libs/opencv-4.8.0-r1/work/opencv-4.8.0_build-abi_x86_64.amd64'
 * S: '/var/tmp/portage/media-libs/opencv-4.8.0-r1/work/opencv-4.8.0'

Expected Results:  
to compile properly

with USE="-lto -cuda" it emerges properly both with gcc12 and 13.
Comment 1 Kfir Ozer 2023-09-10 07:14:51 UTC
Created attachment 870202 [details]
emerge --info
Comment 2 Kfir Ozer 2023-09-10 07:25:13 UTC
with gcc-12 I tried USE="-lto cuda" and it produces the same error:

lto-wrapper: warning: using serial compilation of 45 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
{standard input}: Assembler messages:
{standard input}:352760: Error: symbol `fatbinData' is already defined
lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Comment 3 Miroslav Šulc gentoo-dev 2023-10-09 12:01:00 UTC
you can also see a workaround at the other bug how to compile with lto and still avoid this issue.

*** This bug has been marked as a duplicate of bug 811162 ***