public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Disable libitm if unsupported
@ 2011-11-08 16:55 Richard Henderson
  2011-11-08 17:38 ` Pedro Alves
  0 siblings, 1 reply; 13+ messages in thread
From: Richard Henderson @ 2011-11-08 16:55 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 386 bytes --]

As suggested by Joseph, this consolidates the knowledge of libitm
support in the libitm directory.  And better, in a file not controlled
by autoconf, so less fumbling around for the correct edition.  ;-)

Committed in two hunks because I faffed it the first time and managed
to not notice that I'd disabled libitm on supported systems too.

Tested on x86_64-linux and ppc64-linux.


r~

[-- Attachment #2: z --]
[-- Type: text/plain, Size: 4192 bytes --]

toplevel/
	* configure.ac: Adjust srcdir for running libitm/configure.tgt.

	* configure.ac: Test libitm/configure.tgt to disable libitm.
	* configure: Rebuild.

libitm/
	* configure.tgt: Test correct directory for supported cpus.

	* configure.ac: Exit if unsupported.
	* configure: Rebuild.
	* configure.tgt: Delete boilerplate from libgomp for unsupported
	targets.  Set UNSUPPORTED for unsupported targets.



diff --git a/configure.ac b/configure.ac
index 4bca6d8..888d051 100644
--- a/configure.ac
+++ b/configure.ac
@@ -493,22 +493,17 @@ if test x$enable_libgomp = x ; then
     esac
 fi
 
-# Disable libitm on non POSIX hosted systems.
-if test x$enable_libitm = x ; then
-    # Enable libitm by default on hosted POSIX systems.
-    case "${target}" in
-    *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
-	;;
-    *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
-	;;
-    *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*)
-	;;
-    *-*-darwin* | *-*-aix*)
-	;;
-    *)
+# Disable libitm on unsupported hosted systems.
+if test x$enable_libitm = x; then
+   AC_MSG_CHECKING([for libitm support])
+   if (srcdir=${srcdir}/libitm; \
+       . ${srcdir}/configure.tgt; \
+       test -n "$UNSUPPORTED"); then
+	AC_MSG_RESULT([no])
 	noconfigdirs="$noconfigdirs target-libitm"
-	;;
-    esac
+   else
+	AC_MSG_RESULT([yes])
+   fi
 fi
 
 # Disable libssp for some systems.
diff --git a/libitm/configure.ac b/libitm/configure.ac
index 7f35b15..dea7038 100644
--- a/libitm/configure.ac
+++ b/libitm/configure.ac
@@ -224,6 +224,10 @@ LIBITM_CHECK_SIZE_T_MANGLING
 
 # Get target configury.
 . ${srcdir}/configure.tgt
+if test -n "$UNSUPPORTED"; then
+  AC_MSG_ERROR([Configuration ${target} is unsupported.])
+fi
+
 CFLAGS="$save_CFLAGS $XCFLAGS"
 
 # Check for __sync_val_compare_and_swap, but only after the target has
diff --git a/libitm/configure.tgt b/libitm/configure.tgt
index 7d9b7f6..eac6f50 100644
--- a/libitm/configure.tgt
+++ b/libitm/configure.tgt
@@ -28,7 +28,7 @@
 #  XLDFLAGS		Add extra link flags to use.
 
 # Optimize TLS usage by avoiding the overhead of dynamic allocation.
-if test $gcc_cv_have_tls = yes ; then
+if test "$gcc_cv_have_tls" = yes ; then
   case "${target}" in
 
     # For x86, we use slots in the TCB head for most of our TLS.
@@ -47,10 +47,6 @@ fi
 # work out any special compilation flags as necessary.
 case "${target_cpu}" in
   alpha*)	ARCH=alpha ;;
-  ia64*)	ARCH=ia64 ;;
-  mips*)	ARCH=mips ;;
-  powerpc*)	ARCH=powerpc ;;
-  s390*)	ARCH=s390 ;;
 
   i[3456]86)
 	case " ${CC} ${CFLAGS} " in
@@ -75,57 +71,33 @@ case "${target_cpu}" in
 	ARCH=x86
 	;;
 
-  sparcv9 | sparc64)
-	# Note that sparcv7 and sparcv8 is not included here.  We need cas.
-	echo "int i;" > conftestx.c
-	if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then
-	  case "`/usr/bin/file conftestx.o`" in
-	    *32-bit*)
-	      case " ${CC} ${CFLAGS}" in
-		*" -mcpu=ultrasparc"*)
-		  ;;
-		*)
-		  XCFLAGS="${XCFLAGS} -mcpu=v9"
-		  ;;
-	      esac
-	      ;;
-	  esac
-	fi
-	rm -f conftestx.c conftestx.o
-	ARCH=sparc
-	;;
-
   *)
 	ARCH="${target_cpu}"
 	;;
 esac
-  
+
+# For the benefit of top-level configure, determine if the cpu is supported.
+test -d ${srcdir}/config/$ARCH || UNSUPPORTED=1
+
 # Since we require POSIX threads, assume a POSIX system by default.
 config_path="$ARCH posix generic"
 
 # Other system configury
 case "${target}" in
   *-*-linux*)
-	if test $enable_linux_futex = yes; then
+	if test "$enable_linux_futex" = yes; then
 	  config_path="linux/$ARCH linux $config_path"
 	fi
 	;;
 
-  *-*-hpux11*)
-	# HPUX v11.x requires -lrt to resolve sem_init in libgomp.la
-	XLDFLAGS="${XLDFLAGS} -lrt"
-	;;
-
-  *-*-mingw32*)
-	config_path="$ARCH mingw32 posix generic"
-	;;
-
-  *-*-solaris2.[56]*)
-	config_path="$ARCH posix95 posix generic"
-	XLDFLAGS="${XLDFLAGS} -lposix4"
+  *-*-gnu* | *-*-k*bsd*-gnu \
+  | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
+  | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \
+  | *-*-darwin* | *-*-aix*)
+	# POSIX system.  The OS is supported.
 	;;
 
-  *-*-darwin*)
-	config_path="$ARCH bsd posix generic"
+  *)	# Non-POSIX, or embedded system
+	UNSUPPORTED=1
 	;;
 esac

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Disable libitm if unsupported
  2011-11-08 16:55 Disable libitm if unsupported Richard Henderson
@ 2011-11-08 17:38 ` Pedro Alves
  2011-11-08 17:40   ` Richard Henderson
  0 siblings, 1 reply; 13+ messages in thread
From: Pedro Alves @ 2011-11-08 17:38 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Henderson

On Tuesday 08 November 2011 16:33:52, Richard Henderson wrote:
> toplevel/
>         * configure.ac: Adjust srcdir for running libitm/configure.tgt.

> +# Disable libitm on unsupported hosted systems.
> +if test x$enable_libitm = x; then
> +   AC_MSG_CHECKING([for libitm support])
> +   if (srcdir=${srcdir}/libitm; \
> +       . ${srcdir}/configure.tgt; \

This should check that libitm exists before sourcing the script,
as otherwise it will error out on src tree
checkouts (binutils, gdb, ...), given that the libitm directory
doesn't exist there.

> +       test -n "$UNSUPPORTED"); then
> +       AC_MSG_RESULT([no])
>         noconfigdirs="$noconfigdir

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Disable libitm if unsupported
  2011-11-08 17:38 ` Pedro Alves
