Bug 231549 - print/ghostscript9-agpl-base: disable CUPS on powerpc64
Summary: print/ghostscript9-agpl-base: disable CUPS on powerpc64
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: Tijl Coosemans
Depends on:
Reported: 2018-09-21 15:06 UTC by Piotr Kubaj
Modified: 2018-09-22 13:07 UTC (History)
5 users (show)

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

patch (338 bytes, patch)
2018-09-21 15:06 UTC, Piotr Kubaj
no flags Details | Diff
patch2 (738 bytes, patch)
2018-09-22 10:42 UTC, Tijl Coosemans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2018-09-21 15:06:52 UTC
Created attachment 197306 [details]

Adding CUPS option on powerpc64 breaks compilation.

Work it around by disabling CUPS on this platform.
Comment 1 Tijl Coosemans freebsd_committer 2018-09-22 09:29:50 UTC
Can you provide a build log that shows the error?
Comment 3 Tijl Coosemans freebsd_committer 2018-09-22 10:42:04 UTC
Created attachment 197344 [details]

dispatch.h is only included if __BLOCKS__ is defined.  This should only be the case when compiling with -fblocks.  Is this enabled by default maybe on powerpc64?  Does "cc -E -dM - < /dev/null | grep BLOCKS" output anything on powerpc64?

That said, nothing from ./cups/libs should be included so this is a real bug on all architectures.  Please try the attached patch.
Comment 4 Piotr Kubaj freebsd_committer 2018-09-22 12:21:00 UTC
(In reply to Tijl Coosemans from comment #3)
$ cc -E -dM - < /dev/null | grep BLOCKS
#define __BLOCKS__ 1

I'm trying your patch.
Comment 5 Tijl Coosemans freebsd_committer 2018-09-22 12:30:28 UTC
Dimitry, do you know why clang seems to compile with -fblocks by default on powerpc64?
Comment 6 Piotr Kubaj freebsd_committer 2018-09-22 12:37:47 UTC
(In reply to Tijl Coosemans from comment #5)
Yes, with this patch build works.

On powerpc64 cc is GCC 4.2.1.
Comment 7 Piotr Kubaj freebsd_committer 2018-09-22 12:38:09 UTC
(In reply to Tijl Coosemans from comment #5)
$ cc -v
Using built-in specs.
Target: powerpc64-undermydesk-freebsd
Configured with: FreeBSD/powerpc64 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]
Comment 8 Tijl Coosemans freebsd_committer 2018-09-22 12:51:14 UTC
Ah, right, I didn't think gcc supported blocks but now I seem to vaguely remember this was imported into FreeBSD from Apple gcc.  On MacOS both clang and gcc enable -fblocks by default.
Comment 9 commit-hook freebsd_committer 2018-09-22 13:02:40 UTC
A commit references this bug:

Author: tijl
Date: Sat Sep 22 13:01:39 UTC 2018
New revision: 480382
URL: https://svnweb.freebsd.org/changeset/ports/480382

  Remove bundled CUPS in post-patch so its headers cannot be included.

  This fixes the powerpc64 build.

  PR:		231549
  Reported by:	Piotr Kubaj <pkubaj@anongoth.pl>