Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 May 2013 01:02:33 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        FreeBSD Current <current@freebsd.org>
Subject:   Re: buildworld of HEAD failing under 8.1-RELEASE
Message-ID:  <413D3E21-7E3E-4463-A7C7-6A70F4AFF8DB@FreeBSD.org>
In-Reply-To: <CAFMmRNzz80WS6=K8CskWN3c9Gp5r-aJzGm70Ywhx-rNui=CKZw@mail.gmail.com>
References:  <CAFMmRNzz80WS6=K8CskWN3c9Gp5r-aJzGm70Ywhx-rNui=CKZw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On May 2, 2013, at 20:28, Ryan Stone <rysto32@gmail.com> wrote:
> I am getting the following error when trying to build HEAD on an
> 8.1-RELEASE build machine (i386 jail on an amd64 host):
> 
> ===> lib/clang/libllvmanalysis (all)
> /usr/d2/users/rstone/git/svos/lib/clang/libllvmanalysis/../../../contrib/llvm/lib/Analysis/ConstantFolding.cpp:
> In function 'llvm::Constant* llvm::ConstantFoldCall(llvm::Function*,
> llvm::ArrayRef<llvm::Constant*>, const llvm::TargetLibraryInfo*)':
> /usr/d2/users/rstone/git/svos/lib/clang/libllvmanalysis/../../../contrib/llvm/lib/Analysis/ConstantFolding.cpp:1310:
> error: 'log2' was not declared in this scope
...
> Is there anything that I can do other than build on another machine?  I
> don't control the build machines at $WORK so I'm not sure whether I can get
> them upgraded. :(

In 8.1-RELEASE, there was no log2() MFC yet.  Can you please try the attached diff?

[-- Attachment #2 --]
Index: lib/clang/include/llvm/Config/config.h
===================================================================
--- lib/clang/include/llvm/Config/config.h	(revision 250174)
+++ lib/clang/include/llvm/Config/config.h	(working copy)
@@ -5,6 +5,9 @@
 #ifndef CONFIG_H
 #define CONFIG_H
 
+/* Get __FreeBSD_version */
+#include <osreldate.h>
+
 /* Bug report URL. */
 #define BUG_REPORT_URL "http://llvm.org/bugs/"
 
@@ -248,7 +251,9 @@
 #define HAVE_LOG10 1
 
 /* Define to 1 if you have the `log2' function. */
+#if __FreeBSD_version >= 900027 || (__FreeBSD_version < 900000 && __FreeBSD_version >= 802502)
 #define HAVE_LOG2 1
+#endif
 
 /* Define to 1 if you have the `longjmp' function. */
 #define HAVE_LONGJMP 1

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?413D3E21-7E3E-4463-A7C7-6A70F4AFF8DB>