@ 2011-11-08 17:40   ` Richard Henderson
  2011-11-08 18:13     ` Pedro Alves
  0 siblings, 1 reply; 13+ messages in thread
From: Richard Henderson @ 2011-11-08 17:40 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gcc-patches

On 11/08/2011 09:26 AM, Pedro Alves wrote:
> On Tuesday 08 November 2011 16:33:52, Richard Henderson wrote:
>> toplevel/
>>         * configure.ac: Adjust srcdir for running libitm/configure.tgt.
> 
>> +# Disable libitm on unsupported hosted systems.
>> +if test x$enable_libitm = x; then
>> +   AC_MSG_CHECKING([for libitm support])
>> +   if (srcdir=${srcdir}/libitm; \
>> +       . ${srcdir}/configure.tgt; \
> 
> This should check that libitm exists before sourcing the script,
> as otherwise it will error out on src tree
> checkouts (binutils, gdb, ...), given that the libitm directory
> doesn't exist there.

Should I bother with an explicit test, or just use "set -e"?


r~

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Disable libitm if unsupported
  2011-11-08 17:40   ` Richard Henderson
@ 2011-11-08 18:13     ` Pedro Alves
  2011-11-08 18:35       ` Richard Henderson
  0 siblings, 1 reply; 13+ messages in thread
From: Pedro Alves @ 2011-11-08 18:13 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

On Tuesday 08 November 2011 17:31:45, Richard Henderson wrote:
> On 11/08/2011 09:26 AM, Pedro Alves wrote:
> > On Tuesday 08 November 2011 16:33:52, Richard Henderson wrote:
> >> toplevel/
> >>         * configure.ac: Adjust srcdir for running libitm/configure.tgt.
> > 
> >> +# Disable libitm on unsupported hosted systems.
> >> +if test x$enable_libitm = x; then
> >> +   AC_MSG_CHECKING([for libitm support])
> >> +   if (srcdir=${srcdir}/libitm; \
> >> +       . ${srcdir}/configure.tgt; \
> > 
> > This should check that libitm exists before sourcing the script,
> > as otherwise it will error out on src tree
> > checkouts (binutils, gdb, ...), given that the libitm directory
> > doesn't exist there.
> 
> Should I bother with an explicit test, or just use "set -e"?

Whatever works is fine with me.  :-)

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Disable libitm if unsupported
  2011-11-08 18:13     ` Pedro Alves
@ 2011-11-08 18:35       ` Richard Henderson
  2011-11-08 21:29         ` Iain Sandoe
  0 siblings, 1 reply; 13+ messages in thread
From: Richard Henderson @ 2011-11-08 18:35 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 907 bytes --]

