From patchwork Fri Apr 21 00:49:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Matlack X-Patchwork-Id: 9691545 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 72B116038D for ; Fri, 21 Apr 2017 00:51:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64C8F2847B for ; Fri, 21 Apr 2017 00:51:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 599EA28480; Fri, 21 Apr 2017 00:51:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8CB22847B for ; Fri, 21 Apr 2017 00:51:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034116AbdDUAue (ORCPT ); Thu, 20 Apr 2017 20:50:34 -0400 Received: from mail-oi0-f46.google.com ([209.85.218.46]:33629 "EHLO mail-oi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033869AbdDUAu0 (ORCPT ); Thu, 20 Apr 2017 20:50:26 -0400 Received: by mail-oi0-f46.google.com with SMTP id y11so41516519oie.0 for ; Thu, 20 Apr 2017 17:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=24ngdFdcG3ACwkMUj1nlWdY9RX5AXTUKDoijWZk9sbc=; b=vO5oXrztMo2v+zuyEfqExPl1rkojOomin4ideXCz69vxbFX5m6SsHB8fgk4uHRpeJt sjcwQPRecj3QVN4JjidJ5WhO0bsEu5FKcjyzeyPNve58dl0+wdgQM4uF1BrT7jJReuSu 0HnPUapIIe+4JiaeKk7pQpqxGkn3WTg3epP4VL24odP0mqOa3MDnCHIBle3+TEAxsNJ0 XfnMPvHGt+LHLc4klHQ+vNL7BY/orKmEDnjWCOVqitEnSL4FBPDW8gjLE1wOv4i/RDv8 4gCvFc53GgIx9+3Q77NaJhDniUBwEWmbs/66SY0CZ3CkKToEgGCQbEBXO6CdH/fFwz7k K6Hw== 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:in-reply-to :references; bh=24ngdFdcG3ACwkMUj1nlWdY9RX5AXTUKDoijWZk9sbc=; b=ar4IRIQLSC1KwFXG/9c52ff/enJedZxePLnwkYCmQyPKwC5scwRzZ7oQRVG+g1S9fe rnU6kWCqdYBhat0IYlre7pO2SQn8PVQYQMeB45CzrI6CX0wymvFf7bxJYcGxJVt9EQPE ASdy9jTxQQx0HxHWovm3cIEOvuvsOs3j0oJnJKBpQQKhJ3J2zZzKGb0HF/VW1/bB9PCR 78BfSwWlE6K1Fax6rrLnANhhPiQVC4nrVFj/jOEfjnxA8MBvcf1E/6fvpItrwn/289d2 E8gLvS/DXvj2fU0VgdaU1xjzKp8Sh0tng4VkmXZYJbhk6qawFx8tJDwAsJ8YT+eJZo/F z6SA== X-Gm-Message-State: AN3rC/7lyaPUPfUXOfqEqvxU0y+XFO7aO6cTIftdAJ7q6ZtFAd9BvZ9G VJyM6fD77UnMZk1X X-Received: by 10.84.204.8 with SMTP id a8mr12823485ple.4.1492735825402; Thu, 20 Apr 2017 17:50:25 -0700 (PDT) Received: from dmatlack.sea.corp.google.com ([100.100.206.82]) by smtp.gmail.com with ESMTPSA id e13sm12466486pfb.30.2017.04.20.17.50.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Apr 2017 17:50:24 -0700 (PDT) From: David Matlack To: kvm@vger.kernel.org Cc: Peter Feiner , David Matlack Subject: [kvm-unit-tests PATCH 18/32] lib: provide stdio.h Date: Thu, 20 Apr 2017 17:49:50 -0700 Message-Id: <20170421005004.137260-19-dmatlack@google.com> X-Mailer: git-send-email 2.12.2.816.g2cccc81164-goog In-Reply-To: <20170421005004.137260-1-dmatlack@google.com> References: <20170421005004.137260-1-dmatlack@google.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Feiner kvm-unit-tests builds with the odd combination of system include files but not system libraries. That is, -nostdlib is specified but -nostdinc isn't! Problems arise when the include files don't match the libraries, e.g., printf() in some versions of glibc linking in a __printf_chk symbol that libcflat doesn't have. This patch fixes the problem with printf by pointing '#include "stdio.h"' to lib/libcflat.h, where a printf declaration that libcflat actually implements exists, rather than letting /usr/include/stdio.h get included. This patch does not solve the general problem of potential mismatches between libcflat and the compiler's notion standard include files; doing so would require rewriting stdarg.h, stdint.h, and several others in libcflat. Signed-off-by: Peter Feiner Signed-off-by: David Matlack --- lib/stdio.h | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 lib/stdio.h diff --git a/lib/stdio.h b/lib/stdio.h new file mode 100644 index 000000000000..7b30db93f7f1 --- /dev/null +++ b/lib/stdio.h @@ -0,0 +1,4 @@ +#ifndef LIBCFLAT_STDIO_H +#define LIBCFLAT_STDIO_H +#include "libcflat.h" +#endif