Build fails while trying to build the latest systemtap snapshot (820e7ac7a68952d88cc8ff702f18e8c4b7eae822), the configure reported following error checking whether yytext is a pointer... yes checking for gcc with C99 support... yes checking for __thread support... no configure: error: __thread support required build-elfutils/config.log -------------------------- configure:4044: checking for __thread support configure:4077: gcc -o conftest -fpic -g -O2 -shared -Wl,-z,defs,-z,relro -Wl,--enable-new-dtags,-rpath,${exec_prefix}/lib/systemtap conftest.c >&5 /tmp/ccIxYbGJ.o(.text+0x24): In function `foo': /tmp/systemtap/systemtap/src/build-elfutils/conftest.c:13: undefined reference to `__tls_get_addr' collect2: ld returned 1 exit status configure:4084: $? = 1 configure: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME "Red Hat elfutils" | #define PACKAGE_TARNAME "elfutils" | #define PACKAGE_VERSION "0.140" | #define PACKAGE_STRING "Red Hat elfutils 0.140" | #define PACKAGE_BUGREPORT "http://bugzilla.redhat.com/bugzilla/" | #define PACKAGE "elfutils" | #define VERSION "0.140" | #define MODVERSION "Build on gekko-lp3.ltc.austin.ibm.com 2009-03-06T04:00:49-0500" | #define YYTEXT_POINTER 1 | /* end confdefs.h. */ | #undef __thread | static __thread int a; int foo (int b) { return a + b; } | int | main () | { | exit (foo (0)); | ; | return 0; | } configure:4106: result: no configure:4109: error: __thread support required # gcc -v Reading specs from /usr/lib/gcc/ppc64-redhat-linux/3.4.6/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=ppc64-redhat-linux --build=ppc64-redhat-linux --target=ppc64-redhat-linux --with-cpu=default32 Thread model: posix gcc version 3.4.6 20060404 (Red Hat 3.4.6-10) When it was build using the gcc4/g++4, the configure reported following failure configure:2904: checking for C compiler default output file name configure:2926: /usr/bin/gcc4 -g -O2 -fstack-protector-all -D_FORTIFY_SOURCE=2 -Wl,--enable-new-dtags,-rpath,${exec_prefix}/lib/systemtap conftest.c >&5 /usr/bin/ld: cannot find -lssp_nonshared collect2: ld returned 1 exit status configure:2930: $? = 1 configure:2968: result: configure: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME "Red Hat elfutils" | #define PACKAGE_TARNAME "elfutils" | #define PACKAGE_VERSION "0.140" | #define PACKAGE_STRING "Red Hat elfutils 0.140" | #define PACKAGE_BUGREPORT "http://bugzilla.redhat.com/bugzilla/" | #define PACKAGE "elfutils" | #define VERSION "0.140" | #define MODVERSION "Build on gekko-lp3.ltc.austin.ibm.com 2009-03-06T04:09:27-0500" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:2974: error: in `/tmp/systemtap/systemtap/src/build-elfutils': configure:2977: error: C compiler cannot create executables # /usr/bin/gcc4 -v Using built-in specs. Target: ppc64-redhat-linux5E Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --with-gxx-include-dir=/usr/include/c++/3.4.3 --enable-libgcj-multifile --enable-languages=c,c++,java,f95 --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --host=ppc64-redhat-linux5E --build=ppc64-redhat-linux5E --target=ppc64-redhat-linux5E --with-cpu=default32 Thread model: posix gcc version 4.1.2 20071124 (Red Hat 4.1.2-42) We tried configuring it, without ssp ./configure --with-elfutils=${PWD}/../../elfutils-*/ --disable-ssp and build-elfutils/config.log reported following failure. configure:4044: checking for __thread support configure:4077: /usr/bin/gcc4 -o conftest -fpic -g -O2 -shared -Wl,-z,defs,-z,relro -Wl,--enable-new-dtags,-rpath,${exec_prefix}/lib/systemtap conftest.c >&5 conftest.c: In function 'main': conftest.c:17: warning: incompatible implicit declaration of built-in function 'exit' /tmp/cc0tNqjJ.o(.text+0x24): In function `foo': /tmp/systemtap/systemtap/src/build-elfutils/conftest.c:13: undefined reference to `__tls_get_addr' collect2: ld returned 1 exit status configure:4084: $? = 1 configure: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME "Red Hat elfutils" | #define PACKAGE_TARNAME "elfutils" | #define PACKAGE_VERSION "0.140" | #define PACKAGE_STRING "Red Hat elfutils 0.140" | #define PACKAGE_BUGREPORT "http://bugzilla.redhat.com/bugzilla/" | #define PACKAGE "elfutils" | #define VERSION "0.140" | #define MODVERSION "Build on gekko-lp3.ltc.austin.ibm.com 2009-03-06T04:13:26-0500" | #define YYTEXT_POINTER 1 | /* end confdefs.h. */ | #undef __thread | static __thread int a; int foo (int b) { return a + b; } | int | main () | { | exit (foo (0)); | ; | return 0; | } configure:4106: result: no configure:4109: error: __thread support required
Note that it is building a bundled modern elfutils that causes this error, not systemtap per se. Elfutils versions older than 2009-01 (0.139) should not require __threads / TLS support in gcc.
You need elfutils-portability.patch for systems older than ~RHEL5.
(In reply to comment #1) > Note that it is building a bundled modern elfutils that causes this error, > not systemtap per se. Elfutils versions older than 2009-01 (0.139) should > not require __threads / TLS support in gcc. > The build was successful, with Elfutils-0.138.
(In reply to comment #2) > You need elfutils-portability.patch for systems older than ~RHEL5. While trying to apply the patch, there were lots of rejects.
We need to note use of elfutils 0.139 or earlier (or else the per-release portability patch). commit fffc971