On 11/08/2011 09:56 AM, Pedro Alves wrote:
> On Tuesday 08 November 2011 17:31:45, Richard Henderson wrote:
>> On 11/08/2011 09:26 AM, Pedro Alves wrote:
>>> On Tuesday 08 November 2011 16:33:52, Richard Henderson wrote:
>>>> toplevel/
>>>>         * configure.ac: Adjust srcdir for running libitm/configure.tgt.
>>>
>>>> +# Disable libitm on unsupported hosted systems.
>>>> +if test x$enable_libitm = x; then
>>>> +   AC_MSG_CHECKING([for libitm support])
>>>> +   if (srcdir=${srcdir}/libitm; \
>>>> +       . ${srcdir}/configure.tgt; \
>>>
>>> This should check that libitm exists before sourcing the script,
>>> as otherwise it will error out on src tree
>>> checkouts (binutils, gdb, ...), given that the libitm directory
>>> doesn't exist there.
>>
>> Should I bother with an explicit test, or just use "set -e"?
> 
> Whatever works is fine with me.  :-)
> 

Tested and committed the following.


r~

[-- Attachment #2: z --]
[-- Type: text/plain, Size: 2574 bytes --]

diff --git a/ChangeLog b/ChangeLog
index 89eb37a..c25db94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2011-11-08  Richard Henderson  <rth@redhat.com>
 
+	* configure.ac: Test for libitm directory present first.
+
 	* configure.ac: Adjust srcdir for running libitm/configure.tgt.
 
 	* configure.ac: Test libitm/configure.tgt to disable libitm.
diff --git a/configure b/configure
index 7a7f287..8a37411 100755
--- a/configure
+++ b/configure
@@ -3057,20 +3057,23 @@ if test x$enable_libgomp = x ; then
     esac
 fi
 
-# Disable libitm on unsupported hosted systems.
-if test x$enable_libitm = x; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libitm support" >&5
+# Disable libitm on unsupported systems.
+if test -d ${srcdir}/libitm; then
+    if test x$enable_libitm = x; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libitm support" >&5
 $as_echo_n "checking for libitm support... " >&6; }
