I am building OpenELEC from https://github.com/OpenELEC/ and Gentoo's python is causing the build process to fail. The short story is that OpenELEC bootstarts the whole build process and it builds most packages with LD_LIBRARY_PATH set to a directory where it bootstrapped the packages/libraries (in my case it is LD_LIBRARY_PATH=$HOME/OpenELEC.tv/2.0/build.OpenELEC-Generic.x86_64-1.95.5/toolchain/lib). When it gets to building "cmake", the cmake build process tries to run bzr, which is a Gentoo python-wrapped script. However, since there is a libpython2.7.so in the LD_LIBRARY_PATH which is *not* Gentoo-patched, the wrapper goes in an endless loop trying execute itself over and over again. Here is what seems to be happening: > env strace -e trace=process env LD_LIBRARY_PATH=~/OpenELEC.tv/2.0/build.OpenELEC-Generic.x86_64-1.95.5/toolchain/lib /usr/bin/bzr execve("/usr/bin/env", ["env", "LD_LIBRARY_PATH=/home/chutz/Open"..., "/usr/bin/bzr"], [/* 71 vars */]) = 0 arch_prctl(ARCH_SET_FS, 0x7fbdfaaba700) = 0 execve("/usr/bin/bzr", ["/usr/bin/bzr"], [/* 72 vars */]) = 0 arch_prctl(ARCH_SET_FS, 0x7f11ef379700) = 0 execve("/usr/local/bin/python", ["python", "/usr/bin/bzr"], [/* 72 vars */]) = -1 ENOENT (No such file or directory) execve("/usr/bin/python", ["python", "/usr/bin/bzr"], [/* 72 vars */]) = 0 arch_prctl(ARCH_SET_FS, 0x7f49dcb46700) = 0 execve("/usr/bin/python2.7", ["/usr/bin/python2.7", "/usr/bin/bzr"], [/* 73 vars */]) = 0 arch_prctl(ARCH_SET_FS, 0x7f5d00541700) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f5d005419d0) = 30722 wait4(30722, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 30722 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30722, si_status=0, si_utime=1, si_stime=0} --- clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f5d005419d0) = 30731 wait4(30731, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 30731 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30731, si_status=0, si_utime=0, si_stime=0} --- execve("/usr/bin/python2.7", ["/usr/bin/python2.7", "/usr/bin/bzr"], [/* 75 vars */]) = 0 arch_prctl(ARCH_SET_FS, 0x7f95b0de7700) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f95b0de79d0) = 30732 wait4(30732, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 30732 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30732, si_status=0, si_utime=1, si_stime=0} --- clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f95b0de79d0) = 30741 wait4(30741, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 30741 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30741, si_status=0, si_utime=0, si_stime=0} --- execve("/usr/bin/python2.7", ["/usr/bin/python2.7", "/usr/bin/bzr"], [/* 75 vars */]) = 0 arch_prctl(ARCH_SET_FS, 0x7fdab4f14700) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fdab4f149d0) = 30742 wait4(30742, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 30742 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30742, si_status=0, si_utime=0, si_stime=1} --- clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fdab4f149d0) = 30751 wait4(30751, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 30751 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30751, si_status=0, si_utime=0, si_stime=0} --- execve("/usr/bin/python2.7", ["/usr/bin/python2.7", "/usr/bin/bzr"], [/* 75 vars */]) = 0 arch_prctl(ARCH_SET_FS, 0x7f3520edf700) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f3520edf9d0) = 30752 wait4(30752, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 30752 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30752, si_status=0, si_utime=1, si_stime=0} --- clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f3520edf9d0) = 30761 wait4(30761, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 30761 Reproducible: Always Steps to Reproduce: 1. git clone git://github.com/OpenELEC/OpenELEC.tv.git 2. cd OpenELEC.tv 3. git reset --hard 1.95.5 4. make ARCH=x86_64 Actual Results: When it got around to building cmake the process stopped. Check the process list revealed that "bzr" is taking almost all of the cpu. Tracing the process showed that is running itself over and over again. Expected Results: The build completes. I reported this to OpenELEC as well but since the python wrapper seems to be causing quite a few problems, I thought it is relevant to report it here as well.
Gentoo is patching both python2.7 executable and libpython2.7.so.1.0 library used by this executable. Mixing of patched executable with unpatched library is unsupported.
This should no longer be a case since eselect-python-2015*+ / python-exec-2.2+ no longer use the original python-wrapper and no longer rely on patched Python.