Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Aug 2018 17:57:46 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r337473 - stable/11/lib/libc/tests/ssp
Message-ID:  <201808081757.w78Hvk2L013444@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Wed Aug  8 17:57:45 2018
New Revision: 337473
URL: https://svnweb.freebsd.org/changeset/base/337473

Log:
  MFC r335704:
  
    Rework check for libclang_rt to see if the needed library exists.

Modified:
  stable/11/lib/libc/tests/ssp/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/tests/ssp/Makefile
==============================================================================
--- stable/11/lib/libc/tests/ssp/Makefile	Wed Aug  8 17:50:43 2018	(r337472)
+++ stable/11/lib/libc/tests/ssp/Makefile	Wed Aug  8 17:57:45 2018	(r337473)
@@ -1,9 +1,5 @@
 # $FreeBSD$
 
-# XXX This is a workaround to allow i386 to cross-compile on an amd64 host.
-.include <host-target.mk>
-# XXX ---
-
 .include <bsd.own.mk>
 
 NO_WERROR=
@@ -35,21 +31,16 @@ PROGS+=		h_memset
 # probably needs to be fixed as it's currently hardcoded.
 #
 # sanitizer is not tested or supported for ARM right now. sbruno
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-.if ${COMPILER_TYPE} == "clang" && ${MK_TOOLCHAIN} == "yes"
-.if ${COMPILER_VERSION} < 30500 || 30700 <= ${COMPILER_VERSION}
-
-# XXX This is a workaround to allow i386 to cross-compile on an amd64 host.
-.if ${MACHINE_CPUARCH} == ${_HOST_ARCH}
-# XXX ---
-
-PROGS+=		h_raw
-
-# XXX This is a workaround to allow i386 to cross-compile on an amd64 host.
+.if ${COMPILER_TYPE} == "clang" && !defined(_SKIP_BUILD) && \
+    (!defined(_RECURSING_PROGS) || ${PROG} == "h_raw")
+.if !defined(_CLANG_RESOURCE_DIR)
+_CLANG_RESOURCE_DIR!=	${CC:N${CCACHE_BIN}} -print-resource-dir
+.export _CLANG_RESOURCE_DIR
 .endif
-# XXX ---
-
-.endif
+_libclang_rt_arch=	${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}
+_libclang_rt_ubsan=	${_CLANG_RESOURCE_DIR}/lib/freebsd/libclang_rt.ubsan_standalone-${_libclang_rt_arch}.a
+.if exists(${_libclang_rt_ubsan})
+PROGS+=		h_raw
 .endif
 .endif
 PROGS+=		h_read



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808081757.w78Hvk2L013444>