From patchwork Thu Dec 1 00:42:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9486545 X-Mozilla-Keys: nonjunk Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sandeen.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 X-Spam-HP: BAYES_00=-1.9,DKIM_ADSP_CUSTOM_MED=0.001,DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.1, T_DKIM_INVALID=0.01 X-Original-To: sandeen@sandeen.net Delivered-To: sandeen@sandeen.net Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by sandeen.net (Postfix) with ESMTP id B7C615FCC62 for ; Wed, 30 Nov 2016 18:41:49 -0600 (CST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754585AbcLAAmk (ORCPT ); Wed, 30 Nov 2016 19:42:40 -0500 Received: from mail-pf0-f169.google.com ([209.85.192.169]:36806 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754327AbcLAAmj (ORCPT ); Wed, 30 Nov 2016 19:42:39 -0500 Received: by mail-pf0-f169.google.com with SMTP id 189so42104051pfz.3 for ; Wed, 30 Nov 2016 16:42:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=IdoIWLrfyUVMGDFvffClimIft44RqzOteibilUj8/aM=; b=LAlR4ESyVLlfyjY7wRnq67GCb8V1gncswa0ymnKEjdTQLy7XH7CMUnbrAgRIwuZ7Xg pVizG4aWyG0NdNWqTBbXlnf8BhPUVNYy7sH0G9l2mf2u3zSgOMMy8CZGUzrEu75+W8Ty F+3/74NgXip9aL/S9fe3lcxKsEcK7atUCz2y7/92wi0Jz1/mXo6W+JvGGnQvGK7fGhCi vCY76sNC0pBfjTISLX98NANqflpv/aBn0L2h+flR7oqXy5f8U7frEbmBlKEGdUXD/MMy xc8A1mdUSzRl8nE0Ya7QRgdP81IrTE1foCyDwoP2zxgyN5mKgeHdJ/O5dmWsMKO8qkEV OzGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IdoIWLrfyUVMGDFvffClimIft44RqzOteibilUj8/aM=; b=RqkFpVjSA/gfn1o1IrhDGW3nJz/O9E7el1jcj/zKYcrVuje4V3Ec0J2M/iUu/PcnMm ABbli08GoPBtSUxeGPfKI+Bp3q6Bhz1W4b7vixZhFBEfrEOH/mUmCjjMj51/I066dB4Q deS/SOn4T6ohTAMS6/R4tS5XwSK03jPd3ird1CfHoRtN+92+XYlYrOCnVVMbGdfJcrbU RkkkYK7Hsp8e1Lfxc2QbmdG30WCLwYADWLemVogL5s6LRME0r7krvVbmmv1T/j/gxQYr WS7E38QmX6rCuNVWVXUL3yI/ffLZDYBNFPWFx1VABrsxbzeDOmBKFf5fVrTJfN4/AKQM 1IMQ== X-Gm-Message-State: AKaTC02wO3HQC5jIB0V5TlefEfElaABYjICqvyqKb8wSJUEEj+2jiL/Ah9WByEG2v9yEXNA+ X-Received: by 10.99.122.92 with SMTP id j28mr63918746pgn.64.1480552958454; Wed, 30 Nov 2016 16:42:38 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.119.30.154]) by smtp.gmail.com with ESMTPSA id 65sm104785455pfl.21.2016.11.30.16.42.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Nov 2016 16:42:37 -0800 (PST) From: Eric Biggers To: linux-xfs@vger.kernel.org Cc: Felix Janda , Dave Chinner , Eric Biggers Subject: [PATCH v3] Fix building xfsprogs on 32-bit platforms Date: Wed, 30 Nov 2016 16:42:12 -0800 Message-Id: <1480552932-614-1-git-send-email-ebiggers@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org xfslibs now requires that its users enable transparent largefile support. This broke building xfsprogs on 32-bit Linux (with glibc) because _FILE_OFFSET_BITS=64 was not getting defined. Although the autoconf macro AC_SYS_LARGEFILE was intended to define it, this didn't work because AC_SYS_LARGEFILE will only define _FILE_OFFSET_BITS in a config header, which doesn't work for xfsprogs because not all .c files include platform_defs.h as their first include. Also, platform_defs.h.in is not generated by autoheader and didn't contain a template for _FILE_OFFSET_BITS. Therefore, to fix the problem remove the useless autoconf macros and instead add -D_FILE_OFFSET_BITS=64 to CFLAGS in builddefs.in. Use CFLAGS rather than PCFLAGS because this definition could be needed by platforms other than "linux", and it doesn't hurt to always define it. Signed-off-by: Eric Biggers Reviewed-by: Christoph Hellwig Reviewed-by: Felix Janda --- configure.ac | 3 --- include/builddefs.in | 2 +- m4/package_libcdev.m4 | 16 ---------------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index b88ab7f..ee918d1 100644 --- a/configure.ac +++ b/configure.ac @@ -107,9 +107,6 @@ AC_PACKAGE_UTILITIES(xfsprogs) AC_MULTILIB($enable_lib64) AC_RT($enable_librt) -AC_SYS_LARGEFILE -AC_NEED_LFS - AC_PACKAGE_NEED_UUID_H AC_PACKAGE_NEED_UUIDCOMPARE diff --git a/include/builddefs.in b/include/builddefs.in index aeb2905..5219071 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -25,7 +25,7 @@ OPTIMIZER = @opt_build@ MALLOCLIB = @malloc_lib@ LOADERFLAGS = @LDFLAGS@ LTLDFLAGS = @LDFLAGS@ -CFLAGS = @CFLAGS@ +CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64 LIBRT = @librt@ LIBUUID = @libuuid@ diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4 index e3c59d8..7d5a42d 100644 --- a/m4/package_libcdev.m4 +++ b/m4/package_libcdev.m4 @@ -258,22 +258,6 @@ AC_DEFUN([AC_HAVE_MREMAP], ]) # -# Check if transparent LFS is enabled -# -AC_DEFUN([AC_NEED_LFS], - [ AC_MSG_CHECKING([whether large file support works]) - AC_TRY_COMPILE([ -#include - ], [ - int i[sizeof(off_t)-8]; - ], AC_MSG_RESULT(yes), - [AC_MSG_RESULT(no) - echo - echo 'FATAL ERROR: C library does not support transparent LFS.' - exit 1]) - ]) - -# # Check if we need to override the system struct fsxattr with # the internal definition. This /only/ happens if the system # actually defines struct fsxattr /and/ the system definition