-   if (srcdir=${srcdir}/libitm; \
-       . ${srcdir}/configure.tgt; \
-       test -n "$UNSUPPORTED"); then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	noconfigdirs="$noconfigdirs target-libitm"
-   else
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+	if (srcdir=${srcdir}/libitm; \
+		. ${srcdir}/configure.tgt; \
+		test -n "$UNSUPPORTED")
+	then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	    noconfigdirs="$noconfigdirs target-libitm"
+	else
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-   fi
+	fi
+    fi
 fi
 
 # Disable libssp for some systems.
diff --git a/configure.ac b/configure.ac
index 888d051..efabad4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -493,17 +493,20 @@ if test x$enable_libgomp = x ; then
     esac
 fi
 
-# Disable libitm on unsupported hosted systems.
-if test x$enable_libitm = x; then
-   AC_MSG_CHECKING([for libitm support])
-   if (srcdir=${srcdir}/libitm; \
-       . ${srcdir}/configure.tgt; \
-       test -n "$UNSUPPORTED"); then
-	AC_MSG_RESULT([no])
-	noconfigdirs="$noconfigdirs target-libitm"
-   else
-	AC_MSG_RESULT([yes])
-   fi
+# Disable libitm on unsupported systems.
+if test -d ${srcdir}/libitm; then
+    if test x$enable_libitm = x; then
+	AC_MSG_CHECKING([for libitm support])
+	if (srcdir=${srcdir}/libitm; \
+		. ${srcdir}/configure.tgt; \
+		test -n "$UNSUPPORTED")
+	then
+	    AC_MSG_RESULT([no])
+	    noconfigdirs="$noconfigdirs target-libitm"
+	else
+	    AC_MSG_RESULT([yes])
+	fi
+    fi
 fi
 
 # Disable libssp for some systems.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Disable libitm if unsupported
  2011-11-08 18:35       ` Richard Henderson
@ 2011-11-08 21:29         ` Iain Sandoe
  2011-11-08 21:33           ` Richard Henderson
  0 siblings, 1 reply; 13+ messages in thread
From: Iain Sandoe @ 2011-11-08 21:29 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Aldy Hernandez, gcc-patches Patches

Hi Chaps....

On 8 Nov 2011, at 18:22, Richard Henderson wrote:

> On 11/08/2011 09:56 AM, Pedro Alves wrote:
>> On Tuesday 08 November 2011 17:31:45, Richard Henderson wrote:
>>> On 11/08/2011 09:26 AM, Pedro Alves wrote:
>>>> On Tuesday 08 November 2011 16:33:52, Richard Henderson wrote:
>>>>> toplevel/
>>>>>        * configure.ac: Adjust srcdir for running libitm/ 
>>>>> configure.tgt.
>>>>
>>>>> +# Disable libitm on unsupported hosted systems.
>>>>> +if test x$enable_libitm = x; then
>>>>> +   AC_MSG_CHECKING([for libitm support])
>>>>> +   if (srcdir=${srcdir}/libitm; \
>>>>> +       . ${srcdir}/configure.tgt; \
>>>>
>>>> This should check that libitm exists before sourcing the script,
>>>> as otherwise it will error out on src tree
>>>> checkouts (binutils, gdb, ...), given that the libitm directory
>>>> doesn't exist there.
>>>
>>> Should I bother with an explicit test, or just use "set -e"?
>>
>> Whatever works is fine with me.  :-)
>>
>
> Tested and committed the following.

is it expected for  libitm to work on x86 darwin?
(the implication of the libitm/configure.tgt is yes .. )

.. can't seem to get it to build ..

/bin/sh ./libtool --tag=CXX   --mode=compile  -B/GCC/gcc-4-7-install/ 
i686-apple-darwin9/bin/ -B/GCC/gcc-4-7-install/i686-apple-darwin9/lib/  
-isystem /GCC/gcc-4-7-install/i686-apple-darwin9/include -isystem /GCC/ 
gcc-4-7-install/i686-apple-darwin9/sys-include    -DHAVE_CONFIG_H -I. - 
I/GCC/gcc-live-trunk/libitm  -I/GCC/gcc-live-trunk/libitm/config/posix  
-I/GCC/gcc-live-trunk/libitm/config/generic -I/GCC/gcc-live-trunk/ 
libitm  -std=gnu++0x -funwind-tables -fno-exceptions -fno-rtti - 
march=i486 -mtune=i686 -fomit-frame-pointer -Wall -Werror  -Wc,- 
pthread -fabi-version=4 -g -O2 -MT cacheline.lo -MD -MP -MF .deps/ 
cacheline.Tpo -c -o cacheline.lo /GCC/gcc-live-trunk/libitm/config/ 
generic/cacheline.cc
libtool: compile: unrecognized option `-B/GCC/gcc-4-7-install/i686- 
apple-darwin9/bin/'
libtool: compile: Try `libtool --help' for more information.
make[3]: *** [barrier.lo] Error 1

Iain

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Disable libitm if unsupported
  2011-11-08 21:29         ` Iain Sandoe
