Open ericonr opened 3 years ago
What would happen if we add libgomp-devel
as a dependency to cross-vpkg-dummy
(and maybe to base-chroot
, while we are at it).
In this way, libgomp-devel
is always available, just like gcc or glibc. Are there any downsides of that?
In #34469 it seems I can "fix" the issue when building siril
by just adding libgomp-devel
to makedepends
(unconditionally) which I think would be implicit in what I suggested above.
What I don't understand is why siril
needs libgomp.spec
when building cross but it doesn't need it when building native.
A different solution (which also seems to work) is to run
$XBPS_INSTALL_CMD -Ayf cross-$XBPS_CROSS_TRIPLET-libc
when cross building, but this seems more costly.
In this way, libgomp-devel is always available, just like gcc or glibc. Are there any downsides of that?
I think this would make disabling libgomp in some cases harder. I don't know the exact implications of that, though.
What I don't understand is why siril needs libgomp.spec when building cross but it doesn't need it when building native.
I remember running across something like that when I was debugging this stuff, don't remember my conclusions...
when cross building, but this seems more costly.
Shouldn't be too much; just unpacking is generally pretty fast, IMO.
I know what happens with siril:
$ grep Libs: /usr/aarch64-linux-gnu/usr/lib/pkgconfig/libraw.pc
Libs: -L${libdir} -lraw -lstdc++ -fopenmp
Since siril links to libraw, it will inherit the -fopenmp
flag thus requiring libgomp-devel.
Normally for cross builds this is not a problem since libgomp-devel is implicit. But note that for non-cross builds on aarch64 this would still be a problem.
Maybe a package having -fopenmp
in its pkgconfig should depend on libgomp-devel
to avoid this breakage.
Why is this happening? My guess is that when cross building libraw detects openmp is available at compile time so it uses it. When nocross building libraw doesn't use openmp.
Random thoughts:
-fopenmp
is in some pkgconfig but libgomp-devel
is not in depends and error out?libgomp-devel
is implicit in every cross build, shouldn't also be implicit in every nocross build? Maybe more programs can benefit from openmp (e.g. siril itself I think can use openmp, not only indirectly via libraw).Xbps behaviour seen here is that while installing libgomp-devel
, it sees cross-vpkg-dummy
currently installed with provides=libgomp-devel
. So it wants to remove cross-vpkg-dummy
. That, in turn, makes libc.so
of shlib-provides not available, and transactions is declined.
I think it would be enough to fix https://github.com/void-linux/xbps/issues/363. Then, cross-vpkg-dummy
would satisfy dependency on libgomp-devel
, not install it, and cross-*-libc
files would be used during build.
Issues become stale 90 days after last activity and are closed 14 days after that. If this issue is still relevant bump it or assign it.
I looked in to this a bit regarding the gcc 13.2 update. (it was brought up on IRC at the time, I didn't notice this issue until now)
I did try adding libgomp to cross-vpkg-dummy and noticed the behavior described by Chocimier.
I added a rm
for libgomp to void-cross: (not --disable since the headers don't conflict and are necessary)
https://github.com/void-linux/void-packages/blob/master/common/build-style/void-cross.sh#L646
From
xlocate libgomp.spec
:makedepends
are installed in the cross root after the cross toolchain is installed in the host, which meanslibgomp-devel
replaceslibgomp.spec
from the cross toolchain. Then, when the dependencies are removed, all theusr/lib/libgomp*
files are removed, leaving the cross toolchain broken (xbps-pkgdb
complains).@q66 suggested fixing this by adding
libgomp
related stuff tocross-vpkg-dummy
, so that it would be resolved tocross-vpkg-dummy
, but that doesn't fix things, since it apparently breaks how XBPS resolves libraries (might be a xbps bug too, @Chocimier and @Duncaen):My patch:
Result of trying to install something and a package that's replaced by
cross-vpkg-dummy
(this is what happens in themakedepends
install step):This would lead me to assume there's a limitation in how
cross-vpkg-dummy
works in that you can't use it to replace things inmakedepends
, and, furthermore, that our unusual split of "full featured cross toolchains" and "separate subpackage for each feature in native toolchains" leads to breakage in this scenario.This can also be observed if one removes
nocross
fromgnustep-base
, where it also fails in themakedepends
installation step due tolibobjc-devel
.A heavy handed solution is adding such libraries to
hostmakedepends
or conditionally tomakedepends
only when not cross building, but that's very ugly.