From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 31F5D13829C for ; Fri, 3 Jun 2016 19:22:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7E010254037; Fri, 3 Jun 2016 19:22:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 14C35254037 for ; Fri, 3 Jun 2016 19:22:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AA135340D58 for ; Fri, 3 Jun 2016 19:22:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8D161971 for ; Fri, 3 Jun 2016 19:22:40 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1464981687.8806f22bf65d99348770bbb6207d199c74fd96c5.vapier@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/xfsprogs/, sys-fs/xfsprogs/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-fs/xfsprogs/files/xfsprogs-4.3.0-cross-compile.patch sys-fs/xfsprogs/xfsprogs-4.5.0.ebuild X-VCS-Directories: sys-fs/xfsprogs/ sys-fs/xfsprogs/files/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 8806f22bf65d99348770bbb6207d199c74fd96c5 X-VCS-Branch: master Date: Fri, 3 Jun 2016 19:22:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 39a535a3-092b-49db-8ada-f28e2b686dc7 X-Archives-Hash: b5c27e18985ed4c9d95213540007a8d9 commit: 8806f22bf65d99348770bbb6207d199c74fd96c5 Author: Gwendal Grignou chromium org> AuthorDate: Fri Jun 3 19:21:18 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Fri Jun 3 19:21:27 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8806f22b sys-fs/xfsprogs: fix cross-compiling with build tools .../files/xfsprogs-4.3.0-cross-compile.patch | 181 +++++++++++++++++++++ sys-fs/xfsprogs/xfsprogs-4.5.0.ebuild | 1 + 2 files changed, 182 insertions(+) diff --git a/sys-fs/xfsprogs/files/xfsprogs-4.3.0-cross-compile.patch b/sys-fs/xfsprogs/files/xfsprogs-4.3.0-cross-compile.patch new file mode 100644 index 0000000..c545664 --- /dev/null +++ b/sys-fs/xfsprogs/files/xfsprogs-4.3.0-cross-compile.patch @@ -0,0 +1,181 @@ +From 1a366eedc0eb4da46da48e9f6e2da27c7b5d2076 Mon Sep 17 00:00:00 2001 +From: Gwendal Grignou +Date: Fri, 3 Jun 2016 09:17:28 -0700 +Subject: [PATCH] Allow compiling xfsprogs in a cross compile environment. + +Without this patch, we are using the same compiler and options for the host +compiler (BUILD_CC) and the target compiler (CC), and we would get error +messages at compilation: +x86_64-pc-linux-gnu-gcc -O2 -O2 -pipe -march=armv7-a -mtune=cortex-a15 ... +x86_64-pc-linux-gnu-gcc.real: error: unrecognized command line option +'-mfpu=neon' +'-mfloat-abi=hard' +'-clang-syntax' +'-mfpu=neon' +'-mfloat-abi=hard' +'-clang-syntax' + +Add BUILD_CC and BUILD_CFLAGS as precious variables to allow setting it up +from the ebuild. + +Signed-off-by: Gwendal Grignou +--- + configure | 26 +++++++++++++++++++++----- + configure.ac | 20 +++++++++++++++----- + include/builddefs.in | 6 ++++-- + libxfs/Makefile | 4 ++-- + 4 files changed, 42 insertions(+), 14 deletions(-) + +diff --git a/configure b/configure +index 325081f..863a447 100755 +--- a/configure ++++ b/configure +@@ -700,6 +700,7 @@ libreadline + enable_blkid + enable_gettext + enable_shared ++BUILD_CFLAGS + BUILD_CC + CPP + LT_SYS_LIBRARY_PATH +@@ -806,7 +807,9 @@ LDFLAGS + LIBS + CPPFLAGS + LT_SYS_LIBRARY_PATH +-CPP' ++CPP ++BUILD_CC ++BUILD_CFLAGS' + + + # Initialize some variables set by options. +@@ -1456,6 +1459,9 @@ Some influential environment variables: + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + CPP C preprocessor ++ BUILD_CC C compiler for build tools ++ BUILD_CFLAGS ++ C compiler flags for build tools + + Use these variables to override the choices made by `configure' or to help + it to find libraries and programs with nonstandard names/locations. +@@ -11957,11 +11963,12 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + +-if test $cross_compiling = no; then +- BUILD_CC="$CC" + +-else +- for ac_prog in gcc cc ++if test "${BUILD_CC+set}" != "set"; then ++ if test $cross_compiling = no; then ++ BUILD_CC="$CC" ++ else ++ for ac_prog in gcc cc + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 +@@ -12003,6 +12010,15 @@ fi + test -n "$BUILD_CC" && break + done + ++ fi ++fi ++ ++if test "${BUILD_CFLAGS+set}" != "set"; then ++ if test $cross_compiling = no; then ++ BUILD_CFLAGS="$CFLAGS" ++ else ++ BUILD_CFLAGS="-g -O2" ++ fi + fi + + # Check whether --enable-shared was given. +diff --git a/configure.ac b/configure.ac +index d44438f..fc286b3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -9,11 +9,21 @@ AC_PREFIX_DEFAULT(/usr) + AC_PROG_LIBTOOL + + AC_PROG_CC +-if test $cross_compiling = no; then +- BUILD_CC="$CC" +- AC_SUBST(BUILD_CC) +-else +- AC_CHECK_PROGS(BUILD_CC, gcc cc) ++AC_ARG_VAR(BUILD_CC, [C compiler for build tools]) ++if test "${BUILD_CC+set}" != "set"; then ++ if test $cross_compiling = no; then ++ BUILD_CC="$CC" ++ else ++ AC_CHECK_PROGS(BUILD_CC, gcc cc) ++ fi ++fi ++AC_ARG_VAR(BUILD_CFLAGS, [C compiler flags for build tools]) ++if test "${BUILD_CFLAGS+set}" != "set"; then ++ if test $cross_compiling = no; then ++ BUILD_CFLAGS="$CFLAGS" ++ else ++ BUILD_CFLAGS="-g -O2" ++ fi + fi + + AC_ARG_ENABLE(shared, +diff --git a/include/builddefs.in b/include/builddefs.in +index c2ca4cb..9ca57a6 100644 +--- a/include/builddefs.in ++++ b/include/builddefs.in +@@ -27,6 +27,7 @@ MALLOCLIB = @malloc_lib@ + LOADERFLAGS = @LDFLAGS@ + LTLDFLAGS = @LDFLAGS@ + CFLAGS = @CFLAGS@ ++BUILD_CFLAGS = @BUILD_CFLAGS@ + + LIBRT = @librt@ + LIBUUID = @libuuid@ +@@ -150,7 +151,7 @@ PCFLAGS+= -DENABLE_BLKID + endif + + +-GCFLAGS = $(OPTIMIZER) $(DEBUG) \ ++GCFLAGS = $(DEBUG) \ + -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \ + -DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include -I$(TOPDIR)/libxfs + +@@ -158,8 +159,9 @@ ifeq ($(ENABLE_GETTEXT),yes) + GCFLAGS += -DENABLE_GETTEXT + endif + ++BUILD_CFLAGS += $(GCFLAGS) $(PCFLAGS) + # First, Global, Platform, Local CFLAGS +-CFLAGS += $(FCFLAGS) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) ++CFLAGS += $(FCFLAGS) $(OPTIMIZER) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) + + include $(TOPDIR)/include/buildmacros + +diff --git a/libxfs/Makefile b/libxfs/Makefile +index 873d4ec..8d728c0 100644 +--- a/libxfs/Makefile ++++ b/libxfs/Makefile +@@ -111,7 +111,7 @@ default: crc32selftest ltdepend $(LTLIBRARY) + + crc32table.h: gen_crc32table.c + @echo " [CC] gen_crc32table" +- $(Q) $(BUILD_CC) $(CFLAGS) -o gen_crc32table $< ++ $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -o gen_crc32table $< + @echo " [GENERATE] $@" + $(Q) ./gen_crc32table > crc32table.h + +@@ -122,7 +122,7 @@ crc32table.h: gen_crc32table.c + # disk. + crc32selftest: gen_crc32table.c crc32table.h crc32.c + @echo " [TEST] CRC32" +- $(Q) $(BUILD_CC) $(CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@ ++ $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@ + $(Q) ./$@ + + # set up include/xfs header directory +-- +2.8.0.rc3.226.g39d4020 diff --git a/sys-fs/xfsprogs/xfsprogs-4.5.0.ebuild b/sys-fs/xfsprogs/xfsprogs-4.5.0.ebuild index def69ae9..e462b06 100644 --- a/sys-fs/xfsprogs/xfsprogs-4.5.0.ebuild +++ b/sys-fs/xfsprogs/xfsprogs-4.5.0.ebuild @@ -32,6 +32,7 @@ DEPEND="${RDEPEND} PATCHES=( "${FILESDIR}"/${PN}-4.3.0-sharedlibs.patch "${FILESDIR}"/${PN}-4.5.0-linguas.patch + "${FILESDIR}"/${PN}-4.3.0-cross-compile.patch ) pkg_setup() {