From patchwork Mon Feb 24 10:54:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1243001 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=TwJRDIyA; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48QzTP2N5yz9sPk for ; Mon, 24 Feb 2020 21:54:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 30787204DF; Mon, 24 Feb 2020 10:54:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rfIwDaqtvs3O; Mon, 24 Feb 2020 10:54:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 2C3962276C; Mon, 24 Feb 2020 10:54:07 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 013051BF2C3 for ; Mon, 24 Feb 2020 10:54:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EDAE0860D1 for ; Mon, 24 Feb 2020 10:54:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ecNbX-x36LeW for ; Mon, 24 Feb 2020 10:54:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by whitealder.osuosl.org (Postfix) with ESMTPS id 84D2484E38 for ; Mon, 24 Feb 2020 10:54:00 +0000 (UTC) Received: by mail-wr1-f52.google.com with SMTP id y17so1013733wrn.6 for ; Mon, 24 Feb 2020 02:54:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aUEcbvyMlqKNzaRN+Nzm6cXG7oTeCsux2Aj0HN5ZM68=; b=TwJRDIyABPi5qKnw1FCJCE6fPad4Uxk0YcxhJp0ftW8MtKUq7O5VM8ERbJt/DhyZvr Om76TOP52U9Z5B8Est0LJMMBWEB4vk6ggm+8PHGbsdiEFrrzsqFhbawSMKOsC65e/KzZ DJxVncjdchWVvLEOgiQjBkU2M4vyQxOUs41Bs8yu6zxfRsj2jfW9AN6NxtoEwb8YTMIu 6uY4ZFQFGWWQXN5W4WZAiPhqFrYzGeQILRnFd6W6/+SooI1w8ewz4Mf0DT6LeDyd6jNG Guk4hIJvRWQ/4TNvjdMmAx3PakaOq1mz94beS2j1DRH/CPIA2RFjYUooS88B6bcUfWVn LS8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aUEcbvyMlqKNzaRN+Nzm6cXG7oTeCsux2Aj0HN5ZM68=; b=tT2I5HqLDMhZvc2S7PwOmc7nS5x13FZ2HDlzVtMxaaP/g8ebdPNekBJ1x4nDm1D9PN hVZnTB9j9Dqa8lMUBO+icOqI9KBTlhRBYVq5giwgGE6sFChZBrLu7DP5Q+3PwwTJkklb /b7QSRm7mcL3dCUPKJwZSwcL1/NK95NJO8cPWq89ssJiQyRi2gLgdBeZRHIWf1xvvav3 bLtpHcPYgdSUK3N9pqd7OEvZeHQCQPtrknGXbBTwoupqWXuBfryx1ba7vy9Bno2ngV86 9VPKLaTB2t1psKLkje4ipC+7NaVrYQehOJZRmFcRkiw/o2EVIbyGaY+ul5V8MhCM4mgc QCKg== X-Gm-Message-State: APjAAAWXMyZm3liXquMN7l/OIKh47Brx64qvmZ0ijSEqlroL1L2MVSi+ IBWvsCzqcgqRWPOEulCm6ziayo5IN3c= X-Google-Smtp-Source: APXvYqzCP13HJLUcbXaWjjjiPcEsLdiS2A6B/TfyFjoAN4hdGcmFH1R6/SUNyKf5Yh+z8Vuu0w+Ddw== X-Received: by 2002:a5d:4d06:: with SMTP id z6mr66854869wrt.241.1582541638227; Mon, 24 Feb 2020 02:53:58 -0800 (PST) Received: from kali.home (lfbn-ren-1-602-70.w81-53.abo.wanadoo.fr. [81.53.179.70]) by smtp.gmail.com with ESMTPSA id u14sm18235524wrm.51.2020.02.24.02.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 02:53:57 -0800 (PST) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Mon, 24 Feb 2020 11:54:57 +0100 Message-Id: <20200224105457.3680948-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/rocksdb: fix C++ tests X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This will fix a build failure on xtensa and nios2 that missed -faligned-new Fixes: - http://autobuild.buildroot.org/results/58bf25a16984c4d5f3ce0e26a56712410b67c53a - http://autobuild.buildroot.org/results/718fee3d20ef00ffa5c3e617a036cf2b82c97411 Signed-off-by: Fabrice Fontaine --- ...ls-build_detect_platform-fix-C-tests.patch | 279 ++++++++++++++++++ 1 file changed, 279 insertions(+) create mode 100644 package/rocksdb/0002-build_tools-build_detect_platform-fix-C-tests.patch diff --git a/package/rocksdb/0002-build_tools-build_detect_platform-fix-C-tests.patch b/package/rocksdb/0002-build_tools-build_detect_platform-fix-C-tests.patch new file mode 100644 index 0000000000..0b1118a2b3 --- /dev/null +++ b/package/rocksdb/0002-build_tools-build_detect_platform-fix-C-tests.patch @@ -0,0 +1,279 @@ +From 23739c6f9694d7fc436967439f170173dbb4c6b4 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Mon, 24 Feb 2020 10:22:13 +0100 +Subject: [PATCH] build_tools/build_detect_platform: fix C++ tests + +Replace -o /dev/null by -o test.o when testing for C++ features such as +-faligned-new otherwise tests will fail with some bugged binutils +(https://sourceware.org/bugzilla/show_bug.cgi?id=19526): + +output/host/bin/xtensa-buildroot-linux-uclibc-g++ -faligned-new -x c++ - -o /dev/null < +--- + build_tools/build_detect_platform | 58 +++++++++++++++---------------- + 1 file changed, 29 insertions(+), 29 deletions(-) + +diff --git a/build_tools/build_detect_platform b/build_tools/build_detect_platform +index 2535d8124..64a0ae76c 100755 +--- a/build_tools/build_detect_platform ++++ b/build_tools/build_detect_platform +@@ -245,7 +245,7 @@ if [ "$CROSS_COMPILE" = "true" -o "$FBCODE_BUILD" = "true" ]; then + else + if ! test $ROCKSDB_DISABLE_FALLOCATE; then + # Test whether fallocate is available +- $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null < + #include + int main() { +@@ -261,7 +261,7 @@ EOF + if ! test $ROCKSDB_DISABLE_SNAPPY; then + # Test whether Snappy library is installed + # http://code.google.com/p/snappy/ +- $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null < + int main() {} + EOF +@@ -276,7 +276,7 @@ EOF + # Test whether gflags library is installed + # http://gflags.github.io/gflags/ + # check if the namespace is gflags +- $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null << EOF ++ $CXX $CFLAGS -x c++ - -o test.o 2>/dev/null << EOF + #include + int main() {} + EOF +@@ -285,7 +285,7 @@ EOF + PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -lgflags" + else + # check if namespace is google +- $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null << EOF ++ $CXX $CFLAGS -x c++ - -o test.o 2>/dev/null << EOF + #include + using namespace google; + int main() {} +@@ -299,7 +299,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_ZLIB; then + # Test whether zlib library is installed +- $CXX $CFLAGS $COMMON_FLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null < + int main() {} + EOF +@@ -312,7 +312,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_BZIP; then + # Test whether bzip library is installed +- $CXX $CFLAGS $COMMON_FLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null < + int main() {} + EOF +@@ -325,7 +325,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_LZ4; then + # Test whether lz4 library is installed +- $CXX $CFLAGS $COMMON_FLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null < + #include + int main() {} +@@ -339,7 +339,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_ZSTD; then + # Test whether zstd library is installed +- $CXX $CFLAGS $COMMON_FLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null < + int main() {} + EOF +@@ -352,7 +352,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_NUMA; then + # Test whether numa is available +- $CXX $CFLAGS -x c++ - -o /dev/null -lnuma 2>/dev/null </dev/null < + #include + int main() {} +@@ -366,7 +366,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_TBB; then + # Test whether tbb is available +- $CXX $CFLAGS $LDFLAGS -x c++ - -o /dev/null -ltbb 2>/dev/null </dev/null < + int main() {} + EOF +@@ -379,7 +379,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_JEMALLOC; then + # Test whether jemalloc is available +- if echo 'int main() {}' | $CXX $CFLAGS -x c++ - -o /dev/null -ljemalloc \ ++ if echo 'int main() {}' | $CXX $CFLAGS -x c++ - -o test.o -ljemalloc \ + 2>/dev/null; then + # This will enable some preprocessor identifiers in the Makefile + JEMALLOC=1 +@@ -400,7 +400,7 @@ EOF + fi + if ! test $JEMALLOC && ! test $ROCKSDB_DISABLE_TCMALLOC; then + # jemalloc is not available. Let's try tcmalloc +- if echo 'int main() {}' | $CXX $CFLAGS -x c++ - -o /dev/null \ ++ if echo 'int main() {}' | $CXX $CFLAGS -x c++ - -o test.o \ + -ltcmalloc 2>/dev/null; then + PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -ltcmalloc" + JAVA_LDFLAGS="$JAVA_LDFLAGS -ltcmalloc" +@@ -409,7 +409,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_MALLOC_USABLE_SIZE; then + # Test whether malloc_usable_size is available +- $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null < + int main() { + size_t res = malloc_usable_size(0); +@@ -424,7 +424,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_PTHREAD_MUTEX_ADAPTIVE_NP; then + # Test whether PTHREAD_MUTEX_ADAPTIVE_NP mutex type is available +- $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null < + int main() { + int x = PTHREAD_MUTEX_ADAPTIVE_NP; +@@ -439,7 +439,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_BACKTRACE; then + # Test whether backtrace is available +- $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null < + int main() { + void* frames[1]; +@@ -451,7 +451,7 @@ EOF + COMMON_FLAGS="$COMMON_FLAGS -DROCKSDB_BACKTRACE" + else + # Test whether execinfo library is installed +- $CXX $CFLAGS -lexecinfo -x c++ - -o /dev/null 2>/dev/null </dev/null < + int main() { + void* frames[1]; +@@ -468,7 +468,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_PG; then + # Test if -pg is supported +- $CXX $CFLAGS -pg -x c++ - -o /dev/null 2>/dev/null </dev/null </dev/null </dev/null < + int main() { + int fd = open("/dev/null", 0); +@@ -494,7 +494,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_SCHED_GETCPU; then + # Test whether sched_getcpu is supported +- $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null < + int main() { + int cpuid = sched_getcpu(); +@@ -508,7 +508,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_AUXV_GETAUXVAL; then + # Test whether getauxval is supported +- $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null < + int main() { + uint64_t auxv = getauxval(AT_HWCAP); +@@ -522,7 +522,7 @@ EOF + + if ! test $ROCKSDB_DISABLE_ALIGNED_NEW; then + # Test whether c++17 aligned-new is supported +- $CXX $PLATFORM_CXXFLAGS -faligned-new -x c++ - -o /dev/null 2>/dev/null </dev/null </dev/null </dev/null </dev/null </dev/null < + #include + int main() { +@@ -617,7 +617,7 @@ elif test "$USE_SSE"; then + echo "warning: USE_SSE specified but compiler could not use SSE intrinsics, disabling" >&2 + fi + +-$CXX $PLATFORM_CXXFLAGS $COMMON_FLAGS $TRY_PCLMUL -x c++ - -o /dev/null 2>/dev/null </dev/null < + #include + int main() { +@@ -634,7 +634,7 @@ elif test "$USE_SSE"; then + echo "warning: USE_SSE specified but compiler could not use PCLMUL intrinsics, disabling" >&2 + fi + +-$CXX $PLATFORM_CXXFLAGS $COMMON_FLAGS $TRY_AVX2 -x c++ - -o /dev/null 2>/dev/null </dev/null < + #include + int main() { +@@ -649,7 +649,7 @@ elif test "$USE_SSE"; then + echo "warning: USE_SSE specified but compiler could not use AVX2 intrinsics, disabling" >&2 + fi + +-$CXX $PLATFORM_CXXFLAGS $COMMON_FLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null < + int main() { + uint64_t a = 0xffffFFFFffffFFFF; +@@ -666,7 +666,7 @@ fi + # succeed because the cross-compiler flags are added by the Makefile, not this + # script. + if [ "$PLATFORM" != IOS ]; then +- $CXX $COMMON_FLAGS -x c++ - -o /dev/null 2>/dev/null </dev/null </dev/null ++ $CXX $COMMON_FLAGS $PLATFORM_SHARED_LDFLAGS test_dl.o -o test.o 2>/dev/null + if [ "$?" = 0 ]; then + EXEC_LDFLAGS+="-ldl" + rm -f test_dl.o +-- +2.25.0 +