Bug 205139 - net/tigervnc: build breaks when gcc and g++ are present and clang is the system compiler
Summary: net/tigervnc: build breaks when gcc and g++ are present and clang is the syst...
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: Thomas Zander
URL:
Keywords: easy, patch, patch-ready
Depends on:
Blocks:
 
Reported: 2015-12-08 15:43 UTC by Ting-Wei Lan
Modified: 2015-12-27 08:07 UTC (History)
4 users (show)

See Also:
meta: maintainer-feedback+
riggs: merge-quarterly+


Attachments
tigervnc build log (706.88 KB, text/plain)
2015-12-08 15:43 UTC, Ting-Wei Lan
no flags Details
patch (1.70 KB, patch)
2015-12-10 06:58 UTC, Koichiro Iwao
meta: maintainer-approval+
Details | Diff
patch (827 bytes, text/plain)
2015-12-11 01:12 UTC, Koichiro Iwao
meta: maintainer-approval+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ting-Wei Lan 2015-12-08 15:43:15 UTC
Created attachment 163989 [details]
tigervnc build log

gcc and g++ symlinks was added in r402352. This can cause problems on FreeBSD 10 because GNU autoconf tests gcc and g++ before testing cc and c++, so after installing lang/gcc, most projects that use autotools are built with gcc from ports instead of clang from base. Mixing g++ and clang++ can cause undefined reference error or crash the program because of conflicts between libstdc++ and libc++.

TigerVNC build log is attached. If gcc and g++ symlinks are removed, it can be successfully built.
Comment 1 Gerald Pfeifer freebsd_committer freebsd_triage 2015-12-08 16:03:31 UTC
If a port breaks because some other packages are installed, but should
not be used for that port (Why is that happening here, by the way?) that
looks like an issue with that port, doesn't it?

Adding maintainer for net/tigervnc.
Comment 2 Ting-Wei Lan 2015-12-08 16:45:10 UTC
I don't think this problem is specific to tigervnc because all projects using autotools can break because of this change in lang/gcc. Users that manually download sources can no longer expect './configure && make' to work. We can set environment variables in ports to prevent gcc and g++ from being found by configure scripts, but I don't think we should force all users to set CC, CPP, CXX to keep their systems working after installing a package.
Comment 3 John Marino freebsd_committer freebsd_triage 2015-12-08 17:29:57 UTC
taking the ports@ mail list off of assignment ...
Comment 4 Koichiro Iwao freebsd_committer freebsd_triage 2015-12-09 03:12:09 UTC
I confirmed the issue. I will examine if the issue is port specific.
Comment 5 Koichiro Iwao freebsd_committer freebsd_triage 2015-12-10 06:30:54 UTC
It can not be said clearly it is port issue but can be fixed in net/tigervnc port.
Comment 6 Koichiro Iwao freebsd_committer freebsd_triage 2015-12-10 06:58:48 UTC
Created attachment 164032 [details]
patch

This issue can be fixed by setting MAKE_ENV also during configure.
MAKE_ENV has CC="cc", CXX="c++", CPP="cpp" when clang is the system compiler.
Setting  MAKE_ENV during configure means autoconf respects system compiler.

Patch synopsis:
- fix the build when gcc and g++ are present and clang is the system compiler
- since xorg-server port updated to 1.17.4, update TIGERVNC_PATCH_VER
Comment 7 Koichiro Iwao freebsd_committer freebsd_triage 2015-12-10 07:00:11 UTC
Ting-Wei, can you try my patch?
Comment 8 Koichiro Iwao freebsd_committer freebsd_triage 2015-12-10 07:17:44 UTC
BTW, does PORTREVISION need to be updated in this case?
Comment 9 VK 2015-12-10 09:48:37 UTC
(In reply to Koichiro IWAO from comment #8)

Yes if it changes the package and I believe this does. After all it changes its state from un-installable in some cases, to installable in those cases.
Comment 10 Ting-Wei Lan 2015-12-10 16:24:34 UTC
The patch doesn't apply, but tigervnc can build if I manually add ${MAKE_ENV} to post-configure.

I still think lang/gcc should not install gcc and g++ symlinks even if we can fix all issues in ports. Users who manually compile things will still see issues unless we modify /etc/profile and /etc/csh.login to add these environment variables for all users.
Comment 11 Koichiro Iwao freebsd_committer freebsd_triage 2015-12-11 01:12:45 UTC
Created attachment 164096 [details]
patch

I didn't notice someone already applied chase of xorg-server update.
Simplify the patch. Now my patch just adds ${MAKE_ENV} to post-configure.

I think this is net/tigervnc issue and net/tigervnc was behaving badly.
It doesn't matter if lang/gcc installs symlinks for me. If lang/gcc installs
symlinks I just make net/tigervnc to care it.  Of course you can continue
the discussion with ports committer however everything I can do is finished.
Comment 12 Ting-Wei Lan 2015-12-11 10:25:27 UTC
The updated patch can apply and fix build issues.
Comment 13 Kubilay Kocak freebsd_committer freebsd_triage 2015-12-11 11:23:13 UTC
@Koichiro, is this issue relevant to the quarterly branch? If so, this commit should be MFH'd
Comment 14 Koichiro Iwao freebsd_committer freebsd_triage 2015-12-11 16:45:09 UTC
This issue also happens in quarterly branch.  

r399199 shouldn't be merged into quarterly because xorg-server in quarterly branch is still 1.14.7. r399216, r401710 and my patch can be merged into quarterly.

Does this answer your question?
Comment 15 Kubilay Kocak freebsd_committer freebsd_triage 2015-12-12 04:25:59 UTC
(In reply to Koichiro IWAO from comment #14)

I believe so :) Thank you
Comment 16 Koichiro Iwao freebsd_committer freebsd_triage 2015-12-24 00:48:43 UTC
When will this be committed?  TigerVNC 1.6.0 is coming up I would like to submit an update after commit.
Comment 17 commit-hook freebsd_committer freebsd_triage 2015-12-27 07:55:13 UTC
A commit references this bug:

Author: riggs
Date: Sun Dec 27 07:55:05 UTC 2015
New revision: 404551
URL: https://svnweb.freebsd.org/changeset/ports/404551

Log:
  Fix build break in the presence of multiple compilers

  PR:		205139
  Submitted by:	lantw44@gmail.com
  Approved by:	meta+ports@vmeta.jp (maintainer)
  MFH:		2015Q4 (build fix blanket)

Changes:
  head/net/tigervnc/Makefile
Comment 18 commit-hook freebsd_committer freebsd_triage 2015-12-27 08:03:16 UTC
A commit references this bug:

Author: riggs
Date: Sun Dec 27 08:02:44 UTC 2015
New revision: 404552
URL: https://svnweb.freebsd.org/changeset/ports/404552

Log:
  MFH: r404551

  Fix build break in the presence of multiple compilers

  PR:		205139
  Submitted by:	lantw44@gmail.com
  Approved by:	ports-secteam (build fix blanket), meta+ports@vmeta.jp (maintainer)

Changes:
_U  branches/2015Q4/
  branches/2015Q4/net/tigervnc/Makefile