Bug 182682 - www/chromium : fix build with clang and GNU ar
Summary: www/chromium : fix build with clang and GNU ar
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-chromium mailing list
Depends on:
Reported: 2013-10-05 13:20 UTC by Christoph Moench-Tegeder
Modified: 2013-10-14 13:20 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Moench-Tegeder freebsd_committer 2013-10-05 13:20:00 UTC
	The chromium build picks up ar from PATH, which happens to have
    $LOCALBASE/bin/ listed before /usr/bin/ (no surprise so far).
    ld from clang does not like GNU ar files, so building with GCC=off
    fails with
: /usr/bin/ld:obj/third_party/ffmpeg/libffmpeg_yasm.a: file format not recognized; treating as linker script
: /usr/bin/ld:obj/third_party/ffmpeg/libffmpeg_yasm.a:1: syntax error
: clang++: error: linker command failed with exit code 1 (use -v to see invocation)
: [1576/11978] ACTION Generating resources from app/generated_resources.grd
: ninja: build stopped: subcommand failed.
: *** [do-build] Error code 1

    This does not happen when using gcc instead of clang.

Fix: when using clang as compiler (GCC=off), force the use of base ar via
	CONFIGURE_ENV ("works for me"):

Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

Index: Makefile
--- Makefile	(revision 329444)
+++ Makefile	(working copy)
@@ -139,6 +139,7 @@
 GYP_DEFINES+=	clang=1
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-clang
+CONFIGURE_ENV+= AR=/usr/bin/ar
 .if ${OSVERSION} >= 1000054
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-libc++
How-To-Repeat: 	just type make...
Comment 1 Edwin Groothuis freebsd_committer 2013-10-05 13:20:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-chromium

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2013-10-14 13:11:31 UTC
Author: rene
Date: Mon Oct 14 12:11:22 2013
New Revision: 330311
URL: http://svnweb.freebsd.org/changeset/ports/330311

  Allow building with clang when GNU ar (from devel/binutils) is installed
  and LOCALBASE/bin comes before /usr/bin in $PATH
  PR:		ports/182682
  Submitted by:	Christoph Moench-Tegeder <cmt@burggraben.net>


Modified: head/www/chromium/Makefile
--- head/www/chromium/Makefile	Mon Oct 14 12:10:40 2013	(r330310)
+++ head/www/chromium/Makefile	Mon Oct 14 12:11:22 2013	(r330311)
@@ -140,6 +140,7 @@ CXX=		clang++
 GYP_DEFINES+=	clang=1
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-clang
+CONFIGURE_ENV+=	AR=/usr/bin/ar
 .if ${OSVERSION} >= 1000052 && !exists(${LOCALBASE}/include/execinfo.h)
svn-ports-all@freebsd.org mailing list
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Rene Ladan freebsd_committer 2013-10-14 13:11:43 UTC
State Changed
From-To: open->closed

Committed, thanks!
Comment 4 fullermd 2013-10-14 13:11:49 UTC
The better solution is probably to override AR directly, not just
fiddle it in CONFIGURE_ENV.  I've been banging into this error, and I
can successfully build by setting it on the command line: i.e.,

% make AR=/usr/bin/ar