Commit Graph

12 Commits

Author SHA1 Message Date
Ben Walker
1a56982da3 build: Make detect_cc.sh handle --cross-prefix
This internal tool can now be passed an optional --cross-prefix,
which sets up the prefix used for a cross compiler.

Change-Id: Ia4bbbae3bd5a2e4ddc9da342cd03d600e9ee6099
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463016
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-07-26 16:22:27 +00:00
Ben Walker
73439e6f46 build: Detect compiler toolchain in configure
We need to know this up front.

Change-Id: I3a9ceb90cf62eacbf3fdf518a9ccb4c4978b3a05
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463014
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-26 16:22:27 +00:00
Ben Walker
5a670e8e76 detect_cc: Handle empty arguments
When called from scripts, sometimes the arguments passed
will be empty.

Change-Id: I2f9fa1daa173eecc7b20928cd359284bb6f74ff3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/444278
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-02-19 06:39:10 +00:00
Konrad Sztyber
ea002f5068 build: use linker specified by the LD env variable
Modifed scripts/detect_cc.sh to take additional parameter specifing
the linker to use. Default to LLD on FreeBSD systems.

Change-Id: Idf97e9676a144028c0803d272ae6f0e903b0dd1f
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/438801
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-01-07 19:49:11 +00:00
Jim Harris
26731440ee build: use conditional CC/CXX assignment for generated mk/cc.mk
This ensures that if user specifies an alternate CC/CXX after
cc.mk was already generated, that the build will pick up the
difference, regenerate mk/cc.mk and trigger a rebuild.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I90c38c7b8eb09a5575c429769ba57f4e167fa4b0

Reviewed-on: https://review.gerrithub.io/399431
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-02-12 12:10:49 -05:00
Jim Harris
5d027b5b06 build: fix detect_cc.sh script for icc
icc -v prints out its version string like this:

icc version 18.0.1 (gcc version 5.0.0 compatibility)

detect_cc.sh gets confused and does this in the generated
mk/cc.mk:

CC_TYPE=icc
gcc

So fix detect_cc.sh to only use the first entry with head -1.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I44680ac83f165f8d4d8ef6448c0a7d7aa93b85e7

Reviewed-on: https://review.gerrithub.io/399262
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-02-12 12:09:21 -05:00
Jim Harris
54a5aba7ee detect_cc.sh: further fix CC_TYPE generation
FreeBSD clang prepends "FreeBSD" before clang in the
version string, so further fixes are needed.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7bfc37322483b97443985f1103ff753d1b18a87a
2017-05-11 16:45:24 -07:00
Daniel Verkamp
4325814761 scripts/detect_cc.sh: make C vs C++ warning non-fatal
Even if we detect that $CC and $CXX are different types, we should
continue so that mk/cc.mk is still generated.

Change-Id: I551e2d9149ea982d3c9973dfc5f2557f12fbc337
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-11 13:46:46 -07:00
Jim Harris
3510268bf7 detect_cc.sh: fix CC_TYPE generation
Some compilers will emit version info with a --with-pkgversion
parameter.  So grep for "version" with -w.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7bfc37322483b97443985f1103ff753d1b18a879
2017-05-11 10:22:08 -07:00
Daniel Verkamp
becdc9a73d scripts/detect_cc.sh: add CC_TYPE to mk/cc.mk
Change-Id: I5d627629d545c4d9fe366f638bbeb812bc3add95
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-10 13:46:08 -07:00
Daniel Verkamp
5d6509e008 scripts/detect_cc.sh: fix indentation
Use tabs consistently.

Change-Id: I4d50f553047105f0e0b4859a20e93d275494aff0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-10 13:44:23 -07:00
Daniel Verkamp
6d6d1161c7 build: add CONFIG_LTO to enable link-time optimization
Change-Id: I9546d715b8d2ca3ebf46183bdbaa58e8aa921d95
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-10 13:42:11 -07:00