[opensuse-buildservice] Only root can link in OBS
Hello all, I have a weird problem with a package on a private OBS (x86-64, 2.9.4). It's basically a C program against some external proprietary lib. On any developer's machine it builds just fine with: ./configure make make install for both openSUSE Leap 42.3 (x86-64) and openSUSE Leap 15.0 (x86-64). I put the sources in OBS with the following in my SPEC file --- snip --- [...] %build %{_configure} %{__make} %install # Don't want to register our ext. lib via /etc/ld.so.conf.d/XXX.conf or similar. # Therefore we go with an rpath for the time being. export NO_BRP_CHECK_RPATH=true %{make_install} [...] --- snip --- Compiling works fine. Problem now is, the %{__make} fails when trying to link the final binary with lots of "undefined reference to" symbols from the external proprietary lib. What does work, is to use root4abuild or similar and then adjust the SPEC file like so sudo %{__make} instead of %{__make}. Obviously I don't want to stick with that, but I have no idea on how to debug this any further. Any hints would be greatly appreciated! Thanks and regards -- Till -- Dipl.-Inform. Till Dörges doerges@pre-sense.de Tel. +49 - 40 - 244 2407 - 0 Fax +49 - 40 - 244 2407 - 24 PRESENSE Technologies GmbH Sachsenstr. 5, D-20097 HH Geschäftsführer/Managing Directors AG Hamburg, HRB 107844 Till Dörges, Jürgen Sander USt-IdNr.: DE263765024 -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Dez 07 2018, Till Dörges <doerges@pre-sense.de> wrote:
Problem now is, the %{__make} fails when trying to link the final binary with lots of "undefined reference to" symbols from the external proprietary lib.
That's probably due to SUSE_ASNEEDED, see <https://build.opensuse.org/package/view_file/openSUSE:Factory/binutils/binutils-build-as-needed.diff> and <https://github.com/openSUSE/post-build-checks/blob/master/suse-buildsystem.sh>. The right way to fix that is to reorder the linker command line so that libraries appear after the objects that reference their symbols.
What does work, is to use root4abuild or similar and then adjust the SPEC file like so
sudo %{__make}
That removes SUSE_ASNEEDED from the environment. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Am 07.12.18 um 19:12 schrieb Andreas Schwab:
On Dez 07 2018, Till Dörges <doerges@pre-sense.de> wrote:
Problem now is, the %{__make} fails when trying to link the final binary with lots of "undefined reference to" symbols from the external proprietary lib.
That's probably due to SUSE_ASNEEDED, see <https://build.opensuse.org/package/view_file/openSUSE:Factory/binutils/binutils-build-as-needed.diff> and <https://github.com/openSUSE/post-build-checks/blob/master/suse-buildsystem.sh>. The right way to fix that is to reorder the linker command line so that libraries appear after the objects that reference their symbols.
Thanks for the incredibly quick answer. Your guess was correct. :-) After manually moving -l<lib1> -l<lib2> to the end of linker command line, linking works. The problem that remains now is that the application in question is using autotools/automake. AFAIK there's now way to change the *order* of command line options/parameters. The Makefile.am has something like xxx_SOURCES = a.c b.c xxx_LDFLAGS = -m64 -lpthread ... So I can of course change the options but not their position in the command line. Or is there a way to do that? Alternatively, how do I get rid of SUSE_ASNEEDED during the build process? Is simply calling 'unset SUSE_ASNEEDED' in %build enough? Thanks and regards -- Till -- Dipl.-Inform. Till Dörges doerges@pre-sense.de Tel. +49 - 40 - 244 2407 - 0 Fax +49 - 40 - 244 2407 - 24 PRESENSE Technologies GmbH Sachsenstr. 5, D-20097 HH Geschäftsführer/Managing Directors AG Hamburg, HRB 107844 Till Dörges, Jürgen Sander USt-IdNr.: DE263765024 -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Am 09.12.18 um 22:21 schrieb Till Dörges:
AFAIK there's now way to change the *order* of command line options/parameters. The Makefile.am has something like
xxx_SOURCES = a.c b.c xxx_LDFLAGS = -m64 -lpthread ...
So I can of course change the options but not their position in the command line.
Moving -lpthread and others to xxx_LDADD appears to do the trick. Thanks again -- Till -- Dipl.-Inform. Till Dörges doerges@pre-sense.de Tel. +49 - 40 - 244 2407 - 14 Fax +49 - 40 - 244 2407 - 24 PRESENSE Technologies GmbH Sachsenstr. 5, D-20097 HH Geschäftsführer/Managing Directors AG Hamburg, HRB 107844 Till Dörges, Jürgen Sander USt-IdNr.: DE263765024 -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Dez 09 2018, Till Dörges <doerges@pre-sense.de> wrote:
Makefile.am has something like
xxx_SOURCES = a.c b.c xxx_LDFLAGS = -m64 -lpthread ...
Libararies are supposed to appear on xxx_LDADD. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (2)
-
Andreas Schwab
-
Till Dörges