From patchwork Tue Dec 20 18:13:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 88623 Delivered-To: patch@linaro.org Received: by 10.182.112.6 with SMTP id im6csp2292300obb; Tue, 20 Dec 2016 10:13:51 -0800 (PST) X-Received: by 10.99.101.65 with SMTP id z62mr980143pgb.74.1482257631540; Tue, 20 Dec 2016 10:13:51 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id e23si23192249pli.262.2016.12.20.10.13.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Dec 2016 10:13:51 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-76150-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-76150-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-76150-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:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version; q=dns; s=default; b=vQu7W rVkLHBYf+3elZJbVzb4qwBXQTovt3P+g0hznFr3OaSVn3XR07EFFX2cYgPuQtFVF fpqvCOadwIm870fTK3eqcvw1PnfXNJjZ2RyJZTI6zWcgk/G7SSWTPGg2ICmfSNNW +Qt82NRmt5AzkEvLvf30bawbcb4eoBaCxkBaqc= 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:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version; s=default; bh=iBlg1nhP42C Q3kpGERw2vx7+9kI=; b=IJwf0IYQqB2yf4NKYk5PnXI0a1B1Ug7rpulVYDBO8MW mfuffLpr5Y9I6OYGg6aubnXEtRiJKGZ3Bxkq4zHDBywKPk01Zb2WDSio3yCdHnZI y3YU5EeFgLJEIhZ4s0AG9luRhFfv2ncm2gVxcY3xh3882aflYQ8ZSmtY+BZIScrI = Received: (qmail 35437 invoked by alias); 20 Dec 2016 18:13:38 -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 35421 invoked by uid 89); 20 Dec 2016 18:13:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=of, 4111, e_flags, mrs X-HELO: NAM01-SN1-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Steve.Ellcey@cavium.com; Message-ID: <1482257599.7649.28.camel@caviumnetworks.com> Subject: Re: [PATCH 2/2] Enable ILP32 mode on aarch64 (version 3) From: Steve Ellcey To: Joseph Myers CC: libc-alpha , Yury Norov Date: Tue, 20 Dec 2016 10:13:19 -0800 In-Reply-To: References: <1482187587.7649.20.camel@caviumnetworks.com> MIME-Version: 1.0 X-ClientProxiedBy: CY1PR0801CA0074.namprd08.prod.outlook.com (10.166.203.42) To DM2PR0701MB1067.namprd07.prod.outlook.com (10.160.26.20) X-MS-Office365-Filtering-Correlation-Id: dddff199-c134-488a-321c-08d42903e353 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR0701MB1067; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1067; 3:rJhvd78IcNaa7l0c1t0vgLBXaXzF5iUlx0R0pn3ROTgQG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3x7euVIq4sqLAmF5O4+VCcD+8; 20:ZQUgZSbPkHEAr0u66EhAm/pzFIMteYH1HGb9y6yKHK91JII7j4hW7H3cK+OJ1VSDFtPL4y1+JSCX7uyS6B3dnER1q5ocJuEj6lTiwRA5ZxdnfQ2xAkVoBIppZj+h9LoEDZOhY6nnQmmNqjTLw66nwlTVDdhN3SuFN9ztC8cIZL3ssqGxVPT3lhzDBtnoELGqT5GuTPNPV3LYSJnQCzTGyV+k1yMfyHWIa/quNQQT9Htc8OgEgXssImsCI/eceXhhTKzCAIH6/YUWpverzSI8bFXeQM46couPXNI0CzhNWS55jnS8pcf2dSugXve/Fz0ltsllrkdk89w+rK1mHL4tr5UCzLmp/nqTpO4kyHZdEbLaJRO1HddYML5xgAYZGcAjOV6oUKnVGt3fWCcWxkwUVWzSC2DD+Xi3fnhYYzErJXIduJYkLPBmPcWOc/pGeLlg39Y4OUBnd+07wZfgwzZUL3l2efiKVKC+tDOMLWxPvaC1tggBmuEEK2HFhAiTUDeVNbYi+KzuAB/md1hUH0Lydd7nJksTX7+xYC8ng7Yuaxxggrrjl4VfCQVvRaNZB89a3TIo9Xg68ZW+yHkMslG6rSdalU10yqVxWMMJ7MyJYw4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415395)(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(6072148); SRVR:DM2PR0701MB1067; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0701MB1067; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1067; 4:ix9PeRJKxlbxAlks4eJ5BBIC6vgRjJabCZ6+2N8H/mxyio2okawuBF88cbChgewdcCgE2g57nYPbngk+673jA+/k64Eh5Nx+IEG5QNg4Dzk/vsdQyflNtuYLILpfAgWNIaTLrfzgGrAxBcj+RbKISVMIFvSGq8oG8b56hGfY5psueyTrXdHH1/U8x2BbuThSfQJcJa/weZfKPJ1jaA+LCjws9VgbKtaTqDC/b6ZbkjlinGZ3QXwLwVdB2yeYuQK8LAm9U2EPo3Ye4kWDfoks1KEvF3h68bDxV6akiybyO51v3Mc8aiORvB4vm7RuLulpE+m2+G08iVQQ0NC9fjGLxkyr/7WVnTdYH469bB8RXqdJL5SPWWozwu7myR7Fge51QgDUB49bibIrEvOevZ5WS2/TtEwmMYR4ecxOHf+U+5KSryyq9ntdYfMTcf+QdlOcLsrgoxxaITVi5gMa122kBZGXhaxirsYw6JC7NcxZfWV18VDcArWuNvfdKk8SzpfWOFkIa5xZ60X0RwP+0lYzdv7wYHvjni9Y056qW5s9JKibSsMBAuVggkQh1RqdvSCGvNrD12uVzIzYcbzr5lSXCA== X-Forefront-PRVS: 0162ACCC24 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(189002)(377424004)(199003)(24454002)(5660300001)(2906002)(4610100001)(69596002)(5890100001)(36756003)(107886002)(4326007)(7736002)(66066001)(4001150100001)(110136003)(92566002)(512874002)(97736004)(6666003)(6916009)(42882006)(84326002)(2950100002)(25786008)(6486002)(6506006)(6512006)(305945005)(68736007)(50986999)(568964002)(3846002)(38730400001)(189998001)(50226002)(33646002)(6116002)(229853002)(2476003)(53416004)(106356001)(42186005)(105586002)(8676002)(81166006)(81156014)(76176999)(4001430100002)(101416001)(103116003)(99106002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0701MB1067; H:sellcey-lt.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0701MB1067; 23:V9fqoXd22AlnLKe0R9+InHKqpUnsJL73k894pLx?= =?us-ascii?Q?uzTQjjv5neZMSungCxYhyF2PoulIyqq9aHG/9UfABrXRgrZ2+mq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e7mRRhtCxxnSjK2cejWFvVJ+EHOlKSQ/uRw==; 24:IGHaE8SJB5w5R+TyFogvOysWNevUM3/bBqs3ALuJAUBIyfvjk4G+rNK2qeKudNdlIobf8zqq5JJZZy4C338bAWdDmMi6idFv0wrs2BqjYfU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1067; 7:3c8xWHMxL+GfWY4Mr8YEKM/siHu37yk36CfDBqh1z6vYG8FOTiTu3h1jALCH0xfjIf97A0Vos16QimRMGFuPBHkfRc6EL+AbjsQVnUMaFhD5tliu6KjyXIitS8qTxLamWq1rvr9vyDQDycax5yFiKXZRJbDtOe/VXOGGIwhXl0xYr7mdTfEvfvKXNsofuuNbZqH3PROgqByhtJkhwlwAv9ra/l+j+KFKB2XBePVAmH1qP15zqpL+hAPLoZkx/l8PLlYauaNl2AO+FOfCJiymIrINyiytdU4mc9G8lbsB/GclBOXkqZDMauyCDep+t7/5ggv/fTejTt8tvH8CvFZm6b1cuWPk/XQZyN2qDHCNVpcvCBQpsXvmXS3lQT9zG8E8dxtypYtDs3BA1OOhd0gxZvUV/1sh6dgcOABP2oSCvJ9otsiUWO7+VaSkBDkpxdDV9YQrChoB0dsJuyYJB2JscQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2016 18:13:23.8731 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0701MB1067 On Mon, 2016-12-19 at 22:58 +0000, Joseph Myers wrote: > On Mon, 19 Dec 2016, Steve Ellcey wrote: > > > > > I believe I have addressed all the issues with the last patch.  I added > > elf/cache.c to print out FLAG_AARCH64_LIB32 when it is used.  I fixed > I don't see any changes to sysdeps/unix/sysv/linux/arm/readelflib.c that I  > noted in >   > would be expected (note that file is included by the AArch64 version of  > readelflib.c). Sorry, I missed that change for some reason.  Here is a new patch with that change included and with the statfs.h change that Yury pointed out.  Testing showed the same results as I had before making these two changes. Steve Ellcey sellcey@caviumnetworks.com 2016-12-20  Andrew Pinski       Yury Norov       Steve Ellcey   * elf/cache.c (print_entry): Add FLAG_AARCH64_LIB32. * sysdeps/aarch64/configure.ac (HAVE_AARCH64_ILP32): New define. (default-abi): Allow for ilp32 ABI. * sysdeps/aarch64/configure: Regenerate. * sysdeps/aarch64/Implies: Deleted. * sysdeps/aarch64/ilp32/Implies: New file. * sysdeps/aarch64/ilp32/Implies-after: New file. * sysdeps/aarch64/lp64/Implies: New file. * sysdeps/aarch64/lp64/Implies-after: New file. * sysdeps/aarch64/preconfigure (machine): Check for ilp32/lp64. * sysdeps/aarch64/tls-macros.h (TLS_IE): Remove register specification for __result and ifdef for ILP32. * sysdeps/generic/ldconfig.h (FLAG_AARCH64_LIB32): New define. * sysdeps/unix/sysv/linux/aarch64/Implies: Remove generic and wordsize-64 entries. * sysdeps/unix/sysv/linux/aarch64/Makefile (abi-variants): Add new variants for ilp32 and ilp32_be. (abi-lp64-options, abi-lp64_be-options): define __LP64__ and undefine __ILP32__. (abi-lp64-condition, abi-lp64_be-condition): Check for __WORDSIZE equal to 64. (abi-ilp32-options, abi-ilp32-condition, abi-ilp32_be-options, abi-ilp32_be-condition): New. * sysdeps/unix/sysv/linux/aarch64/configure.ac (arch_minimum_kernel): Use different value for ILP32. (LIBC_SLIBDIR_RTLDDIR): Modify for ILP32. * sysdeps/unix/sysv/linux/aarch64/configure: Regenerate. * sysdeps/unix/sysv/linux/aarch64/ilp32/Implies: New file. * sysdeps/unix/sysv/linux/aarch64/ilp32/c++-types.data: Ditto. * sysdeps/unix/sysv/linux/aarch64/ilp32/kernel_stat.h: Ditto. * sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions: Ditto. * sysdeps/unix/sysv/linux/aarch64/bits/stat.h: Ditto. * sysdeps/unix/sysv/linux/aarch64/bits/statfs.h: Ditto. * sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h: Ditto. * sysdeps/unix/sysv/linux/aarch64/bits/utmp.h: Ditto. * sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h: Ditto. * sysdeps/unix/sysv/linux/aarch64/kernel-features.h: Ditto. * sysdeps/unix/sysv/linux/aarch64/Implies: Add unix/sysv/linux/aarch64. * sysdeps/unix/sysv/linux/aarch64/ioctl.S: Move to lp64 directory. * sysdeps/unix/sysv/linux/aarch64/mmap.c: Ditto. * sysdeps/unix/sysv/linux/aarch64/shlib-versions: Ditto. * sysdeps/unix/sysv/linux/aarch64/c++-types.data: Ditto. * sysdeps/unix/sysv/linux/arm/readelflib.c (process_elf_file): Check for EM_AARCH64 when processing ELFCLASS32 object. diff --git a/elf/cache.c b/elf/cache.c index fbee172..a3bfb5d 100644 --- a/elf/cache.c +++ b/elf/cache.c @@ -101,6 +101,9 @@ print_entry (const char *lib, int flag, unsigned int osversion, case FLAG_AARCH64_LIB64: fputs (",AArch64", stdout); break; + case FLAG_AARCH64_LIB32: + fputs (",ILP32", stdout); + break; /* Uses the ARM soft-float ABI. */ case FLAG_ARM_LIBSF: fputs (",soft-float", stdout); diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac index 7851dd4..5327f76 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/Implies b/sysdeps/aarch64/ilp32/Implies similarity index 88% copy from sysdeps/aarch64/Implies copy to sysdeps/aarch64/ilp32/Implies index e5adf4d..a9e5910 100644 --- a/sysdeps/aarch64/Implies +++ b/sysdeps/aarch64/ilp32/Implies @@ -1,4 +1,4 @@ -wordsize-64 +aarch64/fpu ieee754/ldbl-128 ieee754/dbl-64/wordsize-64 ieee754/dbl-64 diff --git a/sysdeps/aarch64/ilp32/Implies-after b/sysdeps/aarch64/ilp32/Implies-after new file mode 100644 index 0000000..39a34c5 --- /dev/null +++ b/sysdeps/aarch64/ilp32/Implies-after @@ -0,0 +1 @@ +wordsize-32 diff --git a/sysdeps/aarch64/Implies b/sysdeps/aarch64/lp64/Implies similarity index 88% rename from sysdeps/aarch64/Implies rename to sysdeps/aarch64/lp64/Implies index e5adf4d..a9e5910 100644 --- a/sysdeps/aarch64/Implies +++ b/sysdeps/aarch64/lp64/Implies @@ -1,4 +1,4 @@ -wordsize-64 +aarch64/fpu ieee754/ldbl-128 ieee754/dbl-64/wordsize-64 ieee754/dbl-64 diff --git a/sysdeps/aarch64/lp64/Implies-after b/sysdeps/aarch64/lp64/Implies-after new file mode 100644 index 0000000..a8cae95 --- /dev/null +++ b/sysdeps/aarch64/lp64/Implies-after @@ -0,0 +1 @@ +wordsize-64 diff --git a/sysdeps/aarch64/preconfigure b/sysdeps/aarch64/preconfigure index d9bd1f8..b56d0aa 100644 --- a/sysdeps/aarch64/preconfigure +++ b/sysdeps/aarch64/preconfigure @@ -1,6 +1,14 @@ case "$machine" in aarch64*) + abiflag=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null` base_machine=aarch64 - machine=aarch64 + case "$abiflag" in + *"#define __ILP32__ 1"*) aarch64_config_abi=ilp32 ;; + *) aarch64_config_abi=lp64 ;; + esac + case $aarch64_config_abi in + ilp32) machine=aarch64/ilp32 ;; + lp64) machine=aarch64/lp64 ;; + esac ;; esac diff --git a/sysdeps/aarch64/tls-macros.h b/sysdeps/aarch64/tls-macros.h index 2080a4d..64822e3 100644 --- a/sysdeps/aarch64/tls-macros.h +++ b/sysdeps/aarch64/tls-macros.h @@ -32,8 +32,9 @@ "x30", "memory", "cc"); \ (int *) (__result); }) -#define TLS_IE(x) \ - ({ register unsigned long __result asm ("x0"); \ +#ifdef __LP64__ +# define TLS_IE(x) \ + ({ register unsigned long __result; \ register unsigned long __t; \ asm ("mrs %1, tpidr_el0; " \ "adrp %0, :gottprel:" #x "; " \ @@ -41,6 +42,17 @@ "add %0, %0, %1" \ : "=r" (__result), "=r" (__t)); \ (int *) (__result); }) +#else +# define TLS_IE(x) \ + ({ register unsigned long __result; \ + register unsigned long __t; \ + asm ("mrs %1, tpidr_el0; " \ + "adrp %0, :gottprel:" #x "; " \ + "ldr %w0, [%0, #:gottprel_lo12:" #x "]; " \ + "add %0, %0, %1" \ + : "=r" (__result), "=r" (__t)); \ + (int *) (__result); }) +#endif #define TLS_LE(x) \ ({ register unsigned long __result asm ("x0"); \ diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h index 07600b7..8150227 100644 --- a/sysdeps/generic/ldconfig.h +++ b/sysdeps/generic/ldconfig.h @@ -42,6 +42,7 @@ #define FLAG_MIPS_LIB32_NAN2008 0x0c00 #define FLAG_MIPS64_LIBN32_NAN2008 0x0d00 #define FLAG_MIPS64_LIBN64_NAN2008 0x0e00 +#define FLAG_AARCH64_LIB32 0x0f00 /* Name of auxiliary cache. */ #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache" diff --git a/sysdeps/unix/sysv/linux/aarch64/Implies b/sysdeps/unix/sysv/linux/aarch64/Implies index 4409e19..c508f2e 100644 --- a/sysdeps/unix/sysv/linux/aarch64/Implies +++ b/sysdeps/unix/sysv/linux/aarch64/Implies @@ -1,3 +1 @@ aarch64/nptl -unix/sysv/linux/generic -unix/sysv/linux/wordsize-64 diff --git a/sysdeps/unix/sysv/linux/aarch64/Makefile b/sysdeps/unix/sysv/linux/aarch64/Makefile index 6b4e620..67619f5 100644 --- a/sysdeps/unix/sysv/linux/aarch64/Makefile +++ b/sysdeps/unix/sysv/linux/aarch64/Makefile @@ -23,13 +23,21 @@ endif abi-variants := lp64 abi-variants += lp64_be +abi-variants += ilp32 +abi-variants += ilp32_be ifeq (,$(filter $(default-abi),$(abi-variants))) Unknown ABI, must be one of $(abi-variants) endif -abi-lp64-options := -U__AARCH64EB__ -abi-lp64-condition := !defined __AARCH64EB__ +abi-lp64-options := -U__AARCH64EB__ -D__LP64__ -U__ILP32__ +abi-lp64-condition := __WORDSIZE == 64 && !defined __AARCH64EB__ -abi-lp64_be-options := -D__AARCH64EB__ -abi-lp64_be-condition := defined __AARCH64EB__ +abi-lp64_be-options := -D__AARCH64EB__ -D__LP64__ -U__ILP32__ +abi-lp64_be-condition := __WORDSIZE == 64 && defined __AARCH64EB__ + +abi-ilp32-options := -U__AARCH64EB__ -U__LP64__ -D__ILP32__ +abi-ilp32-condition := __WORDSIZE == 32 && !defined __AARCH64EB__ + +abi-ilp32_be-options := -D__AARCH64EB__ -U__LP64__ -D__ILP32__ +abi-ilp32_be-condition := __WORDSIZE == 32 && defined __AARCH64EB__ diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/stat.h b/sysdeps/unix/sysv/linux/aarch64/bits/stat.h new file mode 100644 index 0000000..8877a46 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/bits/stat.h @@ -0,0 +1,177 @@ +/* Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +#include + +/* 64-bit libc uses the kernel's 'struct stat', accessed via the + stat() syscall; 32-bit libc uses the kernel's 'struct stat64' + and accesses it via the stat64() syscall. All the various + APIs offered by libc use the kernel shape for their struct stat + structure; the only difference is that 32-bit programs not + using __USE_FILE_OFFSET64 only see the low 32 bits of some + of the fields (specifically st_ino, st_size, and st_blocks). */ +#define _STAT_VER_KERNEL 0 +#define _STAT_VER_LINUX 0 +#define _STAT_VER _STAT_VER_KERNEL + +/* Versions of the `xmknod' interface. */ +#define _MKNOD_VER_LINUX 0 + +struct stat + { + __dev_t st_dev; /* Device. */ +#ifdef __LP64__ + __ino_t st_ino; /* File serial number. */ +#else + unsigned int __pad0; + unsigned int __st_ino; /* 32bit file serial number. */ +#endif + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __off_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ +#ifdef __LP64__ + int __pad2; +#endif + __blkcnt_t st_blocks; /* 512-byte blocks */ +#ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#endif +#ifdef __LP64__ + int __glibc_reserved[2]; +#else + __ino_t st_ino; /* File serial number. */ +#endif + }; + +#ifdef __USE_LARGEFILE64 +struct stat64 + { + __dev_t st_dev; /* Device. */ +# ifdef __LP64__ + __ino64_t st_ino; /* File serial number. */ +# else + unsigned int __pad0; + unsigned int __st_ino; /* 32bit file serial number. */ +# endif + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ +# ifdef __LP64__ + int __pad2; +# endif + __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif +# ifdef __LP64__ + int __glibc_reserved[2]; +# else + __ino_t st_ino; /* File serial number. */ +# endif + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* POSIX.1b objects. Note that these macros always evaluate to zero. But + they do it by enforcing the correct use of the macros. */ +#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#ifdef __USE_ATFILE +# define UTIME_NOW ((1l << 30) - 1l) +# define UTIME_OMIT ((1l << 30) - 2l) +#endif + +#endif /* bits/stat.h */ diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/statfs.h b/sysdeps/unix/sysv/linux/aarch64/bits/statfs.h new file mode 100644 index 0000000..aa55d8b --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/bits/statfs.h @@ -0,0 +1,67 @@ +/* Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _SYS_STATFS_H +# error "Never include directly; use instead." +#endif + +#include +#include +#include + +/* On AArch64 both the 32-bit and 64-bit libc's use the kernels + 'struct statfs' with 64 bit f_blocks/f_bfree/f_bavail/f_files/f_ffree + fields. This means the statfs and statfs64 structs are identical + and the statfs and statfs64 calls can be aliases. */ + +struct statfs + { + __SWORD_TYPE f_type; + __SWORD_TYPE f_bsize; + __fsblkcnt_t f_blocks; + __fsblkcnt_t f_bfree; + __fsblkcnt_t f_bavail; + __fsfilcnt_t f_files; + __fsfilcnt_t f_ffree; + __fsid_t f_fsid; + __SWORD_TYPE f_namelen; + __SWORD_TYPE f_frsize; + __SWORD_TYPE f_flags; + __SWORD_TYPE f_spare[4]; + }; + +struct statfs64 + { + __SWORD_TYPE f_type; + __SWORD_TYPE f_bsize; + __fsblkcnt64_t f_blocks; + __fsblkcnt64_t f_bfree; + __fsblkcnt64_t f_bavail; + __fsfilcnt64_t f_files; + __fsfilcnt64_t f_ffree; + __fsid_t f_fsid; + __SWORD_TYPE f_namelen; + __SWORD_TYPE f_frsize; + __SWORD_TYPE f_flags; + __SWORD_TYPE f_spare[4]; + }; + +/* Tell code we have these members. */ +#define _STATFS_F_NAMELEN +#define _STATFS_F_FRSIZE +#define _STATFS_F_FLAGS diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h b/sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h new file mode 100644 index 0000000..82433dd --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h @@ -0,0 +1,88 @@ +/* bits/typesizes.h -- underlying types for *_t. Linux/AArch64 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __UQUAD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __U32_TYPE +#define __OFF_T_TYPE __SQUAD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __UQUAD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SQUAD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __UQUAD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __UQUAD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __FSWORD_T_TYPE __SWORD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __S32_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +/* ssize_t is always singed long in both ABIs. */ +#define __SSIZE_T_TYPE __SLONGWORD_TYPE +#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __ULONGWORD_TYPE + +/* Tell the libc code that off_t and off64_t are actually the same type + for all ABI purposes, even if possibly expressed as different base types + for C type-checking purposes. */ +#define __OFF_T_MATCHES_OFF64_T 1 + +/* Same for ino_t and ino64_t. */ +#define __INO_T_MATCHES_INO64_T 1 + +/* And for rlim_t and rlim64_t. */ +#define __RLIM_T_MATCHES_RLIM64_T 1 + +/* And for __blkcnt_t and __blkcnt64_t. */ +#define __BLKCNT_T_TYPE_MATCHES_BLKCNT64_T_TYPE 1 + +/* And for __fsblkcnt_t and __fsblkcnt64_t. */ +#define __FSBLKCNT_T_TYPE_MATCHES_FSBLKCNT64_T_TYPE 1 + +/* And for __fsbilcnt_t and __fsbilcnt64_t. */ +#define __FSFILCNT_T_TYPE_MATCHES_FSFILCNT64_T_TYPE 1 + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + +#endif /* bits/typesizes.h */ diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/utmp.h b/sysdeps/unix/sysv/linux/aarch64/bits/utmp.h new file mode 100644 index 0000000..493795c --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/bits/utmp.h @@ -0,0 +1,125 @@ +/* The `struct utmp' type, describing entries in the utmp file. + Linux/AArch64 version. + + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _UTMP_H +# error "Never include directly; use instead." +#endif + +#include +#include +#include +#include + + +#define UT_LINESIZE 32 +#define UT_NAMESIZE 32 +#define UT_HOSTSIZE 256 + + +/* The structure describing an entry in the database of + previous logins. */ +struct lastlog + { +#if __WORDSIZE == 32 + int64_t ll_time; +#else + __time_t ll_time; +#endif + char ll_line[UT_LINESIZE]; + char ll_host[UT_HOSTSIZE]; + }; + + +/* The structure describing the status of a terminated process. This + type is used in `struct utmp' below. */ +struct exit_status + { + short int e_termination; /* Process termination status. */ + short int e_exit; /* Process exit status. */ + }; + + +/* The structure describing an entry in the user accounting database. */ +struct utmp +{ + short int ut_type; /* Type of login. */ + pid_t ut_pid; /* Process ID of login process. */ + char ut_line[UT_LINESIZE]; /* Devicename. */ + char ut_id[4]; /* Inittab ID. */ + char ut_user[UT_NAMESIZE]; /* Username. */ + char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */ + struct exit_status ut_exit; /* Exit status of a process marked + as DEAD_PROCESS. */ +/* The ut_session and ut_tv fields must be the same size when compiled + 32- and 64-bit. This allows data files and shared memory to be + shared between 32- and 64-bit applications. */ +#if __WORDSIZE == 32 + int64_t ut_session; /* Session ID, used for windowing. */ + struct + { + int64_t tv_sec; /* Seconds. */ + int64_t tv_usec; /* Microseconds. */ + } ut_tv; /* Time entry was made. */ +#else + long int ut_session; /* Session ID, used for windowing. */ + struct timeval ut_tv; /* Time entry was made. */ +#endif + + int32_t ut_addr_v6[4]; /* Internet address of remote host. */ + char __glibc_reserved[20]; /* Reserved for future use. */ +}; + +/* Backwards compatibility hacks. */ +#define ut_name ut_user +#ifndef _NO_UT_TIME +/* We have a problem here: `ut_time' is also used otherwise. Define + _NO_UT_TIME if the compiler complains. */ +# define ut_time ut_tv.tv_sec +#endif +#define ut_xtime ut_tv.tv_sec +#define ut_addr ut_addr_v6[0] + + +/* Values for the `ut_type' field of a `struct utmp'. */ +#define EMPTY 0 /* No valid user accounting information. */ + +#define RUN_LVL 1 /* The system's runlevel. */ +#define BOOT_TIME 2 /* Time of system boot. */ +#define NEW_TIME 3 /* Time after system clock changed. */ +#define OLD_TIME 4 /* Time when system clock changed. */ + +#define INIT_PROCESS 5 /* Process spawned by the init process. */ +#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ +#define USER_PROCESS 7 /* Normal process. */ +#define DEAD_PROCESS 8 /* Terminated process. */ + +#define ACCOUNTING 9 + +/* Old Linux name for the EMPTY type. */ +#define UT_UNKNOWN EMPTY + + +/* Tell the user that we have a modern system with UT_HOST, UT_PID, + UT_TYPE, UT_ID and UT_TV fields. */ +#define _HAVE_UT_TYPE 1 +#define _HAVE_UT_PID 1 +#define _HAVE_UT_ID 1 +#define _HAVE_UT_TV 1 +#define _HAVE_UT_HOST 1 diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h b/sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h new file mode 100644 index 0000000..fb652a9 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h @@ -0,0 +1,104 @@ +/* Structures and definitions for the user accounting database. + Linux/AArch64 version. + + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _UTMPX_H +# error "Never include directly; use instead." +#endif + +#include +#include +#include + + +#ifdef __USE_GNU +# include +# define _PATH_UTMPX _PATH_UTMP +# define _PATH_WTMPX _PATH_WTMP +#endif + + +#define __UT_LINESIZE 32 +#define __UT_NAMESIZE 32 +#define __UT_HOSTSIZE 256 + + +/* The structure describing the status of a terminated process. This + type is used in `struct utmpx' below. */ +struct __exit_status + { +#ifdef __USE_GNU + short int e_termination; /* Process termination status. */ + short int e_exit; /* Process exit status. */ +#else + short int __e_termination; /* Process termination status. */ + short int __e_exit; /* Process exit status. */ +#endif + }; + + +/* The structure describing an entry in the user accounting database. */ +struct utmpx +{ + short int ut_type; /* Type of login. */ + __pid_t ut_pid; /* Process ID of login process. */ + char ut_line[__UT_LINESIZE]; /* Devicename. */ + char ut_id[4]; /* Inittab ID. */ + char ut_user[__UT_NAMESIZE]; /* Username. */ + char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */ + struct __exit_status ut_exit; /* Exit status of a process marked + as DEAD_PROCESS. */ + +/* The fields ut_session and ut_tv must be the same size when compiled + 32- and 64-bit. This allows files and shared memory to be shared + between 32- and 64-bit applications. */ +#if __WORDSIZE == 32 + __int64_t ut_session; /* Session ID, used for windowing. */ + struct + { + __int64_t tv_sec; /* Seconds. */ + __int64_t tv_usec; /* Microseconds. */ + } ut_tv; /* Time entry was made. */ +#else + long int ut_session; /* Session ID, used for windowing. */ + struct timeval ut_tv; /* Time entry was made. */ +#endif + __int32_t ut_addr_v6[4]; /* Internet address of remote host. */ + char __glibc_reserved[20]; /* Reserved for future use. */ +}; + + +/* Values for the `ut_type' field of a `struct utmpx'. */ +#define EMPTY 0 /* No valid user accounting information. */ + +#ifdef __USE_GNU +# define RUN_LVL 1 /* The system's runlevel. */ +#endif +#define BOOT_TIME 2 /* Time of system boot. */ +#define NEW_TIME 3 /* Time after system clock changed. */ +#define OLD_TIME 4 /* Time when system clock changed. */ + +#define INIT_PROCESS 5 /* Process spawned by the init process. */ +#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ +#define USER_PROCESS 7 /* Normal process. */ +#define DEAD_PROCESS 8 /* Terminated process. */ + +#ifdef __USE_GNU +# define ACCOUNTING 9 /* System accounting. */ +#endif diff --git a/sysdeps/unix/sysv/linux/aarch64/configure.ac b/sysdeps/unix/sysv/linux/aarch64/configure.ac index 211fa9c..245b72f 100644 --- a/sysdeps/unix/sysv/linux/aarch64/configure.ac +++ b/sysdeps/unix/sysv/linux/aarch64/configure.ac @@ -1,6 +1,13 @@ 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=10.0.0 + LIBC_SLIBDIR_RTLDDIR([libilp32], [lib]) +else + arch_minimum_kernel=3.7.0 + LIBC_SLIBDIR_RTLDDIR([lib64], [lib]) +fi + +ldd_rewrite_script=$dir/ldd-rewrite.sed -LIBC_SLIBDIR_RTLDDIR([lib64], [lib]) diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/Implies b/sysdeps/unix/sysv/linux/aarch64/ilp32/Implies new file mode 100644 index 0000000..7dd239e --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/Implies @@ -0,0 +1,4 @@ +aarch64/nptl +unix/sysv/linux/aarch64 +unix/sysv/linux/generic/wordsize-32 +unix/sysv/linux/generic diff --git a/sysdeps/unix/sysv/linux/aarch64/c++-types.data b/sysdeps/unix/sysv/linux/aarch64/ilp32/c++-types.data similarity index 77% copy from sysdeps/unix/sysv/linux/aarch64/c++-types.data copy to sysdeps/unix/sysv/linux/aarch64/ilp32/c++-types.data index ac925cc..3fe2e2b 100644 --- a/sysdeps/unix/sysv/linux/aarch64/c++-types.data +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/c++-types.data @@ -1,32 +1,32 @@ -blkcnt64_t:l -blkcnt_t:l +blkcnt64_t:x +blkcnt_t:x blksize_t:i caddr_t:Pc clockid_t:i clock_t:l daddr_t:i -dev_t:m +dev_t:y fd_mask:l -fsblkcnt64_t:m -fsblkcnt_t:m -fsfilcnt64_t:m -fsfilcnt_t:m +fsblkcnt64_t:y +fsblkcnt_t:y +fsfilcnt64_t:y +fsfilcnt_t:y fsid_t:8__fsid_t gid_t:j id_t:j -ino64_t:m -ino_t:m +ino64_t:y +ino_t:y int16_t:s int32_t:i -int64_t:l +int64_t:x int8_t:a -intptr_t:l +intptr_t:i key_t:i -loff_t:l +loff_t:x mode_t:j nlink_t:j -off64_t:l -off_t:l +off64_t:x +off_t:x pid_t:i pthread_attr_t:14pthread_attr_t pthread_barrier_t:17pthread_barrier_t @@ -41,10 +41,10 @@ pthread_rwlock_t:16pthread_rwlock_t pthread_rwlockattr_t:20pthread_rwlockattr_t pthread_spinlock_t:i pthread_t:m -quad_t:l -register_t:l -rlim64_t:m -rlim_t:m +quad_t:x +register_t:x +rlim64_t:y +rlim_t:y sigset_t:10__sigset_t size_t:m socklen_t:j @@ -57,11 +57,11 @@ uint:j u_int:j u_int16_t:t u_int32_t:j -u_int64_t:m +u_int64_t:y u_int8_t:h ulong:m u_long:m -u_quad_t:m +u_quad_t:y useconds_t:j ushort:t u_short:t diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/kernel_stat.h b/sysdeps/unix/sysv/linux/aarch64/ilp32/kernel_stat.h new file mode 100644 index 0000000..ac50f0e --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/kernel_stat.h @@ -0,0 +1,3 @@ +#define XSTAT_IS_XSTAT64 1 +#define STATFS_IS_STATFS64 1 +#define STAT_IS_KERNEL_STAT diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions b/sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions new file mode 100644 index 0000000..98be915 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions @@ -0,0 +1,7 @@ +DEFAULT GLIBC_2.25 + +%ifdef HAVE_AARCH64_BE +ld=ld-linux-aarch64_be_ilp32.so.1 +%else +ld=ld-linux-aarch64_ilp32.so.1 +%endif diff --git a/sysdeps/unix/sysv/linux/aarch64/kernel-features.h b/sysdeps/unix/sysv/linux/aarch64/kernel-features.h new file mode 100644 index 0000000..28003ba --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/kernel-features.h @@ -0,0 +1,29 @@ +/* Set flags signalling availability of kernel features based on given + kernel version number. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#include_next + +#ifdef __ILP32__ +/* ARM fadvise64_64 reorganize the syscall arguments. */ +# define __ASSUME_FADVISE64_64_6ARG 1 + +/* Define this if your 32-bit syscall API requires 64-bit register + pairs to start with an even-number register. */ +# define __ASSUME_ALIGNED_REGISTER_PAIRS 1 +#endif /* __ILP32__ */ diff --git a/sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed b/sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed new file mode 100644 index 0000000..2f3bbb9 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed @@ -0,0 +1 @@ +s_^\(RTLDLIST=\)\(.*lib/\)\([^/]*\)\(-aarch64\)\(\|\_be\)\(\|\_ilp32\)\(.so\.[0-9.]*\)$_\1"\2\3-aarch64\5\7 \2\3-aarch64\5\_ilp32\7"_ diff --git a/sysdeps/unix/sysv/linux/aarch64/Implies b/sysdeps/unix/sysv/linux/aarch64/lp64/Implies similarity index 73% copy from sysdeps/unix/sysv/linux/aarch64/Implies copy to sysdeps/unix/sysv/linux/aarch64/lp64/Implies index 4409e19..6418211 100644 --- a/sysdeps/unix/sysv/linux/aarch64/Implies +++ b/sysdeps/unix/sysv/linux/aarch64/lp64/Implies @@ -1,3 +1,4 @@ aarch64/nptl +unix/sysv/linux/aarch64 unix/sysv/linux/generic unix/sysv/linux/wordsize-64 diff --git a/sysdeps/unix/sysv/linux/aarch64/c++-types.data b/sysdeps/unix/sysv/linux/aarch64/lp64/c++-types.data similarity index 100% rename from sysdeps/unix/sysv/linux/aarch64/c++-types.data rename to sysdeps/unix/sysv/linux/aarch64/lp64/c++-types.data diff --git a/sysdeps/unix/sysv/linux/aarch64/ioctl.S b/sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S similarity index 100% rename from sysdeps/unix/sysv/linux/aarch64/ioctl.S rename to sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S diff --git a/sysdeps/unix/sysv/linux/aarch64/mmap.c b/sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c similarity index 100% rename from sysdeps/unix/sysv/linux/aarch64/mmap.c rename to sysdeps/unix/sysv/linux/aarch64/lp64/mmap.c diff --git a/sysdeps/unix/sysv/linux/aarch64/shlib-versions b/sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions similarity index 100% rename from sysdeps/unix/sysv/linux/aarch64/shlib-versions rename to sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h index 1ffabc2..710e757 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -108,7 +108,7 @@ .Lsyscall_error: \ adrp x1, :gottprel:errno; \ neg w2, w0; \ - ldr x1, [x1, :gottprel_lo12:errno]; \ + ldr PTR_REG (1), [x1, :gottprel_lo12:errno]; \ mrs x3, tpidr_el0; \ mov x0, -1; \ str w2, [x1, x3]; \ diff --git a/sysdeps/unix/sysv/linux/arm/readelflib.c b/sysdeps/unix/sysv/linux/arm/readelflib.c index e6ae72e..e3803c9 100644 --- a/sysdeps/unix/sysv/linux/arm/readelflib.c +++ b/sysdeps/unix/sysv/linux/arm/readelflib.c @@ -41,7 +41,11 @@ process_elf_file (const char *file_name, const char *lib, int *flag, ret = process_elf32_file (file_name, lib, flag, osversion, soname, file_contents, file_length); - if (!ret && EF_ARM_EABI_VERSION (elf32_header->e_flags) == EF_ARM_EABI_VER5) + if (!ret && elf_header->e_machine == EM_AARCH64) + *flag = FLAG_AARCH64_LIB32|FLAG_ELF_LIBC6; + else if (!ret + && EF_ARM_EABI_VERSION (elf32_header->e_flags) + == EF_ARM_EABI_VER5) { if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD) *flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6;