From patchwork Wed Jul 20 20:20:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tulio Magno Quites Machado Filho X-Patchwork-Id: 13895 Received: (qmail 3176 invoked by alias); 20 Jul 2016 20:21:01 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 3166 invoked by uid 89); 20 Jul 2016 20:21:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=eval, machado, magno, Machado X-HELO: mx0a-001b2d01.pphosted.com X-IBM-Helo: d24dlp01.br.ibm.com X-IBM-MailFrom: tuliom@linux.vnet.ibm.com X-IBM-RcptTo: libc-alpha@sourceware.org From: "Tulio Magno Quites Machado Filho" To: libc-alpha@sourceware.org, adhemerval.zanella@linaro.org Subject: [PATCH 2.24] powerpc: Prevent building POWER8 code without support in assembler Date: Wed, 20 Jul 2016 17:20:34 -0300 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16072020-0020-0000-0000-000002243902 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16072020-0021-0000-0000-00003005A067 Message-Id: <1469046034-28470-1-git-send-email-tuliom@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-20_12:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607200225 Confirm if the assembler supports the submachine specified at --with-cpu or required by --enable-multi-arch preventing errors at build time. The minimum Binutils version supported (v2.22) doesn't support POWER8 which is used on --enable-multi-arch. 2016-07-20 Tulio Magno Quites Machado Filho * sysdeps/powerpc/configure: Auto-generate. * sysdeps/powerpc/configure.ac: Check if the assembler supports the submachine. --- sysdeps/powerpc/configure | 52 ++++++++++++++++++++++++++++++++++++++++++++ sysdeps/powerpc/configure.ac | 43 ++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 sysdeps/powerpc/configure create mode 100644 sysdeps/powerpc/configure.ac diff --git a/sysdeps/powerpc/configure b/sysdeps/powerpc/configure new file mode 100644 index 0000000..dbc20e9 --- /dev/null +++ b/sysdeps/powerpc/configure @@ -0,0 +1,52 @@ +# This file is generated from configure.ac by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/powerpc. + +# The minimum Binutils version required by glibc may not support all the +# processors supported by glibc, e.g. Binutils 2.22 supports POWER7 at most. +libc_cv_ppc_cpu_min= +libc_cv_ppc_cpu_msg= + +if test x"$multi_arch" != xno ; then + libc_cv_ppc_cpu_min=power8 + libc_cv_ppc_cpu_msg=", required by --enable-multi-arch" +fi + +if test -n "$submachine"; then + case "$submachine" in + # List of the submachines not supported by the minimum required Binutils. + power8|power9) + libc_cv_ppc_cpu_min=$submachine + libc_cv_ppc_cpu_msg= + ;; + esac +fi + +if test -n "$libc_cv_ppc_cpu_min"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $libc_cv_ppc_cpu_min support in assembler" >&5 +$as_echo_n "checking for $libc_cv_ppc_cpu_min support in assembler... " >&6; } +if ${libc_cv_ppc_machine+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.s <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + libc_cv_ppc_machine=yes +else + libc_cv_ppc_machine=no +fi +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ppc_machine" >&5 +$as_echo "$libc_cv_ppc_machine" >&6; } + if test $libc_cv_ppc_machine != yes; then + as_fn_error $? "The assembler does not support $libc_cv_ppc_cpu_min\ +$libc_cv_ppc_cpu_msg." "$LINENO" 5 + fi +fi diff --git a/sysdeps/powerpc/configure.ac b/sysdeps/powerpc/configure.ac new file mode 100644 index 0000000..ba9fa25 --- /dev/null +++ b/sysdeps/powerpc/configure.ac @@ -0,0 +1,43 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/powerpc. + +# The minimum Binutils version required by glibc may not support all the +# processors supported by glibc, e.g. Binutils 2.22 supports POWER7 at most. +libc_cv_ppc_cpu_min= +libc_cv_ppc_cpu_msg= + +if test x"$multi_arch" != xno ; then + dnl Multiarch build requires POWER8 support. + libc_cv_ppc_cpu_min=power8 + libc_cv_ppc_cpu_msg=", required by --enable-multi-arch" +fi + +if test -n "$submachine"; then + case "$submachine" in + # List of the submachines not supported by the minimum required Binutils. + power8|power9) + libc_cv_ppc_cpu_min=$submachine + libc_cv_ppc_cpu_msg= + ;; + esac +fi + +if test -n "$libc_cv_ppc_cpu_min"; then + dnl Check if asm supports the minimum cpu. + AC_CACHE_CHECK([for $libc_cv_ppc_cpu_min support in assembler], + libc_cv_ppc_machine, [dnl +cat > conftest.s <&AS_MESSAGE_LOG_FD); then + libc_cv_ppc_machine=yes +else + libc_cv_ppc_machine=no +fi +rm -f conftest*]) + if test $libc_cv_ppc_machine != yes; then + AC_MSG_ERROR([The assembler does not support $libc_cv_ppc_cpu_min\ +$libc_cv_ppc_cpu_msg.]) + fi +fi