[llvm-dev] Building LLVM under Cygwin32 fails

Martin J. O'Riordan via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 30 08:18:09 PDT 2016


Okay, thanks Bruce.

 

The only thing I have changed is to move to CMake v3.5.2 (required upgrade) and synched with LLVM #272991 (from #262824) and it was building perfectly before.

 

The header ‘Unix/Signals.inc’ is included conditionally by ‘lib/Support/Signals.cpp’ at the very end of the file using:

 

// Include the platform-specific parts of this class.

#ifdef LLVM_ON_UNIX

#include "Unix/Signals.inc"

#endif

#ifdef LLVM_ON_WIN32

#include "Windows/Signals.inc"

#endif

 

Nothing relevant appears to have changed in the ‘lib/Support’ directory or in the file ‘lib/Support/Signals.cpp’, so I think it might be a CMake issue.   One variable is that I had to build CMake v3.5.2 for Cygwin from source because the newest available from cygwin.org is v3.3.2-1 which does not meet the minimum bar for LLVM anymore.  The Windows and CentOS versions are official releases, but usually the ‘configure/build/install’ sequence works out of the box for CMake.

 

The following condition (‘lib/Support/Unix/Signals.inc’ line #415):

 

#if HAVE_DLFCN_H && __GNUG__

 

is evaluating TRUE, so I’m guessing that CMake is taking a wrong turn somewhere.  I changed this locally to:

 

#if !defined(__CYGWIN__) && HAVE_DLFCN_H && __GNUG__

 

and it compiles fine now.  I’m guessing that CMake is not correctly setting something, but I’ll have to dig deeper to find out exactly what though.


Thanks,

 

            MartinO

 

From: bruce.hoult at gmail.com [mailto:bruce.hoult at gmail.com] On Behalf Of Bruce Hoult
Sent: 30 June 2016 13:56
To: Martin J. O'Riordan
Cc: LLVM Developers
Subject: Re: [llvm-dev] Building LLVM under Cygwin32 fails

 

Googling indicates that cygwin doesn't have that functionality. Or, at least, didn't in 2010, when someone asked about the same problem:

 

https://cygwin.com/ml/cygwin/2010-01/msg00596.html

 

"cygwin has only dlsym() not the SGI DL_info + dladdr() yet.
clang just needs it to get the path for the CIndex dll.
This should be possible with the code in the LLVM_ON_WIN32 section,
and convert then the path from win to posix with cygwin_conv_path()."
 

 

On Thu, Jun 30, 2016 at 11:16 AM, Martin J. O'Riordan via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > wrote:

I am updating our out-of-tree copy of LLVM to track the head (revision #272991 specifically).

 

I have it building successfully with VC++ 2013 and CMake v3.5.2 on Windows, and with GCC v4.8.5 and CMake v3.5.2 on CentOS; but when I try building on Windows using Cygwin32 I get the following build failures:

 

[  4%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Signals.cpp.o

In file included from /src/Compilers/llvmHead/llvm/lib/Support/Signals.cpp:180:0:

/src/Compilers/llvmHead/llvm/lib/Support/Unix/Signals.inc: In function ‘void llvm::sys::PrintStackTrace(llvm::raw_ostream&)’:

/src/Compilers/llvmHead/llvm/lib/Support/Unix/Signals.inc:418:5: error: ‘Dl_info’ was not declared in this scope

     Dl_info dlinfo;

     ^

/src/Compilers/llvmHead/llvm/lib/Support/Unix/Signals.inc:419:28: error: ‘dlinfo’ was not declared in this scope

     dladdr(StackTrace[i], &dlinfo);

                            ^

/src/Compilers/llvmHead/llvm/lib/Support/Unix/Signals.inc:419:34: error: ‘dladdr’ was not declared in this scope

     dladdr(StackTrace[i], &dlinfo);

                                  ^

/src/Compilers/llvmHead/llvm/lib/Support/Unix/Signals.inc:430:5: error: ‘Dl_info’ was not declared in this scope

     Dl_info dlinfo;

     ^

/src/Compilers/llvmHead/llvm/lib/Support/Unix/Signals.inc:431:28: error: ‘dlinfo’ was not declared in this scope

     dladdr(StackTrace[i], &dlinfo);

                            ^

/src/Compilers/llvmHead/llvm/lib/Support/Unix/Signals.inc:431:34: error: ‘dladdr’ was not declared in this scope

     dladdr(StackTrace[i], &dlinfo);

                                  ^

make[4]: *** [lib/Support/CMakeFiles/LLVMSupport.dir/build.make:2223: lib/Support/CMakeFiles/LLVMSupport.dir/Signals.cpp.o] Error 1

 

I am using CMake v3.5.2 built from source on Cygwin32 because v3.5.2 is not yet available from for download, and GCC v5.4.0.  Other than CMake, all of my Cygwin32 installation is from the distribution.

 

Is there a quick-fix known for this, or has it been fixed in a later revision, or is this a new problem?

 

Thanks,

 

            MartinO

 


_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> 
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160630/5c23aeb3/attachment.html>


More information about the llvm-dev mailing list