Bug 207192 - x11-servers/x11rdp: fix build with clang 3.8.0
Summary: x11-servers/x11rdp: fix build with clang 3.8.0
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: Raphael Kubo da Costa
URL:
Keywords:
Depends on:
Blocks: 206074
  Show dependency treegraph
 
Reported: 2016-02-14 21:24 UTC by Dimitry Andric
Modified: 2016-03-03 17:18 UTC (History)
3 users (show)

See Also:
meta: maintainer-feedback+


Attachments
Fix ambiguous reference to in6addr_any (1.22 KB, patch)
2016-02-14 21:24 UTC, Dimitry Andric
rakuco: maintainer-approval+
Details | Diff
net/xrdp and x11-servers/x11rdp (75.32 KB, image/png)
2016-02-19 05:11 UTC, Koichiro Iwao
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 2016-02-14 21:24:18 UTC
Created attachment 166995 [details]
Fix ambiguous reference to in6addr_any

During a recent exp-run for bug 206074, it was found that x11-servers/x11rdp gives errors with clang 3.8.0 [1]:

/wrkdirs/usr/ports/x11-servers/x11rdp/work/x11rdp_xorg71/build_dir/include/X11/Xtrans/Xtranssock.c:1027:50: error: reference to 'in6addr_any' is ambiguous
        ((struct sockaddr_in6 *)&sockname)->sin6_addr = in6addr_any;
                                                        ^

This is because Xtranssock.c attempts to redefine in6addr_any as a weak symbol, which does not work with clang 3.8.0.  As a fix, I just placed the customized in6addr_any definition between #ifdef __FreeBSD__ guards.

[1] http://package22.nyi.freebsd.org/data/headamd64PR206074-default/2016-02-14_06h53m40s/logs/errors/x11rdp-0.5.0.299_1.log
Comment 1 Mikhail Teterin freebsd_committer 2016-02-19 04:02:11 UTC
I would propose, that x11/x11rdp be simple _removed_ in favor of net/xrdp, which appears to be the new name of the project.

For example, the port's WWW link is to http://www.xrdp.org/ , which identifies xrdp-v0.6.1 as the latest version.
Comment 2 Koichiro Iwao freebsd_committer 2016-02-19 04:27:41 UTC
No, you're misunderstanding.  Did you see the port? net/xrdp has runtime dependeny on x11-servers/x11rdp. 

xrdp and x11rdp are different things.  xrdp is a server of RDP protocol. x11rdp is a X server designed to cooperate with xrdp.  They work together.  Like Xvnc,
x11rdp is fundamentally a X server.

It is true x11rdp was formerly named Xrdp (capitalize is important).  Once Xrdp
as a X server and xrdp (all small letters) as a RDP server existed at the same time and they work together.  It was very confusing.  Thus Xrdp as X server was
renamed to x11rdp.  Just a historical story.
Comment 3 Koichiro Iwao freebsd_committer 2016-02-19 05:11:18 UTC
Created attachment 167166 [details]
net/xrdp and x11-servers/x11rdp

Please see also xrdp architecture overview.
https://github.com/neutrinolabs/xrdp/wiki/XRDP-Architecture-Overview.
Comment 4 Mikhail Teterin freebsd_committer 2016-02-19 05:25:47 UTC
(In reply to Koichiro IWAO from comment #2)
> xrdp is a server of RDP protocol. x11rdp is a X server
> designed to cooperate with xrdp.

Ok, why, then, does x11rdp conflict with xrdp-devel?

Also, why does the source for x11rdp have to come from your own server -- and include various other bits of Xorg-tree in it?
Comment 5 Koichiro Iwao freebsd_committer 2016-02-19 06:28:51 UTC
(In reply to Mikhail Teterin from comment #4)

> does x11rdp conflict with xrdp-devel?
No, but they're incompatible. Current version of x11-servers/x11rdp is only
compatible with xrdp v0.6.x.

I'm testing x11rdp-devel which compatible with xrdp-devel in my github repo.
https://github.com/metalefty/freebsd-ports/tree/develop/x11-servers

However, I'm not going to bring this in ports collection because xrdp project
is trying to replace x11rdp with xorgxrdp driver.
https://github.com/neutrinolabs/xrdp/wiki/Compiling-rdp-driver
I'm also testing xorgxrdp driver in my repo.
https://github.com/metalefty/freebsd-ports/tree/develop/x11-drivers/xorg-driver-xrdp

With xorgxrdp driver model, xrdp doesn't have to have own Xorg tree.
Just load xrdp drivers to existing Xorg installation.

I'm contributing to xrdp project to improve FreeBSD compatibility. In near 
future, things will be simple.  When net/xrdp is updated to 0.8.x or higher, 
x11-servers/x11rdp can be removed.  x11-servers/xorg-server with xorgxrdp
driver will be used instead of x11rdp.

> why does the source for x11rdp have to come from your own server 
Because it is svn snapshot.
svn://server1.xrdp.org/srv/svn/repos/main/x11rdp_xorg71 
We can get non-svn-snapshot version is distributed here. Of course this is
older than svn snapshot.
http://server1.xrdp.org/xrdp/x11rdp_xorg71.tar.gz

And one more, repository was migrated to GitHub however x11rdp source wasn't
migrated to GitHub meaning x11rdp source compatible with xrdp v0.6.x isn't
available on GitHub.

AFAIK, ports cannot fetch the source from svn server. Am I correct?
If possible, It is not necessary to distribute the source by my own.

If distributing source by my own is not recommended, I'm welcome to replace
the source from xrdp.org.  It means downgrade.
Comment 6 Koichiro Iwao freebsd_committer 2016-02-23 00:50:00 UTC
Anyway, simply commit the patch.  Don't remove this port.
Is there any problems?
Comment 7 commit-hook freebsd_committer 2016-03-03 17:17:58 UTC
A commit references this bug:

Author: rakuco
Date: Thu Mar  3 17:17:53 UTC 2016
New revision: 410064
URL: https://svnweb.freebsd.org/changeset/ports/410064

Log:
  Fix build with clang 3.8.0.

  During a recent exp-run for bug 206074, it was found that x11-servers/x11rdp
  gives errors with clang 3.8.0:

  /wrkdirs/usr/ports/x11-servers/x11rdp/work/x11rdp_xorg71/build_dir/include/X11/Xtrans/Xtranssock.c:1027:50: error: reference to 'in6addr_any' is ambiguous
          ((struct sockaddr_in6 *)&sockname)->sin6_addr = in6addr_any;
                                                                  ^

  This is because Xtranssock.c attempts to redefine in6addr_any as a weak symbol,
  which does not work with clang 3.8.0. As a fix, place the customized
  in6addr_any definition between #ifdef __FreeBSD__ guards.

  PR:		207192
  Submitted by:	dim
  Reviewed by:	Koichiro IWAO <meta+ports@vmeta.jp> (maintainer)

Changes:
  head/x11-servers/x11rdp/files/patch-xtrans-X11R7.0-1.0.0__Xtranssock.c