Bug 197405 - [patch] multimedia/libva: Fix build with clang when it reports a warning for -isystem option
Summary: [patch] multimedia/libva: Fix build with clang when it reports a warning for ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Guido Falsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-08 02:45 UTC by Kevin Zheng
Modified: 2015-02-09 22:38 UTC (History)
0 users

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


Attachments
Patch to correct header file compiler flag (501 bytes, patch)
2015-02-08 02:45 UTC, Kevin Zheng
no flags Details | Diff
Poudriere build log from port BEFORE patch was applied (29.01 KB, text/x-log)
2015-02-08 02:46 UTC, Kevin Zheng
no flags Details
Poudriere build log from port AFTER patch was applied (71.82 KB, text/x-log)
2015-02-08 02:47 UTC, Kevin Zheng
no flags Details
Configure log BEFORE patch was applied (104.97 KB, text/x-log)
2015-02-08 16:05 UTC, Kevin Zheng
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Zheng 2015-02-08 02:45:15 UTC
Created attachment 152700 [details]
Patch to correct header file compiler flag

On recent (10.1-RELEASE) FreeBSD, multimedia/libva fails to build due to a missing -fPIC linker flag. This flag is not added by the configure script because clang triggers a warning (unused flag) and causes the script to think that -fPIC simply doesn't work.
Comment 1 Bugzilla Automation freebsd_committer 2015-02-08 02:45:15 UTC
Auto-assigned to maintainer madpilot@FreeBSD.org
Comment 2 Kevin Zheng 2015-02-08 02:46:24 UTC
Created attachment 152701 [details]
Poudriere build log from port BEFORE patch was applied
Comment 3 Kevin Zheng 2015-02-08 02:47:15 UTC
Created attachment 152702 [details]
Poudriere build log from port AFTER patch was applied
Comment 4 Guido Falsi freebsd_committer 2015-02-08 11:17:23 UTC
(In reply to Kevin Zheng from comment #0)

Hi,

Just yesterday I built this port in poudriere without seeing this problem. I'll test again but I think there is something else causing this problem to you.

The patch you propose isn't wrong but before changing the port I'd like to know exactly what's going on. I can't see how changing the include flags could change clang behavior about unknown flags.

Could you build again the port without the patch, save the workdir (-w flag to poudriere) and send me the config.log file from the workdir?

Thanks.
Comment 5 Kevin Zheng 2015-02-08 16:05:07 UTC
Created attachment 152709 [details]
Configure log BEFORE patch was applied

Thanks for the quick response. I've attached 'config.log' from before the patch was applied. Look for "fPIC" (near line 1277).
Comment 6 Guido Falsi freebsd_committer 2015-02-08 18:15:14 UTC
(In reply to Kevin Zheng from comment #5)

Looking at the config.log I see that in your poudriere clang is emitting a warning:

cc: warning: argument unused during compilation: '-isystem /usr/local/include'

(or c++ whether it was called with that name)

This isn't happening in my poudriere. I'm not sure why. Do you have any local patches or configuration knobs (custom CFLAGS for example) which could be affecting this? Was the poudriere jail created using the ftp method (binary distribution) or compiling from sources? (I'm just guessing at this point...)


You patch fixes the problem you're seeing since it removes that flag and substitutes a more common one.

I have no objection to your patch, so I'll test it and commit it if it works fine on all supported versions, but I'd really like to understand what's the difference on your system causing clang to generate a warning that isn't showing up on my system and the build cluster which builds official packages.

Thanks!
Comment 7 commit-hook freebsd_committer 2015-02-09 20:44:16 UTC
A commit references this bug:

Author: madpilot
Date: Mon Feb  9 20:44:14 UTC 2015
New revision: 378753
URL: https://svnweb.freebsd.org/changeset/ports/378753

Log:
  Avoid a build error with clang on certain configurations.

  PR:		197405
  Submitted by:	Kevin Zheng <kevinz5000@gmail.com>

Changes:
  head/multimedia/libva/Makefile
Comment 8 Guido Falsi freebsd_committer 2015-02-09 20:44:36 UTC
Committed. Thanks!
Comment 9 Kevin Zheng 2015-02-09 22:38:23 UTC
(In reply to Guido Falsi from comment #6)

I'm not sure; I only started seeing this problem after updating my jails to 10.1-RELEASE-p5 via `poudriere jail -u` (but I didn't try the build before).

I don't have any custom CFLAGS set; my poudriere 'make.conf' is in the build log. I'm as baffled as well.

On a somewhat more positive (perhaps not?) I'm seeing the same problem with graphics/dri and graphics/libglapi, both which include the problematic 'isystem' flag from 'graphics/libGL/bsd.mesalib.mk'. I plan to file a PR on this later, but haven't gotten around to this.

Thanks for testing and committing the change.