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.
Auto-assigned to maintainer madpilot@FreeBSD.org
Created attachment 152701 [details]
Poudriere build log from port BEFORE patch was applied
Created attachment 152702 [details]
Poudriere build log from port AFTER patch was applied
(In reply to Kevin Zheng from comment #0)
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?
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).
(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.
A commit references this bug:
Date: Mon Feb 9 20:44:14 UTC 2015
New revision: 378753
Avoid a build error with clang on certain configurations.
Submitted by: Kevin Zheng <email@example.com>
(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.