Bug 183943 - lang/mono port build fails with clang
Summary: lang/mono port build fails with clang
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-mono (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-14 01:40 UTC by robert.ayrapetyan
Modified: 2013-11-16 12:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description robert.ayrapetyan 2013-11-14 01:40:00 UTC
mono port fails to build with clang:

./.libs/libmini-static.a(libmini_static_la-mini.o): In function `mono_get_jit_tls_offset':
/usr/ports/lang/mono/work/mono-3.2.3/mono/mini/mini.c:2568: undefined reference to `mono_jit_tls'
/usr/ports/lang/mono/work/mono-3.2.3/mono/mini/mini.c:2568: undefined reference to `mono_jit_tls'
/usr/ports/lang/mono/work/mono-3.2.3/mono/mini/mini.c:2568: undefined reference to `mono_jit_tls'
/usr/ports/lang/mono/work/mono-3.2.3/mono/mini/mini.c:2568: undefined reference to `mono_jit_tls'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[4]: *** [mono-boehm] Error 1
gmake[4]: Leaving directory `/usr/ports/lang/mono/work/mono-3.2.3/mono/mini'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory `/usr/ports/lang/mono/work/mono-3.2.3/mono/mini'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/usr/ports/lang/mono/work/mono-3.2.3/mono'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/ports/lang/mono/work/mono-3.2.3'
gmake: *** [all] Error 2
*** [do-build] Error code 1

Stop in /usr/ports/lang/mono.

However, after commenting out clang stuff from Makefile (gcc is being used instead) - compilation succeeds.

Fix: 

Use gcc - comment out following block in the Makefile:

.if ${OSVERSION} >= 900014 && exists(/usr/bin/clang)
CC=     /usr/bin/clang
CXX=    /usr/bin/clang++
CPP=    /usr/bin/clang-cpp
.else
BUILD_DEPENDS+= clang33:${PORTSDIR}/lang/clang33
CC=     clang33
CXX=    clang33
CPP=    clang-cpp33
.endif
How-To-Repeat: cd /usr/ports/lang/mono
make install
Comment 1 Edwin Groothuis freebsd_committer 2013-11-14 01:40:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mono

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Romain Tartière freebsd_committer 2013-11-14 23:54:27 UTC
State Changed
From-To: open->feedback

Can you please provide me the config.log file generated at the configure 
stage?
Comment 3 Romain Tartière 2013-11-15 17:56:16 UTC
After reviewing the config.log sent me by private mail, the main
difference is that FreeBSD 9.1-RELEASE has clang version 3.1 while
FreeBSD 9.2-STABLE has clang version 3.3 in base.

Robert, can you please try to change OSVERSION from 900014 to 902001 in
the Makefile and tell me if it helps ?

Base GCC on i386 fails to compile mono (while it works on amd64), and
more recent GCC releases cause various problems, so as clang seems to be
causing less pain (as far as I can see), it might be good to force using
it to compile mono...

-- 
Romain Tartière <romain@blogreen.org>        http://romain.blogreen.org/
pgp: 8234 9A78 E7C0 B807 0B59  80FF BA4D 1D95 5112 336F (ID: 0x5112336F)
(plain text =non-HTML= PGP/GPG encrypted/signed e-mail much appreciated)
Comment 4 robert.ayrapetyan 2013-11-15 23:34:45 UTC
Hi.

Awesome,

.if ${OSVERSION} >= 902001 ...

did the trick - mono was compiled successfully!


On 11/15/2013, 9:56:16 AM, Romain Tartière wrote:
> After reviewing the config.log sent me by private mail, the main
> difference is that FreeBSD 9.1-RELEASE has clang version 3.1 while
> FreeBSD 9.2-STABLE has clang version 3.3 in base.
>
> Robert, can you please try to change OSVERSION from 900014 to 902001 in
> the Makefile and tell me if it helps ?
>
> Base GCC on i386 fails to compile mono (while it works on amd64), and
> more recent GCC releases cause various problems, so as clang seems to be
> causing less pain (as far as I can see), it might be good to force using
> it to compile mono...
>
Comment 5 dfilter service freebsd_committer 2013-11-16 12:48:07 UTC
Author: romain
Date: Sat Nov 16 12:47:59 2013
New Revision: 333989
URL: http://svnweb.freebsd.org/changeset/ports/333989

Log:
  Fix build using clang from ports on FreeBSD < 9.2.
  
  PR:		ports/183943
  Submitted by:	Robert <robert.ayrapetyan@gmail.com>

Modified:
  head/lang/mono/Makefile

Modified: head/lang/mono/Makefile
==============================================================================
--- head/lang/mono/Makefile	Sat Nov 16 12:33:15 2013	(r333988)
+++ head/lang/mono/Makefile	Sat Nov 16 12:47:59 2013	(r333989)
@@ -42,7 +42,7 @@ ONLY_FOR_ARCHS=	i386 amd64 powerpc
 
 .include <bsd.port.pre.mk>
 
-.if ${OSVERSION} >= 900014 && exists(/usr/bin/clang)
+.if ${OSVERSION} >= 902001 && exists(/usr/bin/clang)
 CC=	/usr/bin/clang
 CXX=	/usr/bin/clang++
 CPP=	/usr/bin/clang-cpp
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Romain Tartière freebsd_committer 2013-11-16 12:48:45 UTC
State Changed
From-To: feedback->closed

Fix committed in FreeBSD ports.