Bug 198404 - lang/mono (mono 3.12.1) does not build on i386
Summary: lang/mono (mono 3.12.1) does not build on i386
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-mono (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-07 23:25 UTC by wolfgang
Modified: 2015-03-10 21:39 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (mono)


Attachments
Add prerequisite headers for netinet/tcp.h and for ucontext_t. (629 bytes, patch)
2015-03-08 13:13 UTC, Konstantin Belousov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description wolfgang 2015-03-07 23:25:54 UTC
The recent update to mono 3.12.1 does fail on 10.1-STABLE / i386 due to type ucontext_t being undefined. The same version does build ok on amd64.

Log sample where the build starts to get wrong:
[..]
  CC       libmini_la-mini-x86.lo
  CC       libmini_la-exceptions-x86.lo
exceptions-x86.c:903:2: error: use of undeclared identifier 'ucontext_t'
        ucontext_t *ctx = (ucontext_t*)sigctx;
        ^
exceptions-x86.c:903:14: error: use of undeclared identifier 'ctx'
        ucontext_t *ctx = (ucontext_t*)sigctx;
                    ^
exceptions-x86.c:903:21: error: use of undeclared identifier 'ucontext_t'
        ucontext_t *ctx = (ucontext_t*)sigctx;
                           ^
exceptions-x86.c:903:32: error: expected expression
        ucontext_t *ctx = (ucontext_t*)sigctx;
                                      ^
exceptions-x86.c:904:19: error: use of undeclared identifier 'ucontext_t'
        return (gpointer)UCONTEXT_REG_EIP (ctx);
                         ^
../../mono/utils/mono-sigcontext.h:35:35: note: expanded from macro
      'UCONTEXT_REG_EIP'
        #define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_eip)
                                         ^
exceptions-x86.c:904:19: error: expected expression
../../mono/utils/mono-sigcontext.h:35:46: note: expanded from macro
      'UCONTEXT_REG_EIP'
        #define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_eip)
                                                    ^
exceptions-x86.c:904:37: error: use of undeclared identifier 'ctx'
        return (gpointer)UCONTEXT_REG_EIP (ctx);
                                           ^
../../mono/utils/mono-sigcontext.h:35:48: note: expanded from macro
      'UCONTEXT_REG_EIP'
        #define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_eip)
                                                      ^
exceptions-x86.c:1002:2: error: use of undeclared identifier 'ucontext_t'
        ucontext_t *ctx = (ucontext_t*)sigctx;
        ^
exceptions-x86.c:1002:14: error: use of undeclared identifier 'ctx'; did you
      mean 'mctx'?
[..]
Comment 1 Konstantin Belousov freebsd_committer freebsd_triage 2015-03-08 13:13:59 UTC
Created attachment 154012 [details]
Add prerequisite headers for netinet/tcp.h and for ucontext_t.
Comment 2 Konstantin Belousov freebsd_committer freebsd_triage 2015-03-08 13:14:58 UTC
The patch I attached is required and was tested on i386 stable/8.
Comment 3 Romain Tartière freebsd_committer freebsd_triage 2015-03-09 13:24:08 UTC
Konstantin, why did you had to add <sys/types.h> to mono/metadata/socket-io.c ?

I can compile mono in a jail with only the mono/mini/exceptions-x86.c fix.

Thanks!
Comment 4 commit-hook freebsd_committer freebsd_triage 2015-03-09 14:11:04 UTC
A commit references this bug:

Author: romain
Date: Mon Mar  9 14:11:02 UTC 2015
New revision: 380848
URL: https://svnweb.freebsd.org/changeset/ports/380848

Log:
  Fix build on i386.

  PR:		ports/198404
  Submitted by:	wolfgang@lyxys.ka.sub.org
  Obtained from:	kib

Changes:
  head/lang/mono/files/patch-mono_mini_exceptions-x86.c
Comment 5 Romain Tartière freebsd_committer freebsd_triage 2015-03-09 14:13:15 UTC
Fix committed (to mono/mini/exceptions-x86.c only since I did not needed the other patch to build on an i386 jail).

Please reopen if the other patch is also required.
Comment 6 Konstantin Belousov freebsd_committer freebsd_triage 2015-03-09 15:01:58 UTC
Without the socket-io.c chunk, I get the following (on stable/8, this is probably important):

  CC       libmonoruntime_la-opcodes.lo
  CC       libmonoruntime_la-socket-io.lo
In file included from socket-io.c:29:
/usr/include/netinet/tcp.h:40:9: error: unknown type name 'u_int32_t'
typedef u_int32_t tcp_seq;
        ^
/usr/include/netinet/tcp.h:50:2: error: unknown type name 'u_short'
        u_short th_sport;               /* source port */
        ^
/usr/include/netinet/tcp.h:51:2: error: unknown type name 'u_short'
        u_short th_dport;               /* destination port */
        ^
/usr/include/netinet/tcp.h:55:2: error: unknown type name 'u_int'
        u_int   th_x2:4,                /* (unused) */
        ^
/usr/include/netinet/tcp.h:62:2: error: unknown type name 'u_char'
        u_char  th_flags;
<lot more whining stripped>
Comment 7 Romain Tartière freebsd_committer freebsd_triage 2015-03-09 15:13:01 UTC
Good catch!  Committed, thanks!
Comment 8 commit-hook freebsd_committer freebsd_triage 2015-03-09 15:13:13 UTC
A commit references this bug:

Author: romain
Date: Mon Mar  9 15:12:27 UTC 2015
New revision: 380857
URL: https://svnweb.freebsd.org/changeset/ports/380857

Log:
  Fix build on FreeBSD 8.

  PR:		ports/198404
  Reported by:	kib

Changes:
  head/lang/mono/files/patch-mono_metadata_socket-io.c
Comment 9 wolfgang 2015-03-10 21:39:13 UTC
I can confirm that the port now builds ok on 10.1-STABLE / i386