diff options
author | Tom Hughes <tomhughes@chromium.org> | 2019-02-13 16:14:26 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-10-25 18:03:13 +0000 |
commit | 03874334eac1b2bf77e33ea60a6587e6801faf6a (patch) | |
tree | 112b634a7489b6358c8ed9e92f44b367784c046d /Makefile.rules | |
parent | 3610a23adb72eac769e1f819604fce8fb8822b5b (diff) | |
download | chrome-ec-03874334eac1b2bf77e33ea60a6587e6801faf6a.tar.gz |
Add support for building dartmonkey firmware with clang
By default all builds will use gcc. To build with clang, set
the environment variable CC=clang.
At this point only dartmonkey has been tested with clang.
BRANCH=none
BUG=b:172020503
TEST=Using icetower, Segger J-Trace, and servo micro:
make BOARD=dartmonkey -j
./flash_jlink.py -b dartmonkey -i ./build/dartmonkey/ec.bin
--remote 127.0.0.1:2551
=> console on icetower works
TEST=CC=clang make BOARD=dartmonkey -j
./flash_jlink.py -b dartmonkey -i ./build/dartmonkey/ec.bin
--remote 127.0.0.1:2551
=> console on icetower works
TEST=make buildall -j
TEST=CC=clang make BOARD=dartmonkey tests -j
TEST=make BOARD=dartmonkey tests -j
TEST=./util/compare_build.sh -b all -j 120
=> MATCH
Change-Id: Ib7c067d0ebe0561becfd70373216adb445501f94
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1474577
Reviewed-by: Eric Yilun Lin <yllin@google.com>
Diffstat (limited to 'Makefile.rules')
-rw-r--r-- | Makefile.rules | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile.rules b/Makefile.rules index 42afb26e6f..91182a3a58 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -87,7 +87,10 @@ cmd_bin_to_hex = $(OBJCOPY) -I binary -O ihex \ --change-addresses $(_program_memory_base) $^ $@ cmd_smap = $(NM) $< | sort > $@ cmd_elf = $(CC) $(objs) $(libsharedobjs_elf-y) $(LDFLAGS) \ - -o $@ -Wl,-T,$< -Wl,-Map,$(patsubst %.elf,%.map,$@) -flto-partition=one + -o $@ -Wl,-T,$< -Wl,-Map,$(patsubst %.elf,%.map,$@) +ifeq ($(cc-name),gcc) +cmd_elf+= -flto-partition=one +endif cmd_fuzz_exe = $(CXX) $^ $(HOST_TEST_LDFLAGS) $(LDFLAGS_EXTRA) -o $@ cmd_run_fuzz = build/host/$*/$*.exe -seed=1 -runs=1 $(silent) \ $(silent_err) || (echo "Test $* failed!" && false) |