Discussion:
[rust-dev] Build: Intended purpose of the CFLAGS environment variable
Cody P Schafer
2014-10-17 21:27:10 UTC
Permalink
Presently, I'm trying to crossbuild rust via yocto/openembedded, and
running into a lot of fun things.

One that's come up is how CFLAGS (and LDFLAGS, CPPFLAGS, and similar
generic flag variables) are used within the build process.

I initially noticed that CFLAGS was being used to build code for
target (not host) libraries (specifically jemalloc). My initial
reaction was to assume that we shouldn't be leaking CFLAGS into the
flags given to any target library builds.

However, looking at mk/platform.mk, it appears that $(CFLAGS) is being
explicitly included in the CFG_CFLAGS for some /but not all/ of the
targets listed there.

As a result I'm a bit confused.

Q: what is the intended use of CFLAGS in rust's configure/make
scripts? (Host only? Shared across all? Something else?)

Q: Why do some of the targets in mk/platform.mk not have (or have)
CFLAGS appended to their CFG_FLAGS? (examples of lacking: *-apple-ios,
x86_64-unknown-linux-gnu)

Loading...