[vlc-devel] [PATCH v2 02/13] contrib: share the environment to use to build native tools
Rémi Denis-Courmont
remi at remlab.net
Tue Mar 24 17:16:38 CET 2020
Le tiistaina 24. maaliskuuta 2020, 17.55.48 EET Steve Lhomme a écrit :
> On 2020-03-24 16:42, Rémi Denis-Courmont wrote:
> > Le tiistaina 24. maaliskuuta 2020, 16.46.20 EET Steve Lhomme a écrit :
> >> Unset the main environment variables that may affect basic
> >> compilation/linking.
> >>
> >> When not cross-compiling we use the same environment as the rest of the
> >> compiled contribs.
> >> ---
> >>
> >> contrib/src/main.mak | 9 +++++++++
> >> 1 file changed, 9 insertions(+)
> >>
> >> diff --git a/contrib/src/main.mak b/contrib/src/main.mak
> >> index 708885cdec..7105dc508a 100644
> >> --- a/contrib/src/main.mak
> >> +++ b/contrib/src/main.mak
> >> @@ -338,6 +338,15 @@ HOSTVARS_PIC := $(HOSTTOOLS) \
> >>
> >> CXXFLAGS="$(CXXFLAGS) $(PIC)" \
> >> LDFLAGS="$(LDFLAGS)"
> >>
> >> +# environment to use to build native programs (build, ie not the host)
> >> +ifdef HAVE_CROSS_COMPILE
> >> +BUILDVARS := env -u CC -u CFLAGS -u CPPFLAGS -u CXX -u CXXFLAGS -u LD -u
> >> LDFLAGS -u AR -u CCAS -u RANLIB -u STRIP +BUILDCONF :=
> >> --prefix="$(BUILDPREFIX)" --build="$(BUILD)" --host="$(BUILD)"
> >> --target="$(HOST)" +else
> >> +BUILDVARS := $(HOSTVARS)
> >> +BUILDCONF := $(HOSTCONF)
> >> +endif
> >> +
> >
> > This is rather dubious. Why do we use defaults in cross-builds, but
> > bootstrap in native builds? I don't see why we would want to debug the
> > cross tools any more or less (we probably don't want to debug them).
>
> The default compiler might be gcc but for some reason the user want to
> build its native contribs with clang and some extra flags (maybe even
> sanitizers).
So what? The same problem exists for cross compilation.
There's no justifications for treating them differently. And indeed, we *don't*
do that distinction in the main build system (just use the default).
--
Реми Дёни-Курмон
http://www.remlab.net/
More information about the vlc-devel
mailing list