Hello llvmdev, (just for fun) I've tried to compile LLVM under cygwin. With "make -k" I got only: ----------------- DynamicLinker.cpp: In function `void* GetAddressOfSymbol(const char*)': DynamicLinker.cpp:40: error: `RTLD_DEFAULT' undeclared (first use this function) DynamicLinker.cpp:40: error: (Each undeclared identifier is reported only once for each function it appears in.) ----------------- well, the only value supported in cygwin's dlfcn.h are RTLD_LAZY, RTLD_NOW and RTLD_GLOBAL. So, just for checking compilation I've changed the line return dlsym (RTLD_DEFAULT, symbolName); in DynamicLinker.cpp to the following: return dlsym (/*RTLD_DEFAULT*/(void*)RTLD_LAZY, symbolName); than compilation itself finished, just linkage failed with one screen output! The beginning of output is here (sorry if it is too much for this maillist...) : ------------------------------------- /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/CommandLine.o(.stab+0xce68): In function `GLOBAL__D__ZN2cl23ParseEnvironmentOptionsEPKcS1_S1_': /cygdrive/w/tmp/llvm/llvm/lib/Support/CommandLine.cpp:883: reloc refers to symbol `.text$_ZNSt22_Rb_tree_base_iterator12_M_incrementEv' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/CommandLine.o(.stab+0xd090):/cygdrive/w/tmp/llvm/llvm/lib/Support/CommandLine.cpp:883: reloc refers to symbol `.text$_ZStltIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/CommandLine.o(.stab+0x1051c):/cygdrive/w/tmp/llvm/llvm/lib/Support/CommandLine.cpp:883: reloc refers to symbol `.text$_ZnwjPv' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/CommandLine.o(.stab+0x107c8):/cygdrive/w/tmp/llvm/llvm/lib/Support/CommandLine.cpp:883: reloc refers to symbol `.text$_ZNSt22_Rb_tree_base_iteratorC2Ev' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/CommandLine.o(.stab+0x128e0):/cygdrive/w/tmp/llvm/llvm/lib/Support/CommandLine.cpp:883: reloc refers to symbol `.text$_ZSt18_Rb_tree_rebalancePSt18_Rb_tree_node_baseRS0_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/CommandLine.o(.stab+0x13da4):/cygdrive/w/tmp/llvm/llvm/lib/Support/CommandLine.cpp:883: reloc refers to symbol `.text$_ZNSt18_Rb_tree_node_base10_S_minimumEPS_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/CommandLine.o(.stab+0x1405c):/cygdrive/w/tmp/llvm/llvm/lib/Support/CommandLine.cpp:883: reloc refers to symbol `.text$_ZSt4swapISt14_Rb_tree_colorEvRT_S2_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/ConstantRange.o(.stab+0x1a260): In function `GLOBAL__D__ZN13ConstantRangeC2EPK4Typeb': /cygdrive/w/tmp/llvm/llvm/include/llvm/User.h:28: reloc refers to symbol `.text$_ZN12AnnotationIDC1ERKS_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/Debug.o(.stab+0x1cef4): In function `GLOBAL__D_DebugFlag': /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug.cpp:50: reloc refers to symbol `.text$_ZN2cl4descC1EPKc' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/Debug.o(.stab+0x1d164):/cygdrive/w/tmp/llvm/llvm/lib/Support/Debug.cpp:50: reloc refers to symbol `.text$_ZSteqIcSt11char_traitsIcESaIcEEbPKT_RKSbIS3_T0_T1_E' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/FileUtilities.o(.stab+0x22114): In function `GLOBAL__D__Z9DiffFilesRKSsS0_PSs': /usr/include/c++/3.3.1/iostream:143: reloc refers to symbol `.text$_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/FileUtilities.o(.stab+0x221d4):/usr/include/c++/3.3.1/iostream:143: reloc refers to symbol `.text$_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_PKS3_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/FileUtilities.o(.stab+0x22348):/usr/include/c++/3.3.1/iostream:143: reloc refers to symbol `.text$_ZNSt11char_traitsIcE6lengthEPKc' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/LeakDetector.o(.stab+0x24e08): In function `GLOBAL__D__ZN12LeakDetector20addGarbageObjectImplEPv': /usr/include/c++/3.3.1/bits/stl_set.h:100: reloc refers to symbol `.text$_ZNSt22_Rb_tree_base_iteratorC2Ev' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/LeakDetector.o(.stab+0x284f8):/usr/include/c++/3.3.1/bits/stl_set.h:100: reloc refers to symbol `.text$_ZnwjPv' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/LeakDetector.o(.stab+0x28540):/usr/include/c++/3.3.1/bits/stl_set.h:100: reloc refers to symbol `.text$_ZNSt18_Rb_tree_node_base10_S_minimumEPS_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/LeakDetector.o(.stab+0x287f8):/usr/include/c++/3.3.1/bits/stl_set.h:100: reloc refers to symbol `.text$_ZSt4swapISt14_Rb_tree_colorEvRT_S2_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/Mangler.o(.stab+0x2b8f4): In function `GLOBAL__D__ZN7Mangler14makeNameProperERKSs': /usr/include/c++/3.3.1/bits/stl_set.h:100: reloc refers to symbol `.text$_ZNKSt3setIPK5ValueSt4lessIS2_ESaIS2_EE5countERKS2_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/Mangler.o(.stab+0x2b960):/usr/include/c++/3.3.1/bits/stl_set.h:100: reloc refers to symbol `.text$_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/Mangler.o(.stab+0x2bda4):/usr/include/c++/3.3.1/bits/stl_set.h:100: reloc refers to symbol `.text$_ZNSt3setIPK5ValueSt4lessIS2_ESaIS2_EE6insertERKS2_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/Mangler.o(.stab+0x2c0d4):/usr/include/c++/3.3.1/bits/stl_set.h:100: reloc refers to symbol `.text$_ZNSs6appendIPKcEERSsT_S3_' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/Mangler.o(.stab+0x2c29c):/usr/include/c++/3.3.1/bits/stl_set.h:100: reloc refers to symbol `.text$_ZNSt17_Rb_tree_iteratorIPK5ValueRKS2_PS3_EC1ERKS_IS2_RS2_PS2_E' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/Mangler.o(.stab+0x2c2fc):/usr/include/c++/3.3.1/bits/stl_set.h:100: reloc refers to symbol `.text$_ZNSt4pairISt17_Rb_tree_iteratorIPK5ValueRKS3_PS4_EbEC1ERKS7_RKb' which is not being output /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/Mangler.o(.stab+0x2c458):/usr/include/c++/3.3.1/bits/stl_set.h:100: reloc refers to symbol `.text$_ZNSt22_Rb_tree_base_iteratorC2Ev' which is not being output ...skipped... ------------------------------------- and the last issue was "etags: Unknown option: -l" Remark: --------------------------------- bash-2.05b$ etags.exe --version Exuberant Ctags 5.5, Copyright (C) 1996-2003 Darren Hiebert Compiled: Jun 5 2003, 10:00:19 Addresses: <dhiebert at users.sourceforge.net>, http://ctags.sourceforge.net Optional compiled features: +wildcards, +regex, +internal-sort --------------------------------- That's it. -- Best regards, Valery mailto:khamenya at mail.ru
Hi,> (just for fun) I've tried to compile LLVM under cygwin.Thanks! This is very helpful. As I think you implied, RTLD_{LAZY,NOW,GLOBAL} are not really handles that can be passed to dlsym; rather, they're flags for dlopen. For GetAddressOfSymbol() on Windows in general, it may be more appropriate to reimplement it in terms of LoadLibrary()/GetProcAddress(). For GetAddressOfSymbol() on Cygwin in particular, which only partially implements dlopen/dlsym, it may be OK to use the (nonstandard) call: dlsym (dlopen (NULL, 0), symbolName).> /cygdrive/w/tmp/llvm/llvm/lib/Support/CommandLine.cpp:883: reloc > refers to symbol `.text$_ZNSt22_Rb_tree_base_iterator12_M_incrementEv' > which is not being outputThis is a known bug in the cygwin version of "ld". I reported this to the binutils maintainers in August and they have apparently fixed it in mainline CVS: http://sources.redhat.com/ml/binutils/2003-09/msg00013.html http://sources.redhat.com/ml/binutils/2003-09/msg00025.html http://sources.redhat.com/ml/binutils/2003-09/msg00040.html However, a new version has not yet been released. You may have better luck if you try the "ld" from current binutils CVS.> and the last issue was "etags: Unknown option: -l"It looks like exuberant-ctags wants you to say etags --language-force=c++ instead of etags -l c++ If you try any of these suggestions, please let us know how well they work. Thanks again! -Brian Gaeke -- gaeke at uiuc.edu
On Sat, 25 Oct 2003, Valery A.Khamenya wrote:> (just for fun) I've tried to compile LLVM under cygwin. > With "make -k" I got only:Cool. We don't rountinely use this configuration, so there may be a bit of leg work you'll have to do... :) But that said, we would love to get LLVM working cleanly on it!> ----------------- > DynamicLinker.cpp: In function `void* GetAddressOfSymbol(const char*)': > DynamicLinker.cpp:40: error: `RTLD_DEFAULT' undeclared (first use this > function) > DynamicLinker.cpp:40: error: (Each undeclared identifier is reported only once > for each function it appears in.) > ----------------- > > well, the only value supported in cygwin's dlfcn.h are RTLD_LAZY, > RTLD_NOW and RTLD_GLOBAL.Does the cygwin version of dlopen return the main process if 0 is passed in as the first parameter? The wording in the linux man page looks like this: If filename is a NULL pointer, then the returned handle is for the main program. If so, this patch should fix the problem. Let me know if it helps: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20031020/008818.html> than compilation itself finished, just linkage failed with one screen > output! > The beginning of output is here (sorry if it is too much for this > maillist...) : > ------------------------------------- > /cygdrive/w/tmp/llvm/llvm/lib/Support/Debug/CommandLine.o(.stab+0xce68): In function `GLOBAL__D__ZN2cl23ParseEnvironmentOptionsEPKcS1_S1_':I believe that this is due to a known bug in the Cygwin linker. See this thread: http://sources.redhat.com/ml/binutils/2003-08/msg00218.html If you upgrade to the latest and greatest, this may be fixed.> and the last issue was "etags: Unknown option: -l" > Remark: > --------------------------------- > bash-2.05b$ etags.exe --version > Exuberant Ctags 5.5, Copyright (C) 1996-2003 Darren Hiebert > Compiled: Jun 5 2003, 10:00:19 > Addresses: <dhiebert at users.sourceforge.net>, http://ctags.sourceforge.net > Optional compiled features: +wildcards, +regex, +internal-sort > ---------------------------------Interesting. The etags I have is part of emacs itself: $ etags --version etags (GNU Emacs 21.1.14) Copyright (C) 1996 Free Software Foundation, Inc. and Ken Arnold This program is distributed under the same terms as Emacs The autoconf test for etags should not allow this version I guess. For now, you can just comment out the 'ETAGS =' line in your top level Makefile.config. -Chris -- http://llvm.cs.uiuc.edu/ http://www.nondot.org/~sabre/Projects/
Hello Chris and all, Saturday, October 25, 2003, 7:17:28 PM, you wrote: CL> Cool. We don't rountinely use this configuration, so there may be a bit CL> of leg work you'll have to do... :) But that said, we would love to get CL> LLVM working cleanly on it! yes, it would be nice. Indeed that way LLVM could break into win32 world. CL> Does the cygwin version of dlopen return the main process if 0 is passed CL> in as the first parameter? The wording in the linux man page looks like CL> this: ... CL> If you upgrade to the latest and greatest, this may be fixed. My goal was just to try compiling LLVM with cygwin. I'd like to wait until next releases of cygwin instead of making my current up-to-date stable cygwin release conflicting :-/ -- Best regards, Valery A.Khamenya mailto:khamenya at mail.ru Local Time: 22:35