@ 2011-11-08 21:33           ` Richard Henderson
  2011-11-08 21:56             ` Iain Sandoe
  2011-11-09 17:01             ` Iain Sandoe
  0 siblings, 2 replies; 13+ messages in thread
From: Richard Henderson @ 2011-11-08 21:33 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: gcc-patches Patches, DJ Delorie, Alexandre Oliva

On 11/08/2011 01:20 PM, Iain Sandoe wrote:
> is it expected for  libitm to work on x86 darwin?

Yes.

> /bin/sh ./libtool --tag=CXX   --mode=compile  -B/GCC/gcc-4-7-install/i686-apple-darwin9/bin/ -B/GCC/gcc-4-7-install/i686-apple-darwin9/lib/ -isystem /GCC/gcc-4-7-install/i686-apple-darwin9/include -isystem /GCC/gcc-4-7-install/i686-apple-darwin9/sys-include    -DHAVE_CONFIG_H -I. -I/GCC/gcc-live-trunk/libitm  -I/GCC/gcc-live-trunk/libitm/config/posix -I/GCC/gcc-live-trunk/libitm/config/generic -I/GCC/gcc-live-trunk/libitm  -std=gnu++0x -funwind-tables -fno-exceptions -fno-rtti -march=i486 -mtune=i686 -fomit-frame-pointer -Wall -Werror  -Wc,-pthread -fabi-version=4 -g -O2 -MT cacheline.lo -MD -MP -MF .deps/cacheline.Tpo -c -o cacheline.lo /GCC/gcc-live-trunk/libitm/config/generic/cacheline.cc
> libtool: compile: unrecognized option `-B/GCC/gcc-4-7-install/i686-apple-darwin9/bin/'
> libtool: compile: Try `libtool --help' for more information.
> make[3]: *** [barrier.lo] Error 1

That's ... odd.

Top-level makefile has passed down the empty string instead of the g++ executable.
I have zero idea how to fix this.  It sounds similar to the horror that I eventually
bypassed wrt the include paths.


r~

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Disable libitm if unsupported
  2011-11-08 21:33           ` Richard Henderson
@ 2011-11-08 21:56             ` Iain Sandoe
  2011-11-09 17:01             ` Iain Sandoe
  1 sibling, 0 replies; 13+ messages in thread
From: Iain Sandoe @ 2011-11-08 21:56 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches Patches, DJ Delorie, Alexandre Oliva


On 8 Nov 2011, at 21:29, Richard Henderson wrote:

> On 11/08/2011 01:20 PM, Iain Sandoe wrote:
>> is it expected for  libitm to work on x86 darwin?
>
> Yes.

OK, I'll persevere ;-)

Iain


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Disable libitm if unsupported
  2011-11-08 21:33           ` Richard Henderson
  2011-11-08 21:56             ` Iain Sandoe
@ 2011-11-09 17:01             ` Iain Sandoe
  2011-11-09 17:14               ` Richard Henderson
  1 sibling, 1 reply; 13+ messages in thread
From: Iain Sandoe @ 2011-11-09 17:01 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches Patches, DJ Delorie, Alexandre Oliva

Hi Richard,

On 8 Nov 2011, at 21:29, Richard Henderson wrote:

> On 11/08/2011 01:20 PM, Iain Sandoe wrote:
>> is it expected for  libitm to work on x86 darwin?
>
> Yes.

