Frank Lichtenheld wrote:
> On Fri, Nov 10, 2006 at 01:03:04AM +0100, Michael Biebl wrote:
>> Frank Lichtenheld wrote:
>>> your package failed to build from source since it tried to use
>>> the __thread keyword on hppa where it is not supported.
>>>
>> thanks for your bug report. I guess, upstart is not the only program
>> using __thread and so failing to compile on hppa. Do you know how others
>> solved this issue? Can you give me some pointers how to deal with this
>> properly?
> 
> glibc uses __thread (I know because it currently fails to build from
> source in experimental on hppa because of this ;). But I can't say
> how it handles arches where it is not supported.
> 

Hi Frank,

could you please try the attached patch (patch -p1) and tell me if
successfully compiles on hppa then.

Cheers,
Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
diff -urN upstart-0.2.7.orig/aclocal.m4 upstart-0.2.7/aclocal.m4
--- upstart-0.2.7.orig/aclocal.m4	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/aclocal.m4	2006-11-11 15:03:28.000000000 +0100
@@ -7241,6 +7241,7 @@
 m4_include([m4/signed.m4])
 m4_include([m4/size_max.m4])
 m4_include([m4/stdint_h.m4])
+m4_include([m4/tls.m4])
 m4_include([m4/uintmax_t.m4])
 m4_include([m4/ulonglong.m4])
 m4_include([m4/wchar_t.m4])
diff -urN upstart-0.2.7.orig/compat/sysv/Makefile.in upstart-0.2.7/compat/sysv/Makefile.in
--- upstart-0.2.7.orig/compat/sysv/Makefile.in	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/compat/sysv/Makefile.in	2006-11-11 15:03:38.000000000 +0100
@@ -54,9 +54,10 @@
 	$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \
 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \
 	$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
-	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
-	$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
-	$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \
+	$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff -urN upstart-0.2.7.orig/config.h.in upstart-0.2.7/config.h.in
--- upstart-0.2.7.orig/config.h.in	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/config.h.in	2006-11-11 15:03:34.000000000 +0100
@@ -186,6 +186,9 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if the target supports thread-local storage. */
+#undef HAVE_TLS
+
 /* Define to 1 if you have the `tsearch' function. */
 #undef HAVE_TSEARCH
 
diff -urN upstart-0.2.7.orig/configure upstart-0.2.7/configure
--- upstart-0.2.7.orig/configure	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/configure	2006-11-11 15:03:33.000000000 +0100
@@ -1491,6 +1491,7 @@
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-tls            Use thread-local storage [default=yes]
   --enable-compiler-warnings
                           Enable additional compiler warnings
   --disable-compiler-optimisations
@@ -13032,7 +13033,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 13035 "configure"' > conftest.$ac_ext
+  echo '#line 13036 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -15460,11 +15461,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15463: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15464: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15467: \$? = $ac_status" >&5
+   echo "$as_me:15468: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -15728,11 +15729,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15731: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15732: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15735: \$? = $ac_status" >&5
+   echo "$as_me:15736: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -15832,11 +15833,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15835: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15836: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15839: \$? = $ac_status" >&5
+   echo "$as_me:15840: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -18273,7 +18274,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18276 "configure"
+#line 18277 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18373,7 +18374,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18376 "configure"
+#line 18377 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -20741,11 +20742,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:20744: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:20745: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:20748: \$? = $ac_status" >&5
+   echo "$as_me:20749: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -20845,11 +20846,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:20848: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:20849: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:20852: \$? = $ac_status" >&5
+   echo "$as_me:20853: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -22406,11 +22407,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:22409: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:22410: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:22413: \$? = $ac_status" >&5
+   echo "$as_me:22414: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -22510,11 +22511,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:22513: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:22514: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:22517: \$? = $ac_status" >&5
+   echo "$as_me:22518: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -24729,11 +24730,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:24732: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:24733: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:24736: \$? = $ac_status" >&5
+   echo "$as_me:24737: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -24997,11 +24998,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:25000: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:25001: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:25004: \$? = $ac_status" >&5
+   echo "$as_me:25005: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -25101,11 +25102,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:25104: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:25105: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:25108: \$? = $ac_status" >&5
+   echo "$as_me:25109: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -28171,6 +28172,160 @@
 # Checks for library functions.
 
 # Other checks
+
+  # Check whether --enable-tls was given.
+if test "${enable_tls+set}" = set; then
+  enableval=$enable_tls; enable_tls=$enableval
+else
+  enable_tls=yes
+fi
+
+  { echo "$as_me:$LINENO: checking whether the target supports thread-local storage" >&5
+echo $ECHO_N "checking whether the target supports thread-local storage... $ECHO_C" >&6; }
+if test "${have_tls+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+    if test "$cross_compiling" = yes; then
+  cat >conftest.$ac_ext <<_ACEOF
+__thread int foo;
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  have_tls=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	have_tls=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+__thread int a; int b; int main() { return a = b; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+                    save_LDFLAGS="$LDFLAGS"
+      LDFLAGS="-static $LDFLAGS"
+      if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+__thread int a; int b; int main() { return a = b; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  have_tls=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+have_tls=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+      LDFLAGS="$save_LDFLAGS"
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+have_tls=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $have_tls" >&5
+echo "${ECHO_T}$have_tls" >&6; }
+  if test "$enable_tls $have_tls" = "yes yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_TLS 1
+_ACEOF
+
+  fi
 # Check whether --enable-compiler-warnings was given.
 if test "${enable_compiler_warnings+set}" = set; then
   enableval=$enable_compiler_warnings; if test "x$enable_compiler_warnings" = "xyes"; then
diff -urN upstart-0.2.7.orig/configure.ac upstart-0.2.7/configure.ac
--- upstart-0.2.7.orig/configure.ac	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/configure.ac	2006-11-11 15:03:17.000000000 +0100
@@ -26,6 +26,7 @@
 # Checks for library functions.
 
 # Other checks
+NIH_CHECK_TLS
 NIH_COMPILER_WARNINGS
 NIH_COMPILER_OPTIMISATIONS
 NIH_COMPILER_COVERAGE
diff -urN upstart-0.2.7.orig/event.d/Makefile.in upstart-0.2.7/event.d/Makefile.in
--- upstart-0.2.7.orig/event.d/Makefile.in	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/event.d/Makefile.in	2006-11-11 15:03:38.000000000 +0100
@@ -52,9 +52,10 @@
 	$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \
 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \
 	$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
-	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
-	$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
-	$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \
+	$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff -urN upstart-0.2.7.orig/init/Makefile.in upstart-0.2.7/init/Makefile.in
--- upstart-0.2.7.orig/init/Makefile.in	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/init/Makefile.in	2006-11-11 15:03:39.000000000 +0100
@@ -54,9 +54,10 @@
 	$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \
 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \
 	$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
-	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
-	$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
-	$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \
+	$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff -urN upstart-0.2.7.orig/logd/Makefile.in upstart-0.2.7/logd/Makefile.in
--- upstart-0.2.7.orig/logd/Makefile.in	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/logd/Makefile.in	2006-11-11 15:03:39.000000000 +0100
@@ -54,9 +54,10 @@
 	$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \
 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \
 	$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
-	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
-	$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
-	$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \
+	$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff -urN upstart-0.2.7.orig/m4/Makefile.in upstart-0.2.7/m4/Makefile.in
--- upstart-0.2.7.orig/m4/Makefile.in	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/m4/Makefile.in	2006-11-11 15:03:39.000000000 +0100
@@ -53,9 +53,10 @@
 	$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \
 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \
 	$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
-	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
-	$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
-	$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \
+	$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff -urN upstart-0.2.7.orig/m4/tls.m4 upstart-0.2.7/m4/tls.m4
--- upstart-0.2.7.orig/m4/tls.m4	1970-01-01 01:00:00.000000000 +0100
+++ upstart-0.2.7/m4/tls.m4	2006-11-11 15:03:17.000000000 +0100
@@ -0,0 +1,23 @@
+dnl Check whether the target supports TLS.
+AC_DEFUN([NIH_CHECK_TLS], [
+  AC_ARG_ENABLE(tls,
+                AS_HELP_STRING([--enable-tls], [Use thread-local storage @<:@default=yes@:>@]),
+		[enable_tls=$enableval], [enable_tls=yes])
+  AC_CACHE_CHECK([whether the target supports thread-local storage],
+		 have_tls, [
+    AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }],
+      [dnl If the test case passed with dynamic linking, try again with
+      dnl static linking.  This fails at least with some older Red Hat
+      dnl releases.
+      save_LDFLAGS="$LDFLAGS"
+      LDFLAGS="-static $LDFLAGS"
+      AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }],
+		    [have_tls=yes], [have_tls=no], [])
+      LDFLAGS="$save_LDFLAGS"],
+      [have_tls=no],
+      [AC_COMPILE_IFELSE([__thread int foo;], [have_tls=yes], [have_tls=no])]
+    )])
+  if test "$enable_tls $have_tls" = "yes yes"; then
+    AC_DEFINE(HAVE_TLS, 1,
+	      [Define to 1 if the target supports thread-local storage.])
+  fi])
diff -urN upstart-0.2.7.orig/Makefile.in upstart-0.2.7/Makefile.in
--- upstart-0.2.7.orig/Makefile.in	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/Makefile.in	2006-11-11 15:03:40.000000000 +0100
@@ -56,9 +56,10 @@
 	$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \
 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \
 	$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
-	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
-	$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
-	$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \
+	$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
diff -urN upstart-0.2.7.orig/man/Makefile.in upstart-0.2.7/man/Makefile.in
--- upstart-0.2.7.orig/man/Makefile.in	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/man/Makefile.in	2006-11-11 15:03:39.000000000 +0100
@@ -52,9 +52,10 @@
 	$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \
 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \
 	$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
-	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
-	$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
-	$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \
+	$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff -urN upstart-0.2.7.orig/nih/error.c upstart-0.2.7/nih/error.c
--- upstart-0.2.7.orig/nih/error.c	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/nih/error.c	2006-11-11 15:03:17.000000000 +0100
@@ -60,8 +60,11 @@
  *
  * Stack of error contexts.
  **/
-static __thread NihList *context_stack = NULL;
-
+#ifdef HAVE_TLS
+  static __thread NihList *context_stack = NULL;
+#else
+  static NihList *context_stack = NULL;
+#endif
 
 /**
  * CURRENT_CONTEXT:
diff -urN upstart-0.2.7.orig/nih/main.c upstart-0.2.7/nih/main.c
--- upstart-0.2.7.orig/nih/main.c	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/nih/main.c	2006-11-11 15:03:17.000000000 +0100
@@ -130,14 +130,22 @@
  * Whether to exit the running main loop, set to TRUE by a call to
  * #nih_main_loop_exit.
  **/
-static __thread int exit_loop = 0;
+#ifdef HAVE_TLS
+  static __thread int exit_loop = 0;
+#else
+  static int exit_loop = 0;
+#endif
 
 /**
  * exit_status:
  *
  * Status to exit the running main loop with, set by #nih_main_loop_exit.
  **/
-static __thread int exit_status = 0;
+#ifdef HAVE_TLS
+  static __thread int exit_status = 0;
+#else
+  static int exit_status = 0;
+#endif
 
 /**
  * loop_functions:
diff -urN upstart-0.2.7.orig/nih/Makefile.in upstart-0.2.7/nih/Makefile.in
--- upstart-0.2.7.orig/nih/Makefile.in	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/nih/Makefile.in	2006-11-11 15:03:39.000000000 +0100
@@ -56,9 +56,10 @@
 	$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \
 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \
 	$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
-	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
-	$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
-	$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \
+	$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff -urN upstart-0.2.7.orig/upstart/Makefile.in upstart-0.2.7/upstart/Makefile.in
--- upstart-0.2.7.orig/upstart/Makefile.in	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/upstart/Makefile.in	2006-11-11 15:03:40.000000000 +0100
@@ -56,9 +56,10 @@
 	$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \
 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \
 	$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
-	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
-	$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
-	$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \
+	$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff -urN upstart-0.2.7.orig/util/Makefile.in upstart-0.2.7/util/Makefile.in
--- upstart-0.2.7.orig/util/Makefile.in	2006-11-11 15:02:06.000000000 +0100
+++ upstart-0.2.7/util/Makefile.in	2006-11-11 15:03:40.000000000 +0100
@@ -55,9 +55,10 @@
 	$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \
 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \
 	$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
-	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
-	$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
-	$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \
+	$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to