From patchwork Thu Jan 24 15:04:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 215363 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 769C92C0089 for ; Fri, 25 Jan 2013 02:04:58 +1100 (EST) Received: from localhost ([::1]:58857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyOMK-0005ee-HW for incoming@patchwork.ozlabs.org; Thu, 24 Jan 2013 10:04:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyOM4-0005db-EZ for qemu-devel@nongnu.org; Thu, 24 Jan 2013 10:04:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TyOM0-0002YY-9t for qemu-devel@nongnu.org; Thu, 24 Jan 2013 10:04:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyOM0-0002YF-0j for qemu-devel@nongnu.org; Thu, 24 Jan 2013 10:04:36 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0OF4XvP012295 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 Jan 2013 10:04:33 -0500 Received: from localhost (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0OF4WCb012628; Thu, 24 Jan 2013 10:04:33 -0500 From: Stefan Hajnoczi To: Date: Thu, 24 Jan 2013 16:04:31 +0100 Message-Id: <1359039871-14401-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell Subject: [Qemu-devel] [PATCH] trace: work around ranlib warning for 'nop' backend X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The 'nop' backend does not emit any C code and therefore leaves trace/generated-tracers.c empty. Peter Maydell reports that ranlib(1) prints a warning when it encounters object files that define no symbols: /usr/bin/ranlib: file: libqemuutil.a(generated-tracers.o) has no symbols Define a dummy symbol to silence ranlib(1). Note that it will not be linked into the final binary since there are no dependencies on it. Reported-by: Peter Maydell Signed-off-by: Stefan Hajnoczi --- Peter: Please test this patch. It feels a little dirty but I think it's worth getting rid of the ranlib warning in the default build on your host. scripts/tracetool/format/c.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index 35555ae..9596e3a 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -17,4 +17,10 @@ from tracetool import out def begin(events): - out('/* This file is autogenerated by tracetool, do not edit. */') + out('/* This file is autogenerated by tracetool, do not edit. */', + '', + '/* Prevent backends that do not emit any C code from hitting a ' + ' * warning in some versions of ranlib(1) because the object file ' + ' * has no symbols.' + ' */', + 'const char trace_c_unused_symbol_dummy;')