hmmm...

powerpc-darwin is not affected (doesn't auto configure because there's  
no powerpc directory under libitm/config).

However ...

On i686-darwin9 it fails with "target only supports weak alias"
(I need to understand better where that comes from - but the machine  
is tied up right now).

On x86_64-darwin10 it fails to build sjlj.S because that file makes  
use of assembler constructs not available on the system as
(I think Rainer perhaps already observed this for some solaris  
versions).

I had a quick look at config/x86/target.h and observe that the jmpbuf  
layout in that header is different from the system definition...

.. so I'm thinking that maybe some porting work is needed ...

Unless I've missed sth ...

>> /bin/sh ./libtool --tag=CXX   --mode=compile  -B/GCC/gcc-4-7- 
>> install/i686-apple-darwin9/bin/ -B/GCC/gcc-4-7-install/i686-apple- 
>> darwin9/lib/ -isystem /GCC/gcc-4-7-install/i686-apple-darwin9/ 
>> include -isystem /GCC/gcc-4-7-install/i686-apple-darwin9/sys- 
>> include    -DHAVE_CONFIG_H -I. -I/GCC/gcc-live-trunk/libitm  -I/GCC/ 
>> gcc-live-trunk/libitm/config/posix -I/GCC/gcc-live-trunk/libitm/ 
>> config/generic -I/GCC/gcc-live-trunk/libitm  -std=gnu++0x -funwind- 
>> tables -fno-exceptions -fno-rtti -march=i486 -mtune=i686 -fomit- 
>> frame-pointer -Wall -Werror  -Wc,-pthread -fabi-version=4 -g -O2 - 
>> MT cacheline.lo -MD -MP -MF .deps/cacheline.Tpo -c -o cacheline.lo / 
>> GCC/gcc-live-trunk/libitm/config/generic/cacheline.cc
>> libtool: compile: unrecognized option `-B/GCC/gcc-4-7-install/i686- 
>> apple-darwin9/bin/'
>> libtool: compile: Try `libtool --help' for more information.
>> make[3]: *** [barrier.lo] Error 1
>
> That's ... odd.
>
> Top-level makefile has passed down the empty string instead of the g+ 
> + executable.
> I have zero idea how to fix this.  It sounds similar to the horror  
> that I eventually
> bypassed wrt the include paths.

this happens when, in an attempt to debug things, one deletes the  
failed build and tries to do

make all-target-libitm.

so .. perhaps we should disable darwin for now so that at least it  
bootstraps  ... unless this is only affecting me :-)

cheers
Iain

Index: libitm/configure.tgt
===================================================================
--- libitm/configure.tgt	(revision 181206)
+++ libitm/configure.tgt	(working copy)
@@ -93,10 +93,14 @@ case "${target}" in
    *-*-gnu* | *-*-k*bsd*-gnu \
    | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
    | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \
-  | *-*-darwin* | *-*-aix*)
+  | *-*-aix*)
  	# POSIX system.  The OS is supported.
  	;;

