Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Mar 2014 16:46:52 +0400
From:      Dmitry Marakasov <amdmi3@amdmi3.ru>
To:        Dimitry Andric <dim@FreeBSD.org>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: HEAD clang failures due to unknown arguments
Message-ID:  <20140329124652.GH73879@hades.panopticon>
In-Reply-To: <73F477CA-6AF4-4217-AC81-730A5DED11D5@FreeBSD.org>
References:  <20140329044342.GG73879@hades.panopticon> <73F477CA-6AF4-4217-AC81-730A5DED11D5@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Dimitry Andric (dim@FreeBSD.org) wrote:

> > Are we to fix new clang failures related to that clang now treats
> > unknown arguments as fatal errors:
> > 
> > ---
> > c++: error: unknown argument: '-R/usr/local/lib'
> > ---
> 
> Yes, just replace -R/usr/local/lib with -Wl,-rpath,/usr/local/lib.  This
> is very easy to do with sed.

I've just removed them and it worked. Or is there a reason for rpath to
system lib directory?

What about other keys? I've also encountered -fwhole-program and
-malign-double

What I plan to do is:

---
USES+=	compiler:env

.include <bsd.port.pre.mk>

post-patch:
.if ${COMPILER_TYPE} == "clang"
	@${REINPLACE_CMD} -e 's|-fwhole-program||' ${WRKSRC}/CMakeLists.txt
.endif
---

but what if next version of clang learns of this key? I'd like to have
something like

.if ! ${COMPILER_SUPPORTED_ARGUMENTS:M-fwhole-program}
	@${REINPLACE_CMD} -e 's|-fwhole-program||' ${WRKSRC}/CMakeLists.txt
.endif

.if ${COMPILER_SUPPORTED_ARGUMENTS:M-malign-double}
CXXFLAGS+=	-malign-double
.endif

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140329124652.GH73879>