Bug 17931 - LLVM build failure
Summary: LLVM build failure
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-02-21 11:29 UTC by Alexandre Faria
Modified: 2014-03-13 16:09 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Alexandre Faria 2014-02-21 11:29:27 UTC
When I build with --enable-loadedllvm I get: 
mono: symbol lookup error: /opt/mono/lib/libmono-llvm.so.0: undefined symbol: mini_type_is_vtype


The build with --enable-llvm fails on llvm:
  CCLD     monodis
/opt/mono/lib/libLLVMSupport.a(Process.o): In function `llvm::sys::Process::FileDescriptorHasColors(int)':
Process.cpp:(.text+0x687): undefined reference to `setupterm'
Process.cpp:(.text+0x6b0): undefined reference to `tigetnum'
Process.cpp:(.text+0x6b9): undefined reference to `set_curterm'
Process.cpp:(.text+0x6c1): undefined reference to `del_curterm'
collect2: error: ld returned 1 exit status

 
My Build flags: --with-large-heap=yes --enable-llvm

        mcs source:    mcs

   Engine:
	GC:	       sgen and bundled Boehm GC with typed GC and parallel mark
	TLS:           __thread
	SIGALTSTACK:   yes
	Engine:        Building and using the JIT
	oprofile:      no
	BigArrays:     no
	DTrace:        no
	LLVM Back End: yes (dynamically loaded: no)

   Libraries:
	.NET 2.0/3.5:  yes
	.NET 4.0:      yes
	.NET 4.5:      yes
	MonoDroid:     no
	MonoTouch:     no
	Xamarin.Mac:   no
	JNI support:   IKVM Native
	libgdiplus:    assumed to be installed
	zlib:          system zlib
Comment 1 Zoltan Varga 2014-02-24 14:34:25 UTC
What mono version is this and what platform ?
Comment 2 Alexandre Faria 2014-02-24 14:41:43 UTC
Sorry git version, I just tried again today, its still broken.

Mono JIT compiler version 4.0.0 (master/adb82c8 Seg Fev 24 17:14:02 WET 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            sgen

I'm using ubuntu 13.10 64 bits, Intel i940 if I'm not mistaken.
Comment 3 Zoltan Varga 2014-02-24 15:21:30 UTC
The --enable-loadedllvm problem should be fixed by mono master a1f8b20f202c4cbeb8e96d25419519fe8d3b457e, I cannot reproduce the other problem.
Comment 4 Alexandre Faria 2014-02-25 06:00:37 UTC
With --enable-loadedllvm when I run mono --llvm, now I get:

mono: symbol lookup error: /opt/mono/lib/libmono-llvm.so.0: undefined symbol: mini_is_gsharedvt_klass

With --enable-llvm the problem remains?

Have the llvm to use changed?
https://github.com/mono/llvm.git
Comment 5 Zoltan Varga 2014-02-26 15:31:31 UTC
What is the output of:

llvm-config --ldflags

?
Comment 6 Zoltan Varga 2014-02-26 15:39:57 UTC
The --enable-loadedllvm build should be fixed now.
Comment 7 Alexandre Faria 2014-02-26 16:08:25 UTC
The output of:

llvm-config --ldflags

is:

-L/opt/mono/lib  -lz -lpthread -ltinfo -ldl -lm

Ok, I'll try ASAP.
Comment 8 Zoltan Varga 2014-02-26 16:25:01 UTC
Also, can you run the build in mono/dis with
make V=1
and paste the output ?
Comment 9 Alexandre Faria 2014-02-26 19:23:32 UTC
The output of make V=1 in mono/dis:

../../doltlibtool  --tag=CC   --mode=link gcc  -g -O2 -fno-strict-aliasing -Wdeclaration-after-statement -Wno-unused-but-set-variable -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -mno-tls-direct-seg-refs -Werror-implicit-function-declaration   -o monodis dump.o main.o declsec.o libmonodis.a ../mini/libmonosgen-2.0.la -L/opt/mono/lib  -lz -lpthread -ltinfo -ldl -lm  -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMMCJIT -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMBitWriter -lLLVMCore -lLLVMSupport -lstdc++ -L../../eglib/src -leglib -lm  -lm -lrt  -ldl -lpthread
libtool: link: gcc -g -O2 -fno-strict-aliasing -Wdeclaration-after-statement -Wno-unused-but-set-variable -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -mno-tls-direct-seg-refs -Werror-implicit-function-declaration -o .libs/monodis dump.o main.o declsec.o  libmonodis.a ../mini/.libs/libmonosgen-2.0.so -L/opt/mono/lib -lz -ltinfo -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMMCJIT -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMBitWriter -lLLVMCore -lLLVMSupport -lstdc++ -L../../eglib/src /repository/repositories/mono/2014-02-26/mono/eglib/src/.libs/libeglib.a -lm -lrt -ldl -lpthread -Wl,-rpath -Wl,/opt/mono/lib
/opt/mono/lib/libLLVMSupport.a(Process.o): In function `llvm::sys::Process::FileDescriptorHasColors(int)':
Process.cpp:(.text+0x687): undefined reference to `setupterm'
Process.cpp:(.text+0x6b0): undefined reference to `tigetnum'
Process.cpp:(.text+0x6b9): undefined reference to `set_curterm'
Process.cpp:(.text+0x6c1): undefined reference to `del_curterm'
collect2: error: ld returned 1 exit status
make: *** [monodis] Error 1
Comment 10 Alexandre Faria 2014-02-26 20:28:53 UTC
Build with --enable-loadedllvm is fixed now.

