From patchwork Tue Jun 21 05:06:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 70510 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1831036qgy; Mon, 20 Jun 2016 22:10:09 -0700 (PDT) X-Received: by 10.98.3.3 with SMTP id 3mr13696166pfd.8.1466485809812; Mon, 20 Jun 2016 22:10:09 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id dk7si27321444pab.20.2016.06.20.22.10.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 22:10:09 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-70820-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-70820-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-70820-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type; q=dns; s=default; b=gI6NB eIsJaehMuEkfGTzx1lQSjnuYI+ZBbCiQrD9fY+p+tI1oiRqm7xtem2xl2P7WH+Id BtodqwuqfIdqpaQd6DKSbbqI9Rgn3zhdnpIXECeRtLVPb8li3GmO7jH3lqzMxf59 m8ynd+jpZ9dOaFW4x4V3LkyeBw0SXtO8ln0MXA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type; s=default; bh=Jx1hDLapaOR kmHvhf9QBFb2ljds=; b=niSyuC6VnwfzuiIlodJCxgfKrMVblRGfURSb9nlmgVk qxJDekAK48EBZ1mALAtZT9jcjTC0DLTCsiQjRCCj4xD+jfEShdwwdgblhSltAqCn wMGrwIfHnsYOPDebq1PS/hM05YeDBiytmzF0pkQtnb5jzQocgmjPu+2JSzFoDALA = Received: (qmail 112332 invoked by alias); 21 Jun 2016 05:09:57 -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 112241 invoked by uid 89); 21 Jun 2016 05:09:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=cppflags, CPPFLAGS, detection, 1416 X-HELO: na01-bl2-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; From: Yury Norov To: , CC: , , , , , , , , , Andrew Pinski , Yury Norov Subject: [PATCH 10/27] [AARCH64] Detect ILP32 in configure scripts. Date: Tue, 21 Jun 2016 08:06:54 +0300 Message-ID: <1466485631-3532-12-git-send-email-ynorov@caviumnetworks.com> In-Reply-To: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> References: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-ClientProxiedBy: HE1PR03CA0034.eurprd03.prod.outlook.com (10.163.170.172) To SN1PR07MB2256.namprd07.prod.outlook.com (10.164.47.150) X-MS-Office365-Filtering-Correlation-Id: 6c0bc219-819a-4602-4fae-08d399924130 X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2256; 2:wHivyoO9XK0u2ryCnClpbcbt82jcACraqMCHOCvHxY/b7vfvAepbLVN8NUZdGtvpbvloTDo/BajMhgGfMfo/rdQskG+mkeaZI8Qe14MHHNEfCX3jqh3fcrFYeskfjp/44Oxu/syxHcXRHSZEidOFJCaqEk7jj907QF/hu4xjGcJwdpajI9itV7VGJUiGVvGO; 3:VC6m3fV+KqaMQ6GEUFGlSYtDlMY+tfE9H/RMbc+mP37mRhFQ/4KuQbVw8QiCNYcffB3mgNu3IHLIQKnu8nqkCAcsAPOkosa9Nd537c1vdIS5Bc+20n20U8ld5sX7Fyhw; 25:RXIMnHHGTKDPsrVNimRns+a2g/io5BzOfZNV7JqneX8UgkzITULs5QYlcvO7xyeigw8b8tBSSjuiNgreu1vXfF57u/UVT6JvZWvsbnw3JvgRCMnjEpI04V4WVaFZRz3JN0pUJpQ+v0AA906eTmm2ExlXbYel1DAn75+RU1VY64+bUBNnE+cQLa/VyVmksNS94hcI5+2P8zMc4dsuptHqmlnqTeBC14YNyv6zldaxnMQSitewxpoXeS5MfMnXiu88TfjeRJIqL1H0tF9HVTVT8A+CEQtHNDlmfCM8z5thiwpmFbMBvE/48kb5iQ8eThvFxrkfBorGTj/C7lfi6epCRgcZXpnPe/HhkC46lpDz0LuydH+xtvJ/bqK/7gvLqHwKqK7pnQQRKnVNfgPgivttPognw23nZxvTBMsLgkguX2c= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB2256; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2256; 20:3uZYpq9qytW2qF9u0Mus/DeEdnIaFId9LJltc9BmG9EvRxs3fgm9RSed2tDyzLeiDuONgmQqbuMH/hJklNmMPGDUqUO/FWp0NiFWncGJKRgu3Qo443s53o3+UOiS1msdjz3wZz1f7Whx3nPjq/4DWqIzjeQBdU5bCyiPOTdcKzyjOO+COfXkEIjB7s2Cng/FdCdlrMK2Cf4iBks36ZusiXQE7DbrUgE29LO+//E04bNVqoIGKrjDW+0YogxkUaLndrZmQkL/ptjpI9FHd4XVixPjydAUnWlc/RkCPz4Ii6PHFWxYoWI0aZNxdUcPfDgS6TesNEJXrqqhq+Vtg7mM9LNsvU93zmZym7mGahKPRFlqZxeMEaQ5WFL4E6s9t216ifCEhtfanwoloduwR8oGposr/AUCloL9CpUJqdmPr2tQSQmATtEvcY2MeHmzHCyKusTXTcPQQkdSOjceaTYEaCsVbEI3TO9RhG+AlBIw5O5wZieXS/V6jsXsg0JBfgbT25YreYpzBszOnb3Dj1CUTVGAfvFRQ3ENCwobT5qnHN5vOUFOv66nsls0+MjF+UW2IcAVkr/rZ5HNu2Po1ky4WHJBIy28dv/4sfwbAXcqHT0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:SN1PR07MB2256; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2256; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2256; 4:5wxQNmJb6bFsQxa6KMhCjKg7aNWL/k/NlWKx4TIs8vYC4D9yEyeWxMTjhn3m27f7kyxZsW9TjIJC/d2fKnBByvGzqGaLdV/tgmFgt7BvPP+s9JYtbRSMVgTo+Dp1bEug8MDAOyRomyMheNlo+G8OPJCdcVLy1RQTqcBuKxMIldP0K3LJJF72mz+hrtnI+pW8k/GMjTfEEKmMWtQQeH+57qHR+JjWklIKLmy1pXt5RcNo1oqpVGFLtnclKX86WCLwKpvMdVJhE/ie6d+XhjpKzKhVLHMr6MvB+3gnSfkdj7k2zWLvhZxN3Itvn67hpUuK9rAPLw6SdTvk2aanUqdvcZPOXwTowov20T2Dx62VWJRQpz016kWJzf+m9JDimr+e X-Forefront-PRVS: 098076C36C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(199003)(189002)(3846002)(2950100001)(107886002)(6116002)(97736004)(5001770100001)(36756003)(586003)(47776003)(2906002)(77096005)(76176999)(4326007)(50986999)(50226002)(5003940100001)(66066001)(42186005)(68736007)(92566002)(7736002)(189998001)(4001430100002)(81156014)(81166006)(105586002)(7846002)(8676002)(229853001)(33646002)(101416001)(76506005)(19580395003)(48376002)(50466002)(19580405001)(106356001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2256; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR07MB2256; 23:5YTMh6rkWHkbO+hXeUatjPPcX/uSmN+C2+AwPEgZy?= =?us-ascii?Q?SK5e4FeDE3/09vev0Bf+UOGGU8NBLlR79gLe2i54gNghN67iytM6MaUyfaFd?= =?us-ascii?Q?RQICLD5FjPopPmpG8U6LHoxKB+VUhfXCelNhlGo4SBqHtKvNUwJrnvV1McoJ?= =?us-ascii?Q?wfFbC4nSNeK/61lGUrPiYTIV7HL5FJVk3PGZLPsEJcLTqMESBzmZAHCX8eOk?= =?us-ascii?Q?dakjPzA4PBrDL8nn7jJxz5V/FVLWONuJFUhzLTLdsJ/Zk3cyHos0jsXC2GfV?= =?us-ascii?Q?u5ich6x+wiMEr6TvA9idFnu9xYOJ9CozZl2vlAoHAthlv5xkzR3uPluETJ9w?= =?us-ascii?Q?BarjrQG2/jtlYpFmsNjNqiV36vH56dsYhGs4glkHEWrnSt2LcyMtbdFhrV0Q?= =?us-ascii?Q?vrhM/SAyL+3LXI4bOWWqc2Rv4Ey3gbfrYmiQOafmwm3xB9YibvDS/11YxAly?= =?us-ascii?Q?2DkB1i89QeK9NhdLYArwWXGYE3N1+CvlkheA7JRnaa0/An+DqRlbIhKm6hrg?= =?us-ascii?Q?0tsHkEvQQvyh+kieAItMjXKtprmyMnpxhaX4Oj3nPEawpqOrdCshbeZ3Avnk?= =?us-ascii?Q?3s9RuzLIgN6pRGtwHq+hqTGvXI2rSmGHskVMDeA/bh260+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x6tn9294d6scJX3uhdeVXsUz/BDZmcOy6H+QgvNf6qQ==; 24:daAyuV6HqaA//WigY67obn0B27YEXjidX79vn4XSiUSKPGKIMZpxnA7lDr4bepAht8yxkJY5YDzEiv4mkqzoNYAAFo+0BoVACamy774rmwo=; 7:aPtdXWtB7aRtoG/a3oMC1hwOx9myjL7JylehPcOk63srfs2OxZ22G7y4nLgCocNNOqsYNeeHw8YX+qvgWvsYjFYnRaqhCRvxUGbaeJEVq+3vnXg5Q8tbHYTe3PdNNAk0FOMrgnJW3aSb05/ET7haut/AoOodIeZ9EUsgFxuSzoqCyhN11K7QZpttFYxf3M/ZJNFtsHIehGGFqjGu3bazixHoMlhhw7ocngRrAZsX0mlEO0nLo3/gl+IUj3+eVMJJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2016 05:09:42.2528 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2256 From: Andrew Pinski This adds detecting of ILP32 to the configure scripts. Adding to preconfigure detection of ilp32 in preconfigure and then writing out the default-abi in configure. * sysdeps/aarch64/preconfigure: Detect ILP32 and set aarch64_config_abi to ilp32 for ilp32 and lp64 for lp64. Set machine to either aarch64/ilp32 or aarch64/lp64 depending on the ABI that is selected. * sysdeps/aarch64/configure.ac: Define HAVE_AARCH64_ILP32 if this is ILP32. Set the default-abi to either ilp32, lp64, ilp32_be or lp64_be depending on the ABI. * sysdeps/aarch64/configure: Regenerate. * sysdeps/unix/sysv/linux/aarch64/configure.ac: Set arch_minimum_kernel to 3.19.0 for ILP32. Set LIBC_SLIBDIR_RTLDDIR to libilp32/lib for ilp32. * sysdeps/unix/sysv/linux/aarch64/configure: Regenerate. Signed-off-by: Yury Norov --- sysdeps/aarch64/configure | 15 +++++++++++---- sysdeps/aarch64/configure.ac | 11 +++++++++-- sysdeps/aarch64/preconfigure | 11 ++++++++++- sysdeps/unix/sysv/linux/aarch64/configure | 22 +++++++++++++++++++--- sysdeps/unix/sysv/linux/aarch64/configure.ac | 9 +++++++-- 5 files changed, 56 insertions(+), 12 deletions(-) mode change 100644 => 100755 sysdeps/aarch64/configure mode change 100644 => 100755 sysdeps/unix/sysv/linux/aarch64/configure -- 2.7.4 diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure old mode 100644 new mode 100755 index 5bd355a..7dd56e8 --- a/sysdeps/aarch64/configure +++ b/sysdeps/aarch64/configure @@ -163,12 +163,19 @@ rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_be" >&5 $as_echo "$libc_cv_aarch64_be" >&6; } + +if test $aarch64_config_abi = ilp32; then + $as_echo "#define HAVE_AARCH64_ILP32 1" >>confdefs.h + +fi + if test $libc_cv_aarch64_be = yes; then $as_echo "#define HAVE_AARCH64_BE 1" >>confdefs.h - config_vars="$config_vars -default-abi = lp64_be" + libc_aarch64_be=_be else - config_vars="$config_vars -default-abi = lp64" + libc_aarch64_be= fi + +config_vars="$config_vars +default-abi = ${aarch64_config_abi}${libc_aarch64_be}" diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac index 7851dd4..9069325 100644 --- a/sysdeps/aarch64/configure.ac +++ b/sysdeps/aarch64/configure.ac @@ -14,9 +14,16 @@ AC_CACHE_CHECK([for big endian], yes #endif ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)]) + +if test $aarch64_config_abi = ilp32; then + AC_DEFINE(HAVE_AARCH64_ILP32) +fi + if test $libc_cv_aarch64_be = yes; then AC_DEFINE(HAVE_AARCH64_BE) - LIBC_CONFIG_VAR([default-abi], [lp64_be]) + libc_aarch64_be=_be else - LIBC_CONFIG_VAR([default-abi], [lp64]) + libc_aarch64_be= fi + +LIBC_CONFIG_VAR([default-abi], [${aarch64_config_abi}${libc_aarch64_be}]) diff --git a/sysdeps/aarch64/preconfigure b/sysdeps/aarch64/preconfigure index d9bd1f8..4bcd8e3 100644 --- a/sysdeps/aarch64/preconfigure +++ b/sysdeps/aarch64/preconfigure @@ -1,6 +1,15 @@ case "$machine" in aarch64*) base_machine=aarch64 - machine=aarch64 + case "$CC $CFLAGS $CPPFLAGS " in + *" -mabi=ilp32 "*) aarch64_config_abi=ilp32 ;; + *" -mabi=lp64 "*) aarch64_config_abi=lp64 ;; + *) aarch64_config_abi=default ;; + esac + case $aarch64_config_abi in + default) machine=aarch64/lp64 aarch64_config_abi=lp64 ;; + ilp32) machine=aarch64/ilp32 ;; + lp64) machine=aarch64/lp64 ;; + esac ;; esac diff --git a/sysdeps/unix/sysv/linux/aarch64/configure b/sysdeps/unix/sysv/linux/aarch64/configure old mode 100644 new mode 100755 index f48472c..2563e83 --- a/sysdeps/unix/sysv/linux/aarch64/configure +++ b/sysdeps/unix/sysv/linux/aarch64/configure @@ -1,9 +1,23 @@ # This file is generated from configure.ac by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/unix/sysv/linux/aarch64. -arch_minimum_kernel=3.7.0 - -test -n "$libc_cv_slibdir" || +if test $aarch64_config_abi = ilp32; then + arch_minimum_kernel=3.19.0 + test -n "$libc_cv_slibdir" || +case "$prefix" in +/usr | /usr/) + libc_cv_slibdir=/libilp32 + libc_cv_rtlddir=/lib + if test "$libdir" = '${exec_prefix}/lib'; then + libdir='${exec_prefix}/libilp32'; + # Locale data can be shared between 32-bit and 64-bit libraries. + libc_cv_localedir='${exec_prefix}/lib/locale' + fi + ;; +esac +else + arch_minimum_kernel=3.7.0 + test -n "$libc_cv_slibdir" || case "$prefix" in /usr | /usr/) libc_cv_slibdir=/lib64 @@ -15,3 +29,5 @@ case "$prefix" in fi ;; esac +fi + diff --git a/sysdeps/unix/sysv/linux/aarch64/configure.ac b/sysdeps/unix/sysv/linux/aarch64/configure.ac index 211fa9c..6526816 100644 --- a/sysdeps/unix/sysv/linux/aarch64/configure.ac +++ b/sysdeps/unix/sysv/linux/aarch64/configure.ac @@ -1,6 +1,11 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/unix/sysv/linux/aarch64. -arch_minimum_kernel=3.7.0 +if test $aarch64_config_abi = ilp32; then + arch_minimum_kernel=3.19.0 + LIBC_SLIBDIR_RTLDDIR([libilp32], [lib]) +else + arch_minimum_kernel=3.7.0 + LIBC_SLIBDIR_RTLDDIR([lib64], [lib]) +fi -LIBC_SLIBDIR_RTLDDIR([lib64], [lib])