+  *-*-darwin*)	# POSIX, but needs some work.
+	UNSUPPORTED=1
+	;;
+
    *)	# Non-POSIX, or embedded system
  	UNSUPPORTED=1
  	;;

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Disable libitm if unsupported
  2011-11-09 17:01             ` Iain Sandoe
@ 2011-11-09 17:14               ` Richard Henderson
  2011-11-09 17:36                 ` Iain Sandoe
  0 siblings, 1 reply; 13+ messages in thread
From: Richard Henderson @ 2011-11-09 17:14 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: gcc-patches Patches, DJ Delorie, Alexandre Oliva

On 11/09/2011 08:14 AM, Iain Sandoe wrote:
> On i686-darwin9 it fails with "target only supports weak alias"
> (I need to understand better where that comes from - but the machine is tied up right now).

This is fixed.  I removed the alias in favor of a plain function for portability.
I also added PR 51065 to track the automatic optimization possibility.

> On x86_64-darwin10 it fails to build sjlj.S because that file makes
> use of assembler constructs not available on the system as (I think
> Rainer perhaps already observed this for some solaris versions).

Testing a fix for the cfi pseudos now.

That won't totally fix darwin, because there are also elf-specific pseudos as well (e.g. ".type").  I'll crib a patch together for that from cross-compiled examples for you to test later.

> I had a quick look at config/x86/target.h and observe that the jmpbuf
> layout in that header is different from the system definition...

Irrelevant.  It's a local jmpbuf for the local definition in sjlj.S.  Which is Special because we're  actually recording the state for an outer frame.  One can NOT use the system setjmp/longjmp to  implement libitm.

> Index: libitm/configure.tgt
> ===================================================================
> --- libitm/configure.tgt    (revision 181206)
> +++ libitm/configure.tgt    (working copy)
> @@ -93,10 +93,14 @@ case "${target}" in
>    *-*-gnu* | *-*-k*bsd*-gnu \
>    | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
>    | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \
> -  | *-*-darwin* | *-*-aix*)
> +  | *-*-aix*)
>      # POSIX system.  The OS is supported.
>      ;;
> 
> +  *-*-darwin*)    # POSIX, but needs some work.
> +    UNSUPPORTED=1
> +    ;;
> +
>    *)    # Non-POSIX, or embedded system
>      UNSUPPORTED=1

If you want to commit that right away, that's fine by me.


r~

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Disable libitm if unsupported
  2011-11-09 17:14               ` Richard Henderson
@ 2011-11-09 17:36                 ` Iain Sandoe
  2011-11-09 18:56                   ` Richard Henderson
  0 siblings, 1 reply; 13+ messages in thread
From: Iain Sandoe @ 2011-11-09 17:36 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches Patches, DJ Delorie, Alexandre Oliva


On 9 Nov 2011, at 17:01, Richard Henderson wrote:

> On 11/09/2011 08:14 AM, Iain Sandoe wrote:
>> On i686-darwin9 it fails with "target only supports weak alias"
>> (I need to understand better where that comes from - but the  
>> machine is tied up right now).
>
> This is fixed.  I removed the alias in favor of a plain function for  
> portability.
> I also added PR 51065 to track the automatic optimization possibility.
>
>> On x86_64-darwin10 it fails to build sjlj.S because that file makes
>> use of assembler constructs not available on the system as (I think
>> Rainer perhaps already observed this for some solaris versions).
>
> Testing a fix for the cfi pseudos now.
>
> That won't totally fix darwin, because there are also elf-specific  
> pseudos as well (e.g. ".type").  I'll crib a patch together for that  
> from cross-compiled examples for you to test later.
>
>> I had a quick look at config/x86/target.h and observe that the jmpbuf
>> layout in that header is different from the system definition...
>
> Irrelevant.  It's a local jmpbuf for the local definition in  
> sjlj.S.  Which is Special because we're  actually recording the  
> state for an outer frame.  One can NOT use the system setjmp/longjmp  
> to  implement libitm.
>
>> Index: libitm/configure.tgt
>> ===================================================================
>> --- libitm/configure.tgt    (revision 181206)
>> +++ libitm/configure.tgt    (working copy)
>> @@ -93,10 +93,14 @@ case "${target}" in
>>   *-*-gnu* | *-*-k*bsd*-gnu \
>>   | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
>>   | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*- 
>> hpux11* \
>> -  | *-*-darwin* | *-*-aix*)
>> +  | *-*-aix*)
>>     # POSIX system.  The OS is supported.
>>     ;;
>>
>> +  *-*-darwin*)    # POSIX, but needs some work.
>> +    UNSUPPORTED=1
>> +    ;;
>> +
>>   *)    # Non-POSIX, or embedded system
>>     UNSUPPORTED=1
>
> If you want to commit that right away, that's fine by me.

I'll hang on .. and test stuff ;-)

