diff mbox series

Add anitizer_linux_x86_64.lo if __x86_64__ is defined by $CC

Message ID 20171001011239.GA13105@gmail.com
State New
Headers show
Series Add anitizer_linux_x86_64.lo if __x86_64__ is defined by $CC | expand

Commit Message

H.J. Lu Oct. 1, 2017, 1:12 a.m. UTC
Since size of "void *" is 4 bytes for x32, check if __x86_64__ is defined
by $CC, instead of

if test x$ac_cv_sizeof_void_p = x8; then

to decide wether anitizer_linux_x86_64.lo should be used.

I am testing this on i686 and x86-64.  OK for trunk and GCC 7 branch if
there are no regression?  Please upstream it for me if appropriate.

Thanks.


H.J.
---
	PR sanitizer/82379
	* configure.tgt (ANITIZER_COMMON_TARGET_DEPENDENT_OBJECTS): Set
	to anitizer_linux_x86_64.lo if __x86_64__ is defined by $CC.
---
 libsanitizer/configure.tgt | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jakub Jelinek Oct. 5, 2017, 6:56 a.m. UTC | #1
On Sat, Sep 30, 2017 at 06:12:39PM -0700, H.J. Lu wrote:
> Since size of "void *" is 4 bytes for x32, check if __x86_64__ is defined
> by $CC, instead of
> 
> if test x$ac_cv_sizeof_void_p = x8; then
> 
> to decide wether anitizer_linux_x86_64.lo should be used.
> 
> I am testing this on i686 and x86-64.  OK for trunk and GCC 7 branch if
> there are no regression?  Please upstream it for me if appropriate.
> 
> Thanks.
> 
> 
> H.J.
> ---
> 	PR sanitizer/82379
> 	* configure.tgt (ANITIZER_COMMON_TARGET_DEPENDENT_OBJECTS): Set

s/ANITIZER/SANITIZER/

> 	to anitizer_linux_x86_64.lo if __x86_64__ is defined by $CC.

s/anitizer/sanitizer/

Ok with those changes.

> --- a/libsanitizer/configure.tgt
> +++ b/libsanitizer/configure.tgt
> @@ -27,6 +27,8 @@ case "${target}" in
>  		TSAN_SUPPORTED=yes
>  		LSAN_SUPPORTED=yes
>  		TSAN_TARGET_DEPENDENT_OBJECTS=tsan_rtl_amd64.lo
> +	fi
> +	if echo "int x = __x86_64__;" | $CC -c -x c -o /dev/null - > /dev/null 2>&1; then
>  		SANITIZER_COMMON_TARGET_DEPENDENT_OBJECTS=sanitizer_linux_x86_64.lo
>  	fi
>  	;;
> -- 

	Jakub
diff mbox series

Patch

diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt
index 82e8a5513c5..573e3b482e9 100644
--- a/libsanitizer/configure.tgt
+++ b/libsanitizer/configure.tgt
@@ -27,6 +27,8 @@  case "${target}" in
 		TSAN_SUPPORTED=yes
 		LSAN_SUPPORTED=yes
 		TSAN_TARGET_DEPENDENT_OBJECTS=tsan_rtl_amd64.lo
+	fi
+	if echo "int x = __x86_64__;" | $CC -c -x c -o /dev/null - > /dev/null 2>&1; then
 		SANITIZER_COMMON_TARGET_DEPENDENT_OBJECTS=sanitizer_linux_x86_64.lo
 	fi
 	;;