diff options
author | Stephen Warren <swarren@nvidia.com> | 2013-02-12 17:03:37 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2013-02-13 05:12:10 -0500 |
commit | e570d7c15a73f88942885881a84257a65fa44c80 (patch) | |
tree | dc4a93d347d6546b4122ddd0d2b85bf6f1655edd /scripts/Makefile.lib | |
parent | e80beb27d2f81a1c3c8887e0e0a82d77bb392d28 (diff) |
kbuild: limit dtc+cpp include path
Device tree source files may now include header files. The intent is
that those header files define/name constants used as part of the DT
bindings. Currently this feature is open to abuse, since any kernel
header file at all can be included, This could allow device tree files
to become dependant on kernel headers files, and thus make them no
longer OS-independent. This would also prevent separating the device
tree source files from the kernel repository.
Solve this by limiting the cpp include path for device tree files to
separate directories.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r-- | scripts/Makefile.lib | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 7910229ec665..07125e697d7a 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -156,6 +156,11 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ | |||
156 | 156 | ||
157 | ld_flags = $(LDFLAGS) $(ldflags-y) | 157 | ld_flags = $(LDFLAGS) $(ldflags-y) |
158 | 158 | ||
159 | dtc_cpp_flags = -Wp,-MD,$(depfile) -nostdinc \ | ||
160 | -I$(srctree)/arch/$(SRCARCH)/boot/dts \ | ||
161 | -I$(srctree)/arch/$(SRCARCH)/include/dts \ | ||
162 | -undef -D__DTS__ | ||
163 | |||
159 | # Finds the multi-part object the current object will be linked into | 164 | # Finds the multi-part object the current object will be linked into |
160 | modname-multi = $(sort $(foreach m,$(multi-used),\ | 165 | modname-multi = $(sort $(foreach m,$(multi-used),\ |
161 | $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=)))) | 166 | $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=)))) |
@@ -272,8 +277,7 @@ $(obj)/%.dtb: $(src)/%.dts FORCE | |||
272 | dtc-tmp = $(subst $(comma),_,$(dot-target).dts) | 277 | dtc-tmp = $(subst $(comma),_,$(dot-target).dts) |
273 | 278 | ||
274 | quiet_cmd_dtc_cpp = DTC+CPP $@ | 279 | quiet_cmd_dtc_cpp = DTC+CPP $@ |
275 | cmd_dtc_cpp = $(CPP) $(cpp_flags) -x assembler-with-cpp -undef -D__DTS__ \ | 280 | cmd_dtc_cpp = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ |
276 | -o $(dtc-tmp) $< ; \ | ||
277 | $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $(dtc-tmp) | 281 | $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $(dtc-tmp) |
278 | 282 | ||
279 | $(obj)/%.dtb: $(src)/%.dtsp FORCE | 283 | $(obj)/%.dtb: $(src)/%.dtsp FORCE |