diff options
author | Tom Hughes <tomhughes@chromium.org> | 2019-02-12 16:41:00 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-10 22:01:58 +0000 |
commit | f824e2abc5763fb9aaa5d0e17a9d2f29223138b5 (patch) | |
tree | 80a5a24d1ef1c23a462a6ed95f15268dbdc09512 | |
parent | 2e6849807f2a9c7a1a8f963a90df5fb732ac4f20 (diff) | |
download | chrome-ec-f824e2abc5763fb9aaa5d0e17a9d2f29223138b5.tar.gz |
Makefile.rules: use CFLAGS instead of CPPFLAGS
CPPFLAGS are flags for the preprocessor, not the C compiler.
clang warns when linking that we don't have the blx instruction:
lld.real: warning: lld uses blx instruction, no object with architecture
supporting feature detected
but this is because the linker command was not being passed the correct
architecture because it was missing the CFLAGS that specified them:
Before:
"/usr/bin/clang-8" -cc1as -triple armv4t-none-unknown-eabi
After:
"/usr/bin/clang-8" -cc1as -triple thumbv7em-none-unknown-eabi
BRANCH=nocturne,nami
BUG=chromium:931797
TEST=make buildall -j
TEST=revert change
rm -rf build && make buildall -j | grep 'bytes in flash and' | \
| sort > build.before
=> apply change
rm -rf build && make buildall -j | grep 'bytes in flash and' | \
| sort > build.after
diff build.before build.after
=> no difference
Change-Id: I6401b60fa3721c441df126f69634a13d6c7c06fe
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1470781
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r-- | Makefile.rules | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile.rules b/Makefile.rules index c003b06c34..0976fe6402 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -58,7 +58,7 @@ cmd_lds = $(CPP) -P -C -MMD -MF $@.d -MT $@ $(CPPFLAGS) $< -o $@ cmd_lds_b = $(cmd_lds) -DRW_B_LDS=$(EMPTY) # Allow obj_to_bin to be overridden by board or chip specific commands cmd_obj_to_bin ?= $(OBJCOPY) --gap-fill=0xff -O binary $^ $(out)/$*.bin.tmp -cmd_flat_to_obj = $(CC) -Wl,-T $(out)/firmware_image.lds -nostdlib $(CPPFLAGS) \ +cmd_flat_to_obj = $(CC) -Wl,-T $(out)/firmware_image.lds -nostdlib $(CFLAGS) \ -Wl,--build-id=none -o $@ $< # Allow the .roshared section to overlap other sections (itself) cmd_ec_elf_to_flat ?= $(OBJCOPY) --set-section-flags .roshared=share -R .dram* \ |