Bug 199905 - PCH bustage when building with GCC on -CURRENT kernel: fatal error: had to relocate PCH (7 ports)
Summary: PCH bustage when building with GCC on -CURRENT kernel: fatal error: had to re...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: needs-patch, regression
Depends on: 199912
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-03 23:02 UTC by Jan Beich
Modified: 2015-06-16 13:07 UTC (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2015-05-03 23:04:50 UTC
Some of the affected ports are unmaintained:

  devel/codeblocks
  graphics/evolvotron
  graphics/fracplanet
  audio/last.fm
  textproc/sigil
Comment 2 Mark Felder freebsd_committer freebsd_triage 2015-05-05 01:52:28 UTC
I've fixed audio/mumble and audio/murmur which were affected
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-05-07 10:05:58 UTC
A commit references this bug:

Author: jbeich
Date: Thu May  7 10:05:52 UTC 2015
New revision: 385615
URL: https://svnweb.freebsd.org/changeset/ports/385615

Log:
  textproc/sigil: unbreak build on the package cluster (PCH)

  PR:		199905

Changes:
  head/textproc/sigil/Makefile
Comment 4 Dmitry Marakasov freebsd_committer freebsd_triage 2015-05-09 11:39:45 UTC
What does this have to do with named ports? It's either kernel or gcc bug and should be fixed there. Please rollback all "fixes" for ports mentioned in this PR.
Comment 5 Mark Felder freebsd_committer freebsd_triage 2015-05-11 20:12:49 UTC
(In reply to Dmitry Marakasov from comment #4)

This has already been covered in this commit log

https://svnweb.freebsd.org/ports?view=revision&revision=384056

There is no interest in hacking gcc to play nice with pch, and it doesn't make sense because the older releases that have gcc as the base compiler are not going to continue to receive updates. It's much easier to just patch a dozen ports and move on.
Comment 6 Bryan Drewery freebsd_committer freebsd_triage 2015-05-11 23:18:27 UTC
(In reply to Mark Felder from comment #5)
> (In reply to Dmitry Marakasov from comment #4)
> 
> This has already been covered in this commit log
> 
> https://svnweb.freebsd.org/ports?view=revision&revision=384056
> 
> There is no interest in hacking gcc to play nice with pch, and it doesn't
> make sense because the older releases that have gcc as the base compiler are
> not going to continue to receive updates. It's much easier to just patch a
> dozen ports and move on.

Yup. Thanks for linking my commit. Just disable PCH and move on. Building a fixed GCC to build with is not useful here.
Comment 7 Mark Felder freebsd_committer freebsd_triage 2015-05-12 13:59:53 UTC
FYI, you are going to want to mfh to the quarterly branch as well. I am getting emails about my ports failing to build for the quarterly branch.
Comment 8 Bryan Drewery freebsd_committer freebsd_triage 2015-05-12 16:14:22 UTC
(In reply to Mark Felder from comment #7)
> FYI, you are going to want to mfh to the quarterly branch as well. I am
> getting emails about my ports failing to build for the quarterly branch.

It was in April: https://svnweb.freebsd.org/changeset/ports/384168
Comment 10 Dmitry Marakasov freebsd_committer freebsd_triage 2015-05-13 17:05:00 UTC
(In reply to Bryan Drewery from comment #6)
I've read the thread, but not sure if I understood it correctly, so just to be sure:

- the problem is only with base gcc (e.g. pre-10.x or arches which do not use clang yet such as mips) as it couldn't be updated right away
- it can be fixed by using gcc from ports or disabling PCH

Is this correct?

Either way, I'd really prefer such fixes to be OSVERSION-dependent so they may be removed as soon as all problematic FreeBSD versions are EoL'ed.
Comment 11 Mark Felder freebsd_committer freebsd_triage 2015-05-13 18:17:11 UTC
(In reply to Dmitry Marakasov from comment #10)

Yes and it only happens when you have a 11.0-CURRENT kernel, so these 8.x and 9.x environments are in jails being used to build these ports which is exactly how the official package building servers are setup.

If a user wanted to build these ports/packages on 9.3-RELEASE, for example, it would work fine without this change.
Comment 12 Jan Beich freebsd_committer freebsd_triage 2015-05-13 18:38:36 UTC
I'd advise testing prior applying OSVERSION checks. For one, games/assaultcube before ports r385392 doesn't build even with lang/gcc and 10.1R i386 userland:

  /usr/lib/crt1.o: In function `_start1':
  /usr/src/lib/csu/i386-elf/crt1_c.c:(.text+0x156): undefined reference to `main'
  collect2: error: ld returned 1 exit status
  Makefile:130: recipe for target 'cube.h.gch' failed
  gmake[1]: *** [cube.h.gch] Error 1

Similar error occurs with textproc/sigil.
Comment 13 Dmitry Marakasov freebsd_committer freebsd_triage 2015-05-13 19:02:48 UTC
(In reply to Jan Beich from comment #12)
As far as I remember, gcc from ports has some problems with precompiled headers by itself. I've ran into it in games/redeclipse.

Also, what are OSVERSION in which gcc was fixed? Actually I don't see relevant commits to contrib/gcc even in HEAD. Am I looking in a wrong place?
Comment 14 Dmitry Marakasov freebsd_committer freebsd_triage 2015-05-13 23:18:20 UTC
Also, won't today's ENs solve this?
Comment 15 Mark Felder freebsd_committer freebsd_triage 2015-05-14 13:26:50 UTC
(In reply to Dmitry Marakasov from comment #13)

GCC was not fixed. Nobody is committing changes to GCC to fix the precompiled headers bug.


I'm not sure how the recent ENs would have any affect on this issue since they have nothing to do with the 11-CURRENT kernel exhibiting this behavior.
Comment 16 Dmitry Marakasov freebsd_committer freebsd_triage 2015-05-14 18:40:42 UTC
(In reply to Mark Felder from comment #15)

In my understanding, base gcc in all FreeBSD branches should have been fixed to work fine under 11 kernel. It may not require it's own EN as it's mainly related to pkg cluster, however it could have been pushed to the cluster with other ENs.
Comment 17 commit-hook freebsd_committer freebsd_triage 2015-05-14 19:03:13 UTC
A commit references this bug:

Author: jbeich
Date: Thu May 14 19:03:05 UTC 2015
New revision: 386354
URL: https://svnweb.freebsd.org/changeset/ports/386354

Log:
  MFH: r385615

  textproc/sigil: unbreak build on the package cluster (PCH)

  PR:		199905
  Approved by:	/head @ r385020
  Approved by:	ports-secteam (delphij)

Changes:
_U  branches/2015Q2/
  branches/2015Q2/textproc/sigil/Makefile
Comment 18 Bryan Drewery freebsd_committer freebsd_triage 2015-05-14 19:07:45 UTC
(In reply to Dmitry Marakasov from comment #13)
> (In reply to Jan Beich from comment #12)
> As far as I remember, gcc from ports has some problems with precompiled
> headers by itself. I've ran into it in games/redeclipse.
> 
> Also, what are OSVERSION in which gcc was fixed? Actually I don't see
> relevant commits to contrib/gcc even in HEAD. Am I looking in a wrong place?

It hasn't been fixed. It needs to be, but doesn't change this PR at all as noted before. Sure an EN would be great if there was a fix for gcc and re@ cared enough to release it. I doubt they would deem it worth the effort. Even then I would still want the changes in this PR since it's not reasonable to expect people to have the latest EN installed to avoid a build error that is easily avoided and only was there for a slight build optimization.

Also note that while this issue is appearing on 11, it has been a bug in GCC for over a decade IIRC. Just google for the issue and you'll find references to it for other systems as well. The GCC PCH errors did occur with FreeBSD <11 with boost quite often for me as well. The changes in 11 just make it more consistently obviously broken.
Comment 19 Dmitry Marakasov freebsd_committer freebsd_triage 2015-06-04 11:39:14 UTC
games/bloodfrontier, games/sauerbraten fixed
Comment 20 Dmitry Marakasov freebsd_committer freebsd_triage 2015-06-16 13:07:14 UTC
I've fixed remaining ports mentioned in this PR. Seems like it can be closed now.