From owner-freebsd-current@FreeBSD.ORG Sun Oct 13 16:52:35 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0EC46FC4 for ; Sun, 13 Oct 2013 16:52:35 +0000 (UTC) (envelope-from decke@bluelife.at) Received: from mail-oa0-x229.google.com (mail-oa0-x229.google.com [IPv6:2607:f8b0:4003:c02::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C847B2BF6 for ; Sun, 13 Oct 2013 16:52:34 +0000 (UTC) Received: by mail-oa0-f41.google.com with SMTP id n10so3902901oag.28 for ; Sun, 13 Oct 2013 09:52:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bluelife.at; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=q/qJvgRPBAlf2Xr5jHVY+tnyO+CWmiKiwmocKMAw1eA=; b=MTe9vpsqPP7qgmxaj9nWfXqJnZ0AHLjbxvBtPKGUjXFg7vLe7CPPuqqHfKedzbmWZn 2/cdlE4GruzhNk7XR2RFIC2Jt6h6Ez8hHzrOJ9kvTaLidp9WPrJ7+tYghHrI5WDP1OP9 aIkKIwr/IQZwMragJTOOGViyzMbN5nctHpS7o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=q/qJvgRPBAlf2Xr5jHVY+tnyO+CWmiKiwmocKMAw1eA=; b=bDKDdGHFByXYlsWDwaB6bofN/66ROgScrAy/v5c4OfZNsDo9lqzwvXBEQ39EVfKvd5 FgzUtrnmdzDA3qlSMYaUOayWhUx7yoVLsgk3EH0KyumerWHM1fQAXN6bJtnIlM81HdZt dXUrLePgAAfgvpb3D+6NkcPcKZq0n8jKwa81QSTRJmRsdmIrmznt0gabiRbf10mylx4Q QigGkvWEqALsmlzlbezliMjULHG1j/bNkIBsSgH/4+5By1lQmXaUsRnZyK+Ucaw6pgAa BdvLKlXQdZ3MVMIcQKCsXpkn6NsmM9SQ2yv/GSFi4i/I/VCgBwVsdwnb/ccLRynhnMrI AoLg== X-Gm-Message-State: ALoCoQm6oNzMVf9BrThklqcC06UWQG3EXRtmHP73qB04YfHt0yq5z5F4SWhUKk58jnB3kyMoFzgR MIME-Version: 1.0 X-Received: by 10.182.242.11 with SMTP id wm11mr24516268obc.26.1381683153570; Sun, 13 Oct 2013 09:52:33 -0700 (PDT) Sender: decke@bluelife.at Received: by 10.76.154.2 with HTTP; Sun, 13 Oct 2013 09:52:33 -0700 (PDT) X-Originating-IP: [46.206.177.151] In-Reply-To: References: Date: Sun, 13 Oct 2013 18:52:33 +0200 X-Google-Sender-Auth: ZWlb_6FZZqTgVqftLkUafxaxVDY Message-ID: Subject: Re: mysql-client-5.6.14 build failed From: =?ISO-8859-1?Q?Bernhard_Fr=F6hlich?= To: Sun Renjie Content-Type: text/plain; charset=ISO-8859-1 Cc: vsityz@gmail.com, Current FreeBSD X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Oct 2013 16:52:35 -0000 On Sun, Oct 13, 2013 at 6:23 PM, Sun Renjie wrote: > Hi Alexander: > >> Date: Wed, 02 Oct 2013 02:04:02 +0300 >> From: Alexander Panyushkin >> To: freebsd-current@freebsd.org >> Subject: mysql-client-5.6.14 build failed >> Message-ID: <524B54E2.1040608@gmail.com> >> Content-Type: text/plain; charset=UTF-8; format=flowed >> >> Hi all. >> >> mysql-client-5.6.14 not build with clang > >> >> /usr/ports/databases/mysql56-client/work/mysql-5.6.14/sql/net_serv.cc:48: >> In file included from /usr/include/c++/v1/algorithm:627: >> /usr/include/c++/v1/memory:968:39: error: expected unqualified-id >> template static __two test(...); > > The build fails because the 'test' macro is defined in include/my_global.h: > #define test(a) ((a) ? 1 : 0) > yet libc++ standard header defines 'test' as the name of a > function: > template static char test(typename _Up::pointer* = 0); > > MySQL C++ source code files like sql/net_serv.cc #include > before > including . This ordering will result in the 'test' function in > > macro-expanded into nonsense. > > After a casual scan, more C++ source code files might be affacted: > > client/mysql.cc:45:#include > client/mysqlbinlog.cc:58:#include > client/mysqltest.cc:51:#include > client/sql_string.cc:28:#include > ... > > I've prepared an ad hoc patch that modifies include/my_global.h to include > before defining the 'test' macro, so that further including of > > will be uneffective and hence unharmful. I believe this likely to be useful > before there is a fix from upstream mysql or libc++. Now this package > (mysql56-client) and the server counterpart (mysql56-server) build fine. > I'm new > to FreeBSD so I hope someone else could produce a better solution. Any > comments > will be highly appreciated! Thanks. > > Here comes the patch (see also the attachment): > > root@r:/svn/ports/databases/mysql56-client # cat > files/patch-include_my_global.h > --- include/my_global.h.orig 2013-10-13 22:22:33.000000000 +0800 > +++ include/my_global.h 2013-10-13 22:26:57.000000000 +0800 > @@ -460,6 +460,13 @@ > typedef unsigned short ushort; > #endif > > +/* the macro test() below will break libc++ standard header which > + defines function named 'test'; fix it in an ad hoc manner by including > the > + header before definition of the macro. */ > +#ifdef __cplusplus > +#include > +#endif > + > #define swap_variables(t, a, b) { t dummy; dummy= a; a= b; b= dummy; } > #define test(a) ((a) ? 1 : 0) > #define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0) Please update to latest HEAD (about mid last week) and to latest portstree because the issues are already fixed in libc++ and the mysql 5.6 port. Btw your analysis is correct but I have chosen a less intrusive fix in libc++ memory to rename that internal test function and another patch to mysql 5.6. -- Bernhard Froehlich http://www.bluelife.at/