* musl xclock? @ 2015-05-19 21:51 John Mudd 2015-05-19 22:13 ` Rich Felker 2015-05-20 15:28 ` John Mudd 0 siblings, 2 replies; 12+ messages in thread From: John Mudd @ 2015-05-19 21:51 UTC (permalink / raw) To: musl; +Cc: John Mudd [-- Attachment #1: Type: text/plain, Size: 5859 bytes --] I'm trying to build a musl version of xclock. If I can build xclock then I hope to be able to build my app which is more complicated. I'm getting the following error. /usr/bin/ld: h_errno: TLS definition in //lib/i386-linux-gnu/libc.so.6 section .tbss mismatches non-TLS definition in /home/mudd/musl/musl-1.1.8.install/lib/libc.so section .bss Here's what the make was trying to execute. It looks good to me. Do you see a problem? cd /home/mudd/musl/xclock-1.0.7 gcc \ --sysroot=/home/mudd/musl/musl-1.1.8.install/ \ -specs /home/mudd/musl/musl-1.1.8.install/lib/musl-gcc.specs \ -O3 \ -fno-stack-protector \ -std=gnu99 -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wcast-qual -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing \ -I/home/mudd/musl/autoconf-2.69.install/include \ -I/home/mudd/musl/automake-1.15.install/include \ -I/home/mudd/musl/bzip2-1.0.6.install/include \ -I/home/mudd/musl/curl-master.install/include \ -I/home/mudd/musl/fontconfig-2.11.93.install/include \ -I/home/mudd/musl/freetype-2.5.5.install/include \ -I/home/mudd/musl/freetype-2.5.5.install/include/freetype2 \ -I/home/mudd/musl/inputproto-2.3.install/include \ -I/home/mudd/musl/kbproto-1.0.6.install/include \ -I/home/mudd/musl/krb5-1.13.1.install/include \ -I/home/mudd/musl/libICE-1.0.9.install/include \ -I/home/mudd/musl/libpthread-stubs-0.1.install/include \ -I/home/mudd/musl/libSM-1.2.2.install/include \ -I/home/mudd/musl/libtool-2.4.install/include \ -I/home/mudd/musl/libX11-1.6.3.install/include \ -I/home/mudd/musl/libXau-1.0.8.install/include \ -I/home/mudd/musl/libXaw-1.0.12.install/include \ -I/home/mudd/musl/libxcb-1.11.install/include \ -I/home/mudd/musl/libXext-1.3.3.install/include \ -I/home/mudd/musl/libXft-2.3.2.install/include \ -I/home/mudd/musl/libxkbfile-1.0.8.install/include \ -I/home/mudd/musl/libxml2-2.9.2.install/include \ -I/home/mudd/musl/libxml2-2.9.2.install/include/libxml2 \ -I/home/mudd/musl/libxml2-2.9.2.install/include/libxml2/ \ -I/home/mudd/musl/libXmu-1.1.2.install/include \ -I/home/mudd/musl/libXpm-3.5.11.install/include \ -I/home/mudd/musl/libXrender-0.9.8.install/include \ -I/home/mudd/musl/libxslt-1.1.28.install/include \ -I/home/mudd/musl/libXt-1.1.4.install/include \ -I/home/mudd/musl/musl-1.1.8.install/include \ -I/home/mudd/musl/ncurses-5.9.install/include \ -I/home/mudd/musl/ncurses-5.9.install/include/ncurses/ \ -I/home/mudd/musl/openssl-1.0.2a.install/include \ -I/home/mudd/musl/postgresql-9.4.1.install/include \ -I/home/mudd/musl/Python-2.7.9.install/include \ -I/home/mudd/musl/Python-2.7.9.install/include/python2.7/ \ -I/home/mudd/musl/readline-6.3.install/include \ -I/home/mudd/musl/renderproto-0.11.install/include \ -I/home/mudd/musl/sqlite-autoconf-3080803.install/include \ -I/home/mudd/musl/util-macros-1.19.0.install/include \ -I/home/mudd/musl/xcb-proto-1.11.install/include \ -I/home/mudd/musl/xextproto-7.3.0.install/include \ -I/home/mudd/musl/xproto-7.0.27.install/include \ -I/home/mudd/musl/xtrans-1.3.5.install/include \ -I/home/mudd/musl/zlib-1.2.8.install/include \ -L/home/mudd/musl/autoconf-2.69.install/lib \ -L/home/mudd/musl/automake-1.15.install/lib \ -L/home/mudd/musl/bzip2-1.0.6.install/lib \ -L/home/mudd/musl/curl-master.install/lib \ -L/home/mudd/musl/fontconfig-2.11.93.install/lib \ -L/home/mudd/musl/freetype-2.5.5.install/lib \ -L/home/mudd/musl/inputproto-2.3.install/lib \ -L/home/mudd/musl/kbproto-1.0.6.install/lib \ -L/home/mudd/musl/krb5-1.13.1.install/lib \ -L/home/mudd/musl/libICE-1.0.9.install/lib \ -L/home/mudd/musl/libpthread-stubs-0.1.install/lib \ -L/home/mudd/musl/libSM-1.2.2.install/lib \ -L/home/mudd/musl/libtool-2.4.install/lib \ -L/home/mudd/musl/libX11-1.6.3.install/lib \ -L/home/mudd/musl/libXau-1.0.8.install/lib \ -L/home/mudd/musl/libXaw-1.0.12.install/lib \ -L/home/mudd/musl/libxcb-1.11.install/lib \ -L/home/mudd/musl/libXext-1.3.3.install/lib \ -L/home/mudd/musl/libXft-2.3.2.install/lib \ -L/home/mudd/musl/libxkbfile-1.0.8.install/lib \ -L/home/mudd/musl/libxml2-2.9.2.install/lib \ -L/home/mudd/musl/libXmu-1.1.2.install/lib \ -L/home/mudd/musl/libXpm-3.5.11.install/lib \ -L/home/mudd/musl/libXrender-0.9.8.install/lib \ -L/home/mudd/musl/libxslt-1.1.28.install/lib \ -L/home/mudd/musl/libXt-1.1.4.install/lib \ -L/home/mudd/musl/musl-1.1.8.install/lib \ -L/home/mudd/musl/ncurses-5.9.install/lib \ -L/home/mudd/musl/openssl-1.0.2a.install/lib \ -L/home/mudd/musl/postgresql-9.4.1.install/lib \ -L/home/mudd/musl/Python-2.7.9.install/lib \ -L/home/mudd/musl/readline-6.3.install/lib \ -L/home/mudd/musl/renderproto-0.11.install/lib \ -L/home/mudd/musl/sqlite-autoconf-3080803.install/lib \ -L/home/mudd/musl/util-macros-1.19.0.install/lib \ -L/home/mudd/musl/xcb-proto-1.11.install/lib \ -L/home/mudd/musl/xextproto-7.3.0.install/lib \ -L/home/mudd/musl/xproto-7.0.27.install/lib \ -L/home/mudd/musl/xtrans-1.3.5.install/lib \ -L/home/mudd/musl/zlib-1.2.8.install/lib \ -o xclock Clock.o xclock.o \ -lX11 \ -lXaw7 \ -lXft \ -lxkbfile \ -lXmu \ -lXrender \ -lXt [-- Attachment #2: Type: text/html, Size: 7046 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: musl xclock? 2015-05-19 21:51 musl xclock? John Mudd @ 2015-05-19 22:13 ` Rich Felker 2015-05-20 15:28 ` John Mudd 1 sibling, 0 replies; 12+ messages in thread From: Rich Felker @ 2015-05-19 22:13 UTC (permalink / raw) To: musl On Tue, May 19, 2015 at 05:51:24PM -0400, John Mudd wrote: > I'm trying to build a musl version of xclock. If I can build xclock then I > hope to be able to build my app which is more complicated. I'm getting the > following error. > > /usr/bin/ld: h_errno: TLS definition in //lib/i386-linux-gnu/libc.so.6 > section .tbss mismatches non-TLS definition in > /home/mudd/musl/musl-1.1.8.install/lib/libc.so section .bss > > Here's what the make was trying to execute. It looks good to me. Do you see > a problem? Yes, you're linking to glibc, or to something that was linked with glibc. You should look though the X11 .so files you've built using readelf and see if any of them have dependencies on libc.so.6. It looks like you're using the host system's gcc and passing the musl-gcc.specs file to it manually rather than using the musl-gcc script or a real musl-targetted compiler toolchain, so it might be something to do with that too. Adding -v to the command line and seeing what gets passed to the linker command could be helpful. Rich ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: musl xclock? 2015-05-19 21:51 musl xclock? John Mudd 2015-05-19 22:13 ` Rich Felker @ 2015-05-20 15:28 ` John Mudd 2015-05-20 16:05 ` Rich Felker 2015-05-20 20:26 ` John Mudd 1 sibling, 2 replies; 12+ messages in thread From: John Mudd @ 2015-05-20 15:28 UTC (permalink / raw) To: musl; +Cc: John Mudd [-- Attachment #1: Type: text/plain, Size: 12618 bytes --] On Tue, May 19, 2015 at 5:51 PM, John Mudd <johnbmudd@gmail.com> wrote: > I'm trying to build a musl version of xclock. If I can build xclock then I > hope to be able to build my app which is more complicated. I'm getting the > following error. > > /usr/bin/ld: h_errno: TLS definition in //lib/i386-linux-gnu/libc.so.6 > section .tbss mismatches non-TLS definition in > /home/mudd/musl/musl-1.1.8.install/lib/libc.so section .bss > > Rich Felker wrote: "Yes, you're linking to glibc, or to something that was linked with glibc. You should look though the X11 .so files you've built using readelf and see if any of them have dependencies on libc.so.6. It looks like you're using the host system's gcc and passing the musl-gcc.specs file to it manually rather than using the musl-gcc script or a real musl-targetted compiler toolchain, so it might be something to do with that too. Adding -v to the command line and seeing what gets passed to the linker command could be helpful." It doesn't look like any of my musl compiled libs point to libc.so.6. $ readelf -a ./*.install/lib/lib*.so | grep libc.so.6 $ Here's what the X11 libs point to. I've built and referenced all of these dependencies using musl. $ readelf -a ./*.install/lib/libX*.so | grep NEED | sort -u 0x00000001 (NEEDED) Shared library: [libc.so] 0x00000001 (NEEDED) Shared library: [libfontconfig.so.1] 0x00000001 (NEEDED) Shared library: [libfreetype.so.6] 0x00000001 (NEEDED) Shared library: [libICE.so.6] 0x00000001 (NEEDED) Shared library: [libSM.so.6] 0x00000001 (NEEDED) Shared library: [libX11.so.6] 0x00000001 (NEEDED) Shared library: [libXau.so.6] 0x00000001 (NEEDED) Shared library: [libxcb.so.1] 0x00000001 (NEEDED) Shared library: [libXext.so.6] 0x00000001 (NEEDED) Shared library: [libxml2.so.2] 0x00000001 (NEEDED) Shared library: [libXmu.so.6] 0x00000001 (NEEDED) Shared library: [libXpm.so.4] 0x00000001 (NEEDED) Shared library: [libXrender.so.1] 0x00000001 (NEEDED) Shared library: [libXt.so.6] 0x00000001 (NEEDED) Shared library: [libz.so.1] $ I'm using musl-gcc. What I listed in original email is what that script executed. After I cleaned it up to make it easier to read. Here's the output of the gcc command with "-v". It's referencing the native libc. But where does that come from? Using built-in specs. Reading specs from /home/mudd/musl/musl-1.1.8.install/lib/musl-gcc.specs rename spec cpp_options to old_cpp_options COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper Target: i686-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu Thread model: posix gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) COMPILER_PATH=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/ LIBRARY_PATH=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib/:/home/mudd/musl/musl-1.1.8.install/lib/../lib/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../:/home/mudd/musl/musl-1.1.8.install/lib/ COLLECT_GCC_OPTIONS='-v' '-specs=/home/mudd/musl/musl-1.1.8.install/lib/musl-gcc.specs' '-O3' '-fno-stack-protector' '-std=gnu99' '-Wall' '-Wpointer-arith' '-Wmissing-declarations' '-Wformat=2' '-Wstrict-prototypes' '-Wmissing-prototypes' '-Wnested-externs' '-Wbad-function-cast' '-Wold-style-definition' '-Wdeclaration-after-statement' '-Wunused' '-Wuninitialized' '-Wshadow' '-Wcast-qual' '-Wsuggest-attribute=noreturn' '-Wsuggest-attribute=format' '-Wredundant-decls' '-Werror=implicit' '-Werror=nonnull' '-Werror=init-self' '-Werror=main' '-Werror=missing-braces' '-Werror=sequence-point' '-Werror=return-type' '-Werror=trigraphs' '-Werror=array-bounds' '-Werror=write-strings' '-Werror=address' '-Werror=int-to-pointer-cast' '-Werror=pointer-to-int-cast' '-fno-strict-aliasing' '-I' '/home/mudd/musl/autoconf-2.69.install/include' '-I' '/home/mudd/musl/automake-1.15.install/include' '-I' '/home/mudd/musl/bzip2-1.0.6.install/include' '-I' '/home/mudd/musl/curl-master.install/include' '-I' '/home/mudd/musl/fontconfig-2.11.93.install/include' '-I' '/home/mudd/musl/freetype-2.5.5.install/include' '-I' '/home/mudd/musl/freetype-2.5.5.install/include/freetype2' '-I' '/home/mudd/musl/inputproto-2.3.install/include' '-I' '/home/mudd/musl/kbproto-1.0.6.install/include' '-I' '/home/mudd/musl/krb5-1.13.1.install/include' '-I' '/home/mudd/musl/libICE-1.0.9.install/include' '-I' '/home/mudd/musl/libpthread-stubs-0.1.install/include' '-I' '/home/mudd/musl/libSM-1.2.2.install/include' '-I' '/home/mudd/musl/libtool-2.4.install/include' '-I' '/home/mudd/musl/libX11-1.6.3.install/include' '-I' '/home/mudd/musl/libXau-1.0.8.install/include' '-I' '/home/mudd/musl/libXaw-1.0.12.install/include' '-I' '/home/mudd/musl/libxcb-1.11.install/include' '-I' '/home/mudd/musl/libXext-1.3.3.install/include' '-I' '/home/mudd/musl/libXft-2.3.2.install/include' '-I' '/home/mudd/musl/libxkbfile-1.0.8.install/include' '-I' '/home/mudd/musl/libxml2-2.9.2.install/include' '-I' '/home/mudd/musl/libxml2-2.9.2.install/include/libxml2' '-I' '/home/mudd/musl/libxml2-2.9.2.install/include/libxml2/' '-I' '/home/mudd/musl/libXmu-1.1.2.install/include' '-I' '/home/mudd/musl/libXpm-3.5.11.install/include' '-I' '/home/mudd/musl/libXrender-0.9.8.install/include' '-I' '/home/mudd/musl/libxslt-1.1.28.install/include' '-I' '/home/mudd/musl/libXt-1.1.4.install/include' '-I' '/home/mudd/musl/musl-1.1.8.install/include' '-I' '/home/mudd/musl/ncurses-5.9.install/include' '-I' '/home/mudd/musl/ncurses-5.9.install/include/ncurses/' '-I' '/home/mudd/musl/openssl-1.0.2a.install/include' '-I' '/home/mudd/musl/postgresql-9.4.1.install/include' '-I' '/home/mudd/musl/Python-2.7.9.install/include' '-I' '/home/mudd/musl/Python-2.7.9.install/include/python2.7/' '-I' '/home/mudd/musl/readline-6.3.install/include' '-I' '/home/mudd/musl/renderproto-0.11.install/include' '-I' '/home/mudd/musl/sqlite-autoconf-3080803.install/include' '-I' '/home/mudd/musl/util-macros-1.19.0.install/include' '-I' '/home/mudd/musl/xcb-proto-1.11.install/include' '-I' '/home/mudd/musl/xextproto-7.3.0.install/include' '-I' '/home/mudd/musl/xproto-7.0.27.install/include' '-I' '/home/mudd/musl/xtrans-1.3.5.install/include' '-I' '/home/mudd/musl/zlib-1.2.8.install/include' '-L/home/mudd/musl/autoconf-2.69.install/lib' '-L/home/mudd/musl/automake-1.15.install/lib' '-L/home/mudd/musl/bzip2-1.0.6.install/lib' '-L/home/mudd/musl/curl-master.install/lib' '-L/home/mudd/musl/fontconfig-2.11.93.install/lib' '-L/home/mudd/musl/freetype-2.5.5.install/lib' '-L/home/mudd/musl/inputproto-2.3.install/lib' '-L/home/mudd/musl/kbproto-1.0.6.install/lib' '-L/home/mudd/musl/krb5-1.13.1.install/lib' '-L/home/mudd/musl/libICE-1.0.9.install/lib' '-L/home/mudd/musl/libpthread-stubs-0.1.install/lib' '-L/home/mudd/musl/libSM-1.2.2.install/lib' '-L/home/mudd/musl/libtool-2.4.install/lib' '-L/home/mudd/musl/libX11-1.6.3.install/lib' '-L/home/mudd/musl/libXau-1.0.8.install/lib' '-L/home/mudd/musl/libXaw-1.0.12.install/lib' '-L/home/mudd/musl/libxcb-1.11.install/lib' '-L/home/mudd/musl/libXext-1.3.3.install/lib' '-L/home/mudd/musl/libXft-2.3.2.install/lib' '-L/home/mudd/musl/libxkbfile-1.0.8.install/lib' '-L/home/mudd/musl/libxml2-2.9.2.install/lib' '-L/home/mudd/musl/libXmu-1.1.2.install/lib' '-L/home/mudd/musl/libXpm-3.5.11.install/lib' '-L/home/mudd/musl/libXrender-0.9.8.install/lib' '-L/home/mudd/musl/libxslt-1.1.28.install/lib' '-L/home/mudd/musl/libXt-1.1.4.install/lib' '-L/home/mudd/musl/musl-1.1.8.install/lib' '-L/home/mudd/musl/ncurses-5.9.install/lib' '-L/home/mudd/musl/openssl-1.0.2a.install/lib' '-L/home/mudd/musl/postgresql-9.4.1.install/lib' '-L/home/mudd/musl/Python-2.7.9.install/lib' '-L/home/mudd/musl/readline-6.3.install/lib' '-L/home/mudd/musl/renderproto-0.11.install/lib' '-L/home/mudd/musl/sqlite-autoconf-3080803.install/lib' '-L/home/mudd/musl/util-macros-1.19.0.install/lib' '-L/home/mudd/musl/xcb-proto-1.11.install/lib' '-L/home/mudd/musl/xextproto-7.3.0.install/lib' '-L/home/mudd/musl/xproto-7.0.27.install/lib' '-L/home/mudd/musl/xtrans-1.3.5.install/lib' '-L/home/mudd/musl/zlib-1.2.8.install/lib' '-o' 'xclock' '-mtune=generic' '-march=i686' /usr/lib/gcc/i686-linux-gnu/4.8/collect2 -dynamic-linker /usr/rx30/musl/lib/ld-musl-i386.so.1 -nostdlib -z relro -o xclock /home/mudd/musl/musl-1.1.8.install/lib/crt1.o /home/mudd/musl/musl-1.1.8.install/lib/crti.o /usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o -L/home/mudd/musl/autoconf-2.69.install/lib -L/home/mudd/musl/automake-1.15.install/lib -L/home/mudd/musl/bzip2-1.0.6.install/lib -L/home/mudd/musl/curl-master.install/lib -L/home/mudd/musl/fontconfig-2.11.93.install/lib -L/home/mudd/musl/freetype-2.5.5.install/lib -L/home/mudd/musl/inputproto-2.3.install/lib -L/home/mudd/musl/kbproto-1.0.6.install/lib -L/home/mudd/musl/krb5-1.13.1.install/lib -L/home/mudd/musl/libICE-1.0.9.install/lib -L/home/mudd/musl/libpthread-stubs-0.1.install/lib -L/home/mudd/musl/libSM-1.2.2.install/lib -L/home/mudd/musl/libtool-2.4.install/lib -L/home/mudd/musl/libX11-1.6.3.install/lib -L/home/mudd/musl/libXau-1.0.8.install/lib -L/home/mudd/musl/libXaw-1.0.12.install/lib -L/home/mudd/musl/libxcb-1.11.install/lib -L/home/mudd/musl/libXext-1.3.3.install/lib -L/home/mudd/musl/libXft-2.3.2.install/lib -L/home/mudd/musl/libxkbfile-1.0.8.install/lib -L/home/mudd/musl/libxml2-2.9.2.install/lib -L/home/mudd/musl/libXmu-1.1.2.install/lib -L/home/mudd/musl/libXpm-3.5.11.install/lib -L/home/mudd/musl/libXrender-0.9.8.install/lib -L/home/mudd/musl/libxslt-1.1.28.install/lib -L/home/mudd/musl/libXt-1.1.4.install/lib -L/home/mudd/musl/musl-1.1.8.install/lib -L/home/mudd/musl/ncurses-5.9.install/lib -L/home/mudd/musl/openssl-1.0.2a.install/lib -L/home/mudd/musl/postgresql-9.4.1.install/lib -L/home/mudd/musl/Python-2.7.9.install/lib -L/home/mudd/musl/readline-6.3.install/lib -L/home/mudd/musl/renderproto-0.11.install/lib -L/home/mudd/musl/sqlite-autoconf-3080803.install/lib -L/home/mudd/musl/util-macros-1.19.0.install/lib -L/home/mudd/musl/xcb-proto-1.11.install/lib -L/home/mudd/musl/xextproto-7.3.0.install/lib -L/home/mudd/musl/xproto-7.0.27.install/lib -L/home/mudd/musl/xtrans-1.3.5.install/lib -L/home/mudd/musl/zlib-1.2.8.install/lib -L/home/mudd/musl/musl-1.1.8.install/lib -L /usr/lib/gcc/i686-linux-gnu/4.8/. Clock.o xclock.o -lX11 -lXaw7 -lXft -lxkbfile -lXmu -lXrender -lXt /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a -lc /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o /home/mudd/musl/musl-1.1.8.install/lib/crtn.o /usr/bin/ld: h_errno: TLS definition in //lib/i386-linux-gnu/libc.so.6 section .tbss mismatches non-TLS definition in /home/mudd/musl/musl-1.1.8.install/lib/libc.so section .bss //lib/i386-linux-gnu/libc.so.6: error adding symbols: Bad value collect2: error: ld returned 1 exit status [-- Attachment #2: Type: text/html, Size: 16003 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Re: musl xclock? 2015-05-20 15:28 ` John Mudd @ 2015-05-20 16:05 ` Rich Felker 2015-05-20 17:00 ` Szabolcs Nagy 2015-05-20 20:26 ` John Mudd 1 sibling, 1 reply; 12+ messages in thread From: Rich Felker @ 2015-05-20 16:05 UTC (permalink / raw) To: musl On Wed, May 20, 2015 at 11:28:50AM -0400, John Mudd wrote: > On Tue, May 19, 2015 at 5:51 PM, John Mudd <johnbmudd@gmail.com> wrote: > > > I'm trying to build a musl version of xclock. If I can build xclock then I > > hope to be able to build my app which is more complicated. I'm getting the > > following error. > > > > /usr/bin/ld: h_errno: TLS definition in //lib/i386-linux-gnu/libc.so.6 > > section .tbss mismatches non-TLS definition in > > /home/mudd/musl/musl-1.1.8.install/lib/libc.so section .bss > > > > > Rich Felker wrote: > "Yes, you're linking to glibc, or to something that was linked with > glibc. You should look though the X11 .so files you've built using > readelf and see if any of them have dependencies on libc.so.6. It > looks like you're using the host system's gcc and passing the > musl-gcc.specs file to it manually rather than using the musl-gcc > script or a real musl-targetted compiler toolchain, so it might be > something to do with that too. Adding -v to the command line and > seeing what gets passed to the linker command could be helpful." > > > > It doesn't look like any of my musl compiled libs point to libc.so.6. > $ readelf -a ./*.install/lib/lib*.so | grep libc.so.6 > $ > > Here's what the X11 libs point to. I've built and referenced all of these > dependencies using musl. > $ readelf -a ./*.install/lib/libX*.so | grep NEED | sort -u You're only checking the X libs (libX*). Can you re-run that command as: readelf -a ./*.install/lib/*.so | grep NEED | sort -u That might find a library that was built incorrectly. I would also check musl libc.so itself just to be sure; it's conceivable that something went wrong in the build and _it_ has a dependency on glibc encoded in it (which it would ignore at runtime, but ld won't ignore it when linking). > 0x00000001 (NEEDED) Shared library: [libc.so] > 0x00000001 (NEEDED) Shared library: > [libfontconfig.so.1] > 0x00000001 (NEEDED) Shared library: [libfreetype.so.6] > 0x00000001 (NEEDED) Shared library: [libICE.so.6] > 0x00000001 (NEEDED) Shared library: [libSM.so.6] > 0x00000001 (NEEDED) Shared library: [libX11.so.6] > 0x00000001 (NEEDED) Shared library: [libXau.so.6] > 0x00000001 (NEEDED) Shared library: [libxcb.so.1] > 0x00000001 (NEEDED) Shared library: [libXext.so.6] > 0x00000001 (NEEDED) Shared library: [libxml2.so.2] > 0x00000001 (NEEDED) Shared library: [libXmu.so.6] > 0x00000001 (NEEDED) Shared library: [libXpm.so.4] > 0x00000001 (NEEDED) Shared library: [libXrender.so.1] > 0x00000001 (NEEDED) Shared library: [libXt.so.6] > 0x00000001 (NEEDED) Shared library: [libz.so.1] > $ > > I'm using musl-gcc. What I listed in original email is what that script > executed. After I cleaned it up to make it easier to read. > > Here's the output of the gcc command with "-v". It's referencing the native > libc. But where does that come from? I don't see any references to it on the command line it passes to the linker, only in the output during linking that was the same without -v. So I'm confused where it's coming from too. > /usr/lib/gcc/i686-linux-gnu/4.8/collect2 -dynamic-linker This is the interesting command... > /usr/rx30/musl/lib/ld-musl-i386.so.1 -nostdlib -z relro -o xclock > /home/mudd/musl/musl-1.1.8.install/lib/crt1.o > /home/mudd/musl/musl-1.1.8.install/lib/crti.o > /usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o > -L/home/mudd/musl/autoconf-2.69.install/lib > -L/home/mudd/musl/automake-1.15.install/lib > -L/home/mudd/musl/bzip2-1.0.6.install/lib > -L/home/mudd/musl/curl-master.install/lib > -L/home/mudd/musl/fontconfig-2.11.93.install/lib > -L/home/mudd/musl/freetype-2.5.5.install/lib > -L/home/mudd/musl/inputproto-2.3.install/lib > -L/home/mudd/musl/kbproto-1.0.6.install/lib > -L/home/mudd/musl/krb5-1.13.1.install/lib > -L/home/mudd/musl/libICE-1.0.9.install/lib > -L/home/mudd/musl/libpthread-stubs-0.1.install/lib > -L/home/mudd/musl/libSM-1.2.2.install/lib > -L/home/mudd/musl/libtool-2.4.install/lib > -L/home/mudd/musl/libX11-1.6.3.install/lib > -L/home/mudd/musl/libXau-1.0.8.install/lib > -L/home/mudd/musl/libXaw-1.0.12.install/lib > -L/home/mudd/musl/libxcb-1.11.install/lib > -L/home/mudd/musl/libXext-1.3.3.install/lib > -L/home/mudd/musl/libXft-2.3.2.install/lib > -L/home/mudd/musl/libxkbfile-1.0.8.install/lib > -L/home/mudd/musl/libxml2-2.9.2.install/lib > -L/home/mudd/musl/libXmu-1.1.2.install/lib > -L/home/mudd/musl/libXpm-3.5.11.install/lib > -L/home/mudd/musl/libXrender-0.9.8.install/lib > -L/home/mudd/musl/libxslt-1.1.28.install/lib > -L/home/mudd/musl/libXt-1.1.4.install/lib > -L/home/mudd/musl/musl-1.1.8.install/lib > -L/home/mudd/musl/ncurses-5.9.install/lib > -L/home/mudd/musl/openssl-1.0.2a.install/lib > -L/home/mudd/musl/postgresql-9.4.1.install/lib > -L/home/mudd/musl/Python-2.7.9.install/lib > -L/home/mudd/musl/readline-6.3.install/lib > -L/home/mudd/musl/renderproto-0.11.install/lib > -L/home/mudd/musl/sqlite-autoconf-3080803.install/lib > -L/home/mudd/musl/util-macros-1.19.0.install/lib > -L/home/mudd/musl/xcb-proto-1.11.install/lib > -L/home/mudd/musl/xextproto-7.3.0.install/lib > -L/home/mudd/musl/xproto-7.0.27.install/lib > -L/home/mudd/musl/xtrans-1.3.5.install/lib > -L/home/mudd/musl/zlib-1.2.8.install/lib > -L/home/mudd/musl/musl-1.1.8.install/lib -L > /usr/lib/gcc/i686-linux-gnu/4.8/. Clock.o xclock.o -lX11 -lXaw7 -lXft ...and the only mildly suspicious thing is this last -L. Is it possible that your distro has glibc libc.so in the same directory as the gcc libs dir, /usr/lib/gcc/i686-linux-gnu/4.8/? > -lxkbfile -lXmu -lXrender -lXt /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a > /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a -lc > /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a > /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a > /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o > /home/mudd/musl/musl-1.1.8.install/lib/crtn.o > /usr/bin/ld: h_errno: TLS definition in //lib/i386-linux-gnu/libc.so.6 > section .tbss mismatches non-TLS definition in > /home/mudd/musl/musl-1.1.8.install/lib/libc.so section .bss > //lib/i386-linux-gnu/libc.so.6: error adding symbols: Bad value > collect2: error: ld returned 1 exit status It's odd that //lib appears in the above output since that has nothing to do with the -L pathnames above and it has a gratuitous double slash at the beginning. What distro are you using? Rich ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Re: musl xclock? 2015-05-20 16:05 ` Rich Felker @ 2015-05-20 17:00 ` Szabolcs Nagy 2015-05-20 17:02 ` Szabolcs Nagy 2015-05-20 17:43 ` Rich Felker 0 siblings, 2 replies; 12+ messages in thread From: Szabolcs Nagy @ 2015-05-20 17:00 UTC (permalink / raw) To: musl * Rich Felker <dalias@libc.org> [2015-05-20 12:05:02 -0400]: > On Wed, May 20, 2015 at 11:28:50AM -0400, John Mudd wrote: > > /usr/lib/gcc/i686-linux-gnu/4.8/. Clock.o xclock.o -lX11 -lXaw7 -lXft > > ...and the only mildly suspicious thing is this last -L. Is it > possible that your distro has glibc libc.so in the same directory as > the gcc libs dir, /usr/lib/gcc/i686-linux-gnu/4.8/? > it seems to be an ubuntu gcc libc.so should not be in that dir but libstdc++.so is there (which has libc.so.6 and ld-linux-x86-64.so.2 dependency among others) if the problem is what i think it is then an empty ld-linux-x86.so.2 may fix it > > -lxkbfile -lXmu -lXrender -lXt /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a > > /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a -lc > > /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a > > /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a > > /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o > > /home/mudd/musl/musl-1.1.8.install/lib/crtn.o > > /usr/bin/ld: h_errno: TLS definition in //lib/i386-linux-gnu/libc.so.6 > > section .tbss mismatches non-TLS definition in > > /home/mudd/musl/musl-1.1.8.install/lib/libc.so section .bss > > //lib/i386-linux-gnu/libc.so.6: error adding symbols: Bad value > > collect2: error: ld returned 1 exit status > > It's odd that //lib appears in the above output since that has nothing > to do with the -L pathnames above and it has a gratuitous double slash > at the beginning. > > What distro are you using? > the first / comes from the default sysroot (gcc was built with --with-sysroot=/) and i think gcc falls back to that when it does not find something in the specified places.. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Re: musl xclock? 2015-05-20 17:00 ` Szabolcs Nagy @ 2015-05-20 17:02 ` Szabolcs Nagy 2015-05-20 17:43 ` Rich Felker 1 sibling, 0 replies; 12+ messages in thread From: Szabolcs Nagy @ 2015-05-20 17:02 UTC (permalink / raw) To: musl * Szabolcs Nagy <nsz@port70.net> [2015-05-20 19:00:17 +0200]: > libc.so should not be in that dir but libstdc++.so is there > (which has libc.so.6 and ld-linux-x86-64.so.2 dependency among > others) > > if the problem is what i think it is then an empty ld-linux-x86.so.2 > may fix it i meant ld-linux.so.2 (since it is i386 not x86_64) ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Re: musl xclock? 2015-05-20 17:00 ` Szabolcs Nagy 2015-05-20 17:02 ` Szabolcs Nagy @ 2015-05-20 17:43 ` Rich Felker 1 sibling, 0 replies; 12+ messages in thread From: Rich Felker @ 2015-05-20 17:43 UTC (permalink / raw) To: musl On Wed, May 20, 2015 at 07:00:17PM +0200, Szabolcs Nagy wrote: > * Rich Felker <dalias@libc.org> [2015-05-20 12:05:02 -0400]: > > On Wed, May 20, 2015 at 11:28:50AM -0400, John Mudd wrote: > > > /usr/lib/gcc/i686-linux-gnu/4.8/. Clock.o xclock.o -lX11 -lXaw7 -lXft > > > > ...and the only mildly suspicious thing is this last -L. Is it > > possible that your distro has glibc libc.so in the same directory as > > the gcc libs dir, /usr/lib/gcc/i686-linux-gnu/4.8/? > > > > it seems to be an ubuntu gcc > > libc.so should not be in that dir but libstdc++.so is there > (which has libc.so.6 and ld-linux-x86-64.so.2 dependency among > others) > > if the problem is what i think it is then an empty ld-linux-x86.so.2 > may fix it But how is /lib being searched at all? It's not in the -L path. > > > -lxkbfile -lXmu -lXrender -lXt /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a > > > /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a -lc > > > /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a > > > /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_eh.a > > > /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o > > > /home/mudd/musl/musl-1.1.8.install/lib/crtn.o > > > /usr/bin/ld: h_errno: TLS definition in //lib/i386-linux-gnu/libc.so.6 > > > section .tbss mismatches non-TLS definition in > > > /home/mudd/musl/musl-1.1.8.install/lib/libc.so section .bss > > > //lib/i386-linux-gnu/libc.so.6: error adding symbols: Bad value > > > collect2: error: ld returned 1 exit status > > > > It's odd that //lib appears in the above output since that has nothing > > to do with the -L pathnames above and it has a gratuitous double slash > > at the beginning. > > > > What distro are you using? > > > > the first / comes from the default sysroot (gcc was built with > --with-sysroot=/) and i think gcc falls back to that when it > does not find something in the specified places.. Uhg, is there any way around that? If not, the musl-gcc wrapper is useless with sysrooted toolchains. :( Rich ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: musl xclock? 2015-05-20 15:28 ` John Mudd 2015-05-20 16:05 ` Rich Felker @ 2015-05-20 20:26 ` John Mudd 2015-05-20 20:47 ` John Mudd 1 sibling, 1 reply; 12+ messages in thread From: John Mudd @ 2015-05-20 20:26 UTC (permalink / raw) To: musl; +Cc: John Mudd [-- Attachment #1: Type: text/plain, Size: 2899 bytes --] On Wed, May 20, 2015 at 11:28 AM, John Mudd <johnbmudd@gmail.com> wrote: > > > On Tue, May 19, 2015 at 5:51 PM, John Mudd <johnbmudd@gmail.com> wrote: > >> I'm trying to build a musl version of xclock. If I can build xclock then >> I hope to be able to build my app which is more complicated. I'm getting >> the following error. >> >> /usr/bin/ld: h_errno: TLS definition in //lib/i386-linux-gnu/libc.so.6 >> section .tbss mismatches non-TLS definition in >> /home/mudd/musl/musl-1.1.8.install/lib/libc.so section .bss >> >> > Rich Felker wrote: > "Yes, you're linking to glibc, or to something that was linked with > glibc. You should look though the X11 .so files you've built using > readelf and see if any of them have dependencies on libc.so.6. It > looks like you're using the host system's gcc and passing the > musl-gcc.specs file to it manually rather than using the musl-gcc > script or a real musl-targetted compiler toolchain, so it might be > something to do with that too. Adding -v to the command line and > seeing what gets passed to the linker command could be helpful." > > > > It doesn't look like any of my musl compiled libs point to libc.so.6. > $ readelf -a ./*.install/lib/lib*.so | grep libc.so.6 > $ > > Here's what the X11 libs point to. I've built and referenced all of these > dependencies using musl. > $ readelf -a ./*.install/lib/libX*.so | grep NEED | sort -u > 0x00000001 (NEEDED) Shared library: [libc.so] > 0x00000001 (NEEDED) Shared library: > [libfontconfig.so.1] > 0x00000001 (NEEDED) Shared library: [libfreetype.so.6] > 0x00000001 (NEEDED) Shared library: [libICE.so.6] > 0x00000001 (NEEDED) Shared library: [libSM.so.6] > 0x00000001 (NEEDED) Shared library: [libX11.so.6] > 0x00000001 (NEEDED) Shared library: [libXau.so.6] > 0x00000001 (NEEDED) Shared library: [libxcb.so.1] > 0x00000001 (NEEDED) Shared library: [libXext.so.6] > 0x00000001 (NEEDED) Shared library: [libxml2.so.2] > 0x00000001 (NEEDED) Shared library: [libXmu.so.6] > 0x00000001 (NEEDED) Shared library: [libXpm.so.4] > 0x00000001 (NEEDED) Shared library: [libXrender.so.1] > 0x00000001 (NEEDED) Shared library: [libXt.so.6] > 0x00000001 (NEEDED) Shared library: [libz.so.1] > $ > > > Yes, it's Ubuntu 14.04 $ uname -a Linux john-Precision-WorkStation-T3400 3.13.0-49-generic #83-Ubuntu SMP Fri Apr 10 20:14:51 UTC 2015 i686 i686 i686 GNU/Linux I tried creating an empty ld-linux.so.2 in /usr/lib/gcc/i686-linux-gnu/4.8/ and also in /home/mudd/musl/musl-1.1.8.install/lib/. I'm not sure if either is what Szabolcs Nagy suggested but neither seemed to make a difference. [-- Attachment #2: Type: text/html, Size: 4877 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: musl xclock? 2015-05-20 20:26 ` John Mudd @ 2015-05-20 20:47 ` John Mudd 2015-05-20 21:08 ` Szabolcs Nagy 0 siblings, 1 reply; 12+ messages in thread From: John Mudd @ 2015-05-20 20:47 UTC (permalink / raw) To: musl; +Cc: John Mudd [-- Attachment #1: Type: text/plain, Size: 5627 bytes --] > > > Yes, it's Ubuntu 14.04 > > $ uname -a > Linux john-Precision-WorkStation-T3400 3.13.0-49-generic #83-Ubuntu SMP > Fri Apr 10 20:14:51 UTC 2015 i686 i686 i686 GNU/Linux > > I tried creating an empty ld-linux.so.2 > in /usr/lib/gcc/i686-linux-gnu/4.8/ and also > in /home/mudd/musl/musl-1.1.8.install/lib/. I'm not sure if either is what > Szabolcs Nagy suggested but neither seemed to make a difference. > > I might be on to something... I added --verbose to the collect2 command. It listed this: libz.so.1 needed by /home/mudd/musl/libXft-2.3.2.install/lib/libXft.so found libz.so.1 at //lib/i386-linux-gnu/libz.so.1 libc.so.6 needed by //lib/i386-linux-gnu/libz.so.1 Back to libXft.so... $ readelf -a ./libXft-2.3.2.install/lib/libXft.so | grep NEED 0x00000001 (NEEDED) Shared library: [libfontconfig.so.1] 0x00000001 (NEEDED) Shared library: [libxml2.so.2] 0x00000001 (NEEDED) Shared library: [libfreetype.so.6] 0x00000001 (NEEDED) Shared library: [libz.so.1] 0x00000001 (NEEDED) Shared library: [libXrender.so.1] 0x00000001 (NEEDED) Shared library: [libX11.so.6] 0x00000001 (NEEDED) Shared library: [libxcb.so.1] 0x00000001 (NEEDED) Shared library: [libXau.so.6] 0x00000001 (NEEDED) Shared library: [libc.so] $ /home/mudd/musl/lib/ld-musl-i386.so.1 --list ./libXft-2.3.2.install/lib/libXft.so /home/mudd/musl/lib/ld-musl-i386.so.1 (0xb76b8000) libfontconfig.so.1 => /home/mudd/musl/fontconfig-2.11.93.install/lib/libfontconfig.so.1 (0xb7650000) libxml2.so.2 => /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2 (0xb7492000) libfreetype.so.6 => /home/mudd/musl/freetype-2.5.5.install/lib/libfreetype.so.6 (0xb73e1000) libz.so.1 => /usr/rx30/musl/zlib-1.2.8.install/lib/libz.so.1 (0xb73c7000) libXrender.so.1 => /home/mudd/musl/libXrender-0.9.8.install/lib/libXrender.so.1 (0xb73bc000) libX11.so.6 => /home/mudd/musl/libX11-1.6.3.install/lib/libX11.so.6 (0xb727a000) libxcb.so.1 => /home/mudd/musl/libxcb-1.11.install/lib/libxcb.so.1 (0xb7258000) libXau.so.6 => /home/mudd/musl/libXau-1.0.8.install/lib/libXau.so.6 (0xb7254000) libc.so => /home/mudd/musl/lib/ld-musl-i386.so.1 (0xb76b8000) $ But... look at this.... $ ln -s /home/mudd/musl/lib/ld-musl-i386.so.1 musl_lib $ musl_lib --list ./libXft-2.3.2.install/lib/libXft.so musl_lib (0xb76d0000) libfontconfig.so.1 => /home/mudd/musl/fontconfig-2.11.93.install/lib/libfontconfig.so.1 (0xb7668000) libxml2.so.2 => /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2 (0xb74aa000) libfreetype.so.6 => /home/mudd/musl/freetype-2.5.5.install/lib/libfreetype.so.6 (0xb73f9000) Error loading shared library libz.so.1: No such file or directory (needed by ./libXft-2.3.2.install/lib/libXft.so) libXrender.so.1 => /home/mudd/musl/libXrender-0.9.8.install/lib/libXrender.so.1 (0xb73ee000) libX11.so.6 => /home/mudd/musl/libX11-1.6.3.install/lib/libX11.so.6 (0xb72ac000) libxcb.so.1 => /home/mudd/musl/libxcb-1.11.install/lib/libxcb.so.1 (0xb728a000) libXau.so.6 => /home/mudd/musl/libXau-1.0.8.install/lib/libXau.so.6 (0xb7286000) libc.so => musl_lib (0xb76d0000) Error loading shared library libz.so.1: No such file or directory (needed by /home/mudd/musl/fontconfig-2.11.93.install/lib/lib Error loading shared library libz.so.1: No such file or directory (needed by /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2. Error loading shared library libz.so.1: No such file or directory (needed by /home/mudd/musl/freetype-2.5.5.install/lib/libfree Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: deflateEnd: symbol not found Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: gzclose: symbol not found Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: inflate: symbol not found Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: inflateInit2_: symbol not found Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: gzread: symbol not found Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: gzdopen: symbol not found Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: deflate: symbol not found Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: gzdirect: symbol not found Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: inflateEnd: symbol not found Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: gzwrite: symbol not found Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: crc32: symbol not found Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: deflateInit2_: symbol not found Error relocating /home/mudd/musl/libxml2-2.9.2.install/lib/libxml2.so.2: gzopen: symbol not found Error relocating /home/mudd/musl/freetype-2.5.5.install/lib/libfreetype.so.6: inflate: symbol not found Error relocating /home/mudd/musl/freetype-2.5.5.install/lib/libfreetype.so.6: inflateReset: symbol not found Error relocating /home/mudd/musl/freetype-2.5.5.install/lib/libfreetype.so.6: inflateEnd: symbol not found Error relocating /home/mudd/musl/freetype-2.5.5.install/lib/libfreetype.so.6: inflateInit2_: symbol not found $ This (getting errors when using link to ld-musl-i386.so.1 only happens when on ths one X11 lib. Is it significant? John [-- Attachment #2: Type: text/html, Size: 7541 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Re: musl xclock? 2015-05-20 20:47 ` John Mudd @ 2015-05-20 21:08 ` Szabolcs Nagy 2015-05-20 21:48 ` Szabolcs Nagy 0 siblings, 1 reply; 12+ messages in thread From: Szabolcs Nagy @ 2015-05-20 21:08 UTC (permalink / raw) To: musl; +Cc: John Mudd * John Mudd <johnbmudd@gmail.com> [2015-05-20 16:47:45 -0400]: > > It listed this: > > libz.so.1 needed by /home/mudd/musl/libXft-2.3.2.install/lib/libXft.so > found libz.so.1 at //lib/i386-linux-gnu/libz.so.1 > libc.so.6 needed by //lib/i386-linux-gnu/libz.so.1 > ok so you probably forgot to add libz to the -L path and then ld went ahead and found the wrong one > $ readelf -a ./libXft-2.3.2.install/lib/libXft.so | grep NEED > 0x00000001 (NEEDED) Shared library: > [libfontconfig.so.1] > 0x00000001 (NEEDED) Shared library: [libxml2.so.2] > 0x00000001 (NEEDED) Shared library: [libfreetype.so.6] > 0x00000001 (NEEDED) Shared library: [libz.so.1] > 0x00000001 (NEEDED) Shared library: [libXrender.so.1] > 0x00000001 (NEEDED) Shared library: [libX11.so.6] > 0x00000001 (NEEDED) Shared library: [libxcb.so.1] > 0x00000001 (NEEDED) Shared library: [libXau.so.6] > 0x00000001 (NEEDED) Shared library: [libc.so] > this is ok (in general you may also want to look at rpath too) > $ /home/mudd/musl/lib/ld-musl-i386.so.1 --list > ./libXft-2.3.2.install/lib/libXft.so ... > libz.so.1 => /usr/rx30/musl/zlib-1.2.8.install/lib/libz.so.1 > (0xb73c7000) ... > $ ln -s /home/mudd/musl/lib/ld-musl-i386.so.1 musl_lib > $ musl_lib --list ./libXft-2.3.2.install/lib/libXft.so ... > Error loading shared library libz.so.1: No such file or directory (needed > by ./libXft-2.3.2.install/lib/libXft.so) you probably have an /home/mudd/musl/etc/ld-musl-i386.path that is visible to the first command but not to the second (nor to ld). you may also want to figure out why ld tried the system paths (it either uses hard coded paths or gets them from some ld.so.conf, you can figure out what it's doing by using strace -f on the build command) ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Re: musl xclock? 2015-05-20 21:08 ` Szabolcs Nagy @ 2015-05-20 21:48 ` Szabolcs Nagy 2015-05-21 21:36 ` John Mudd 0 siblings, 1 reply; 12+ messages in thread From: Szabolcs Nagy @ 2015-05-20 21:48 UTC (permalink / raw) To: musl, John Mudd * Szabolcs Nagy <nsz@port70.net> [2015-05-20 23:08:02 +0200]: > * John Mudd <johnbmudd@gmail.com> [2015-05-20 16:47:45 -0400]: > > > > It listed this: > > > > libz.so.1 needed by /home/mudd/musl/libXft-2.3.2.install/lib/libXft.so > > found libz.so.1 at //lib/i386-linux-gnu/libz.so.1 > > libc.so.6 needed by //lib/i386-linux-gnu/libz.so.1 > > > > ok so you probably forgot to add libz to the -L path > and then ld went ahead and found the wrong one > i think -L probably wont help: libz is an indirect dependency not listed as -lz on the ld commandline in that case ld searches different set of paths you may want to set LD_LIBRARY_PATH or use -Wl,-rpath-link ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Re: musl xclock? 2015-05-20 21:48 ` Szabolcs Nagy @ 2015-05-21 21:36 ` John Mudd 0 siblings, 0 replies; 12+ messages in thread From: John Mudd @ 2015-05-21 21:36 UTC (permalink / raw) To: musl, John Mudd [-- Attachment #1: Type: text/plain, Size: 5297 bytes --] On Wed, May 20, 2015 at 5:48 PM, Szabolcs Nagy <nsz@port70.net> wrote: > * Szabolcs Nagy <nsz@port70.net> [2015-05-20 23:08:02 +0200]: > > * John Mudd <johnbmudd@gmail.com> [2015-05-20 16:47:45 -0400]: > > > > > > It listed this: > > > > > > libz.so.1 needed by /home/mudd/musl/libXft-2.3.2.install/lib/libXft.so > > > found libz.so.1 at //lib/i386-linux-gnu/libz.so.1 > > > libc.so.6 needed by //lib/i386-linux-gnu/libz.so.1 > > > > > > > ok so you probably forgot to add libz to the -L path > > and then ld went ahead and found the wrong one > > > > i think -L probably wont help: libz is an indirect dependency > not listed as -lz on the ld commandline > > in that case ld searches different set of paths > you may want to set LD_LIBRARY_PATH or use -Wl,-rpath-link > > I see, so the -L options work for libs specified by -l options but not indirect libs like libz. Strange. So I added -lz to my collect2 command and that much works now. I got an xclock executable but... it goes into an infinite loop when I try to run it. At least I got past the linker error. Thanks! Here's what strace shows and then it pauses (while still using 100% CPU) for about 20 secs. ... open("/usr/share/fonts/X11/Type1", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 5 fcntl64(5, F_SETFD, FD_CLOEXEC) = 0 getdents64(5, /* 23 entries */, 2048) = 728 getdents64(5, /* 0 entries */, 2048) = 0 stat64("/usr/share/fonts/X11/Type1/Symbol.afm", {st_mode=S_IFREG|0644, st_size=9532, ...}) = 0 brk(0x9680000) = 0x9680000 open("/usr/share/fonts/X11/Type1/Symbol.afm", O_RDONLY|O_LARGEFILE) = 6 fcntl64(6, F_SETFD, FD_CLOEXEC) = 0 fstat64(6, {st_mode=S_IFREG|0644, st_size=9532, ...}) = 0 mmap2(NULL, 9532, PROT_READ, MAP_PRIVATE, 6, 0) = 0xb714a000 close(6) = 0 mmap2(NULL, 143360, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7127000 munmap(0xb7127000, 143360) = 0 open("/usr/share/fonts/X11/Type1/._Symbol.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/%Symbol.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/.AppleDouble/Symbol.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/Symbol.afm/..namedfork/rsrc", O_RDONLY|O_LARGEFILE) = -1 ENOTDIR (Not a directory) open("/usr/share/fonts/X11/Type1/Symbol.afm/rsrc", O_RDONLY|O_LARGEFILE) = -1 ENOTDIR (Not a directory) open("/usr/share/fonts/X11/Type1/resource.frk/Symbol.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/.resource/Symbol.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) munmap(0xb714a000, 9532) = 0 stat64("/usr/share/fonts/X11/Type1/Symbol.pfb", {st_mode=S_IFREG|0644, st_size=37744, ...}) = 0 open("/usr/share/fonts/X11/Type1/Symbol.pfb", O_RDONLY|O_LARGEFILE) = 6 fcntl64(6, F_SETFD, FD_CLOEXEC) = 0 fstat64(6, {st_mode=S_IFREG|0644, st_size=37744, ...}) = 0 mmap2(NULL, 37744, PROT_READ, MAP_PRIVATE, 6, 0) = 0xb7143000 close(6) = 0 brk(0x9688000) = 0x9688000 brk(0x968a000) = 0x968a000 brk(0x968e000) = 0x968e000 brk(0x9693000) = 0x9693000 then this much more after 20 secs pause: munmap(0xb7143000, 37744) = 0 stat64("/usr/share/fonts/X11/Type1/c0419bt_.afm", {st_mode=S_IFREG|0644, st_size=15395, ...}) = 0 open("/usr/share/fonts/X11/Type1/c0419bt_.afm", O_RDONLY|O_LARGEFILE) = 6 fcntl64(6, F_SETFD, FD_CLOEXEC) = 0 fstat64(6, {st_mode=S_IFREG|0644, st_size=15395, ...}) = 0 mmap2(NULL, 15395, PROT_READ, MAP_PRIVATE, 6, 0) = 0xb7149000 close(6) = 0 mmap2(NULL, 143360, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7126000 munmap(0xb7126000, 143360) = 0 open("/usr/share/fonts/X11/Type1/._c0419bt_.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/%c0419bt_.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/.AppleDouble/c0419bt_.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/c0419bt_.afm/..namedfork/rsrc", O_RDONLY|O_LARGEFILE) = -1 ENOTDIR (Not a directory) open("/usr/share/fonts/X11/Type1/c0419bt_.afm/rsrc", O_RDONLY|O_LARGEFILE) = -1 ENOTDIR (Not a directory) open("/usr/share/fonts/X11/Type1/resource.frk/c0419bt_.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/.resource/c0419bt_.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) munmap(0xb7149000, 15395) = 0 stat64("/usr/share/fonts/X11/Type1/c0419bt_.pfb", {st_mode=S_IFREG|0644, st_size=40766, ...}) = 0 open("/usr/share/fonts/X11/Type1/c0419bt_.pfb", O_RDONLY|O_LARGEFILE) = 6 fcntl64(6, F_SETFD, FD_CLOEXEC) = 0 fstat64(6, {st_mode=S_IFREG|0644, st_size=40766, ...}) = 0 mmap2(NULL, 40766, PROT_READ, MAP_PRIVATE, 6, 0) = 0xb7143000 close(6) = 0 brk(0x9698000) = 0x9698000 repeating indefinitely... [-- Attachment #2: Type: text/html, Size: 7640 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-05-21 21:36 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-05-19 21:51 musl xclock? John Mudd 2015-05-19 22:13 ` Rich Felker 2015-05-20 15:28 ` John Mudd 2015-05-20 16:05 ` Rich Felker 2015-05-20 17:00 ` Szabolcs Nagy 2015-05-20 17:02 ` Szabolcs Nagy 2015-05-20 17:43 ` Rich Felker 2015-05-20 20:26 ` John Mudd 2015-05-20 20:47 ` John Mudd 2015-05-20 21:08 ` Szabolcs Nagy 2015-05-20 21:48 ` Szabolcs Nagy 2015-05-21 21:36 ` John Mudd
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/musl/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).