cheers
Iain

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Disable libitm if unsupported
  2011-11-09 17:36                 ` Iain Sandoe
@ 2011-11-09 18:56                   ` Richard Henderson
  2011-11-09 18:58                     ` Iain Sandoe
  0 siblings, 1 reply; 13+ messages in thread
From: Richard Henderson @ 2011-11-09 18:56 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: gcc-patches Patches, DJ Delorie, Alexandre Oliva

[-- Attachment #1: Type: text/plain, Size: 83 bytes --]

> I'll hang on .. and test stuff ;-)

Try now.  I've committed the following.


r~

[-- Attachment #2: z --]
[-- Type: text/plain, Size: 1762 bytes --]

commit f29a2041f32773464e226a83f41762c2e9cf658e
Author: rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Nov 9 18:38:21 2011 +0000

    libitm: de-ELF-ize x86/sjlj.S.
    
            * config/x86/sjlj.S: Protect elf directives with __ELF__.
            Protect .note.GNU-stack with __linux__.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181229 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/libitm/ChangeLog b/libitm/ChangeLog
index e91f91e..e78716d 100644
--- a/libitm/ChangeLog
+++ b/libitm/ChangeLog
@@ -1,5 +1,8 @@
 2011-11-09  Richard Henderson  <rth@redhat.com>
 
+	* config/x86/sjlj.S: Protect elf directives with __ELF__.
+	Protect .note.GNU-stack with __linux__.
+
 	* configure.ac (GCC_AS_CFI_PSEUDO_OP): Test it.
 	* configure, aclocal.m4, config.h.in: Rebuild.
 	* config/generic/asmcfi.h: New file.
diff --git a/libitm/config/x86/sjlj.S b/libitm/config/x86/sjlj.S
index 6169499..32572d9 100644
--- a/libitm/config/x86/sjlj.S
+++ b/libitm/config/x86/sjlj.S
@@ -26,9 +26,9 @@
 #include "asmcfi.h"
 
 	.text
-	.p2align 4
+
+	.align 4
 	.globl	_ITM_beginTransaction
-	.type	_ITM_beginTransaction, @function
 
 _ITM_beginTransaction:
 	cfi_startproc
@@ -66,12 +66,14 @@ _ITM_beginTransaction:
 	ret
 #endif
 	cfi_endproc
+
+#ifdef __ELF__
+	.type	_ITM_beginTransaction, @function
 	.size	_ITM_beginTransaction, .-_ITM_beginTransaction
+#endif
 
-	.p2align 4
+	.align 4
 	.globl	GTM_longjmp
-	.type	GTM_longjmp, @function
-	.hidden	GTM_longjmp
 
 GTM_longjmp:
 	cfi_startproc
@@ -103,6 +105,13 @@ GTM_longjmp:
 	jmp	*%edx
 #endif
 	cfi_endproc
+
+#ifdef __ELF__
+	.type	GTM_longjmp, @function
+	.hidden	GTM_longjmp
 	.size	GTM_longjmp, .-GTM_longjmp
+#endif
 
+#ifdef __linux__
 .section .note.GNU-stack, "", @progbits
+#endif

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Disable libitm if unsupported
  2011-11-09 18:56                   ` Richard Henderson
@ 2011-11-09 18:58                     ` Iain Sandoe
  0 siblings, 0 replies; 13+ messages in thread
From: Iain Sandoe @ 2011-11-09 18:58 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches Patches, DJ Delorie, Alexandre Oliva


On 9 Nov 2011, at 18:39, Richard Henderson wrote:

>> I'll hang on .. and test stuff ;-)
>
> Try now.  I've committed the following.

sjlj.S now builds ...
...  similar issues are showing in x86_sse.S (I will try and look at  
those, if you have not already started).

Iain

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-11-09 18:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-08 16:55 Disable libitm if unsupported Richard Henderson
2011-11-08 17:38 ` Pedro Alves
2011-11-08 17:40   ` Richard Henderson
2011-11-08 18:13     ` Pedro Alves
2011-11-08 18:35       ` Richard Henderson
2011-11-08 21:29         ` Iain Sandoe
2011-11-08 21:33           ` Richard Henderson
2011-11-08 21:56             ` Iain Sandoe
2011-11-09 17:01             ` Iain Sandoe
2011-11-09 17:14               ` Richard Henderson
2011-11-09 17:36                 ` Iain Sandoe
2011-11-09 18:56                   ` Richard Henderson
2011-11-09 18:58                     ` Iain Sandoe

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 read-only IMAP folder(s) and NNTP newsgroup(s).