mono --llvm now works fine.
Comment 11 Zoltan Varga 2014-02-26 20:35:30 UTC
The missing symbols are in libtinfo which is on the link line, so no idea what is happening here.
Comment 12 Alexandre Faria 2014-02-27 09:36:12 UTC
If there is anything I can do to try to help...

As I'm having some additional issues when I execute with --llvm, for now I'll have to place llvm on hold, till I get the chance to address the others.

Although this is odd, as If I'm not mistaken, not long a ago, I didn't had this issues with llvm, the problem was when.
Comment 13 Zoltan Varga 2014-02-27 09:48:08 UTC
Could you run this command in mono/dis, and see if it succceeds:

gcc -g -O2 -fno-strict-aliasing -Wdeclaration-after-statement
-Wno-unused-but-set-variable -g -Wall -Wunused -Wmissing-prototypes
-Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes
-Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch
-Wno-switch-enum -Wno-unused-value -mno-tls-direct-seg-refs
-Werror-implicit-function-declaration -o .libs/monodis dump.o main.o declsec.o 
libmonodis.a ../mini/.libs/libmonosgen-2.0.so -L/opt/mono/lib -lz -ltinfo
-lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils
-lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMMCJIT -lLLVMJIT
-lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMObjCARCOpts
-lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa
-lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMBitWriter -lLLVMCore
-lLLVMSupport -lstdc++ -L../../eglib/src
/repository/repositories/mono/2014-02-26/mono/eglib/src/.libs/libeglib.a -lm
-lrt -ldl -lpthread -Wl,-rpath -Wl,/opt/mono/lib -ltinfo
Comment 14 Alexandre Faria 2014-02-27 11:29:41 UTC
Yes, it seems so, it gives no output.
Comment 15 Zoltan Varga 2014-02-27 13:33:57 UTC
Could you try again with master (e98625a6e3853f7fb75158a600ea46857248b04f) ?
Comment 16 Alexandre Faria 2014-02-27 14:14:07 UTC
Just tried, it compiled just fine!
Comment 17 Alexandre Faria 2014-02-27 14:14:49 UTC
Thanks!
Comment 18 Zoltan Varga 2014-02-27 14:17:43 UTC
-> FIXED.
Comment 19 Alexandre Faria 2014-03-13 03:48:15 UTC
REGRESSION :(
Comment 20 Zoltan Varga 2014-03-13 11:01:41 UTC
Whats the build error ?
Comment 21 Alexandre Faria 2014-03-13 12:17:05 UTC
Sorry, I thought it was exactly the same, but actually there is a different, the error is in fact the same, but this time its in mono-boehm:

  CCLD     mono-boehm
/opt/mono/lib/libLLVMSupport.a(Process.o): In function `llvm::sys::Process::FileDescriptorHasColors(int)':
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x47): undefined reference to `setupterm'
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x70): undefined reference to `tigetnum'
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x79): undefined reference to `set_curterm'
Process.cpp:(.text._ZN4llvm3sys7Process23FileDescriptorHasColorsEi+0x81): undefined reference to `del_curterm'
collect2: error: ld returned 1 exit status
make[4]: *** [mono-boehm] Error 1
Comment 22 Zoltan Varga 2014-03-13 13:57:48 UTC
Fixed in master.
Comment 23 Alexandre Faria 2014-03-13 16:09:17 UTC
Thanks!