[opensuse-packaging] Different gcc behaviour in osc chroot and on host system
While trying to build customized openjdk package, I've encountered interesting thing... The command, listed below, works fine on host system but fails on chrooted system (both systems are openSUSE 13.2 with stock gcc). Experimenting with it showed that it starts to work as soon as I move '-lz' from the beginning of the command to the very end. The failure is exactly like here, with undefined references to zlib: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1413 I've found the fix on openSUSE Java:Factory project, so the question is about difference between host and chroot. What can be the cause of such a different behaviour? Is there some additional package that may be installed on my host system but was not dragged by dependencies to the chrooted system? Or some env flag or config file? The command: /usr/bin/gcc-4.8 -lz -Xlinker -z -Xlinker defs -Xlinker -O1 -Xlinker --allow- shlib-undefined -Xlinker -soname=libunpack.so -Xlinker -z -Xlinker origin - Xlinker -rpath -Xlinker \$ORIGIN -lc -Xlinker -version- script=/home/user/dev/java//jdk8u40-b25/jdk/make/mapfiles/libunpack/mapfile- vers-unpack200 -o /home/user/dev/java//build/jdk/objs/unpackexe/unpack200 /home/user/dev/java//build/jdk/objs/unpackexe/bands.o /home/user/dev/java//build/jdk/objs/unpackexe/bytes.o /home/user/dev/java//build/jdk/objs/unpackexe/coding.o /home/user/dev/java//build/jdk/objs/unpackexe/main.o /home/user/dev/java//build/jdk/objs/unpackexe/unpack.o /home/user/dev/java//build/jdk/objs/unpackexe/utils.o /home/user/dev/java//build/jdk/objs/unpackexe/zip.o -Wl,-Bstatic -lstdc++ - lgcc -Wl,-Bdynamic -- Regards, Stas -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Friday 2015-04-03 15:51, Stanislav Baiduzhyi wrote:
While trying to build customized openjdk package, I've encountered interesting thing... The command, listed below, works fine on host system but fails on chrooted system (both systems are openSUSE 13.2 with stock gcc). Experimenting with it showed that it starts to work as soon as I move '-lz' from the beginning of the command to the very end.
https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed#Importance_...
I've found the fix on openSUSE Java:Factory project, so the question is about difference between host and chroot.
Outside of chroot, the default settings are rather lax. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On 2015-04-03 15:51:29 +0200, Stanislav Baiduzhyi wrote:
While trying to build customized openjdk package, I've encountered interesting thing... The command, listed below, works fine on host system but fails on chrooted system (both systems are openSUSE 13.2 with stock gcc). Experimenting with it showed that it starts to work as soon as I move '-lz' from the beginning of the command to the very end.
The failure is exactly like here, with undefined references to zlib: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1413
I've found the fix on openSUSE Java:Factory project, so the question is about difference between host and chroot. What can be the cause of such a different behaviour?
This is "caused" by the post-build-checks package, which is usually installed when building in the obs/chroot.
Is there some additional package that may be installed on my host system but was not dragged by dependencies to the chrooted system? Or some env flag or config file?
The post-build-checks package provides a /etc/profile.d/suse-buildsystem.sh file that exports SUSE_ASNEEDED=1, which causes ld to behave as if it was called with the "--as-needed" option (see the patch in the binutils package). Marcus -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Fri, Apr 3, 2015 at 10:51 AM, Stanislav Baiduzhyi <baiduzhyi.devel@gmail.com> wrote:
While trying to build customized openjdk package, I've encountered interesting thing... The command, listed below, works fine on host system but fails on chrooted system (both systems are openSUSE 13.2 with stock gcc). Experimenting with it showed that it starts to work as soon as I move '-lz' from the beginning of the command to the very end.
The failure is exactly like here, with undefined references to zlib: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1413
I've found the fix on openSUSE Java:Factory project, so the question is about difference between host and chroot. What can be the cause of such a different behaviour?
Yes, the default linker behaviour (-Wl, --no-as-needed) you get when running outside the build system is wrong but backward compatible :-) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (4)
-
Cristian Rodríguez
-
Jan Engelhardt
-
Marcus Hüwe
-
Stanislav Baiduzhyi