Commit 39a97dce authored by Joshua Watt's avatar Joshua Watt
Browse files

rockchip: Prevent macro expansion in paths



Instead of stringizing the paths to binary files, add them as string
defines on the command line (e.g. -DFOO=\"BAR\" instead of -DFOO=BAR).
This prevents macros from being expanded inside the string value itself.
For example, -DFOO=/path/with-linux-in-it would have been expanded to
"/path/with-1-in-it" because `linux=1` is one of the standard GCC
defines.

Change-Id: I7b65df3c9930faed4f1aff75ad726982ae3671e6
Signed-off-by: default avatarJoshua Watt <JPEWhacker@gmail.com>
parent 1a433965
...@@ -18,7 +18,7 @@ __asm__( ...@@ -18,7 +18,7 @@ __asm__(
".global hdcp_handler\n" ".global hdcp_handler\n"
".balign 4\n" ".balign 4\n"
"hdcp_handler:\n" "hdcp_handler:\n"
".incbin \"" __XSTRING(HDCPFW) "\"\n" ".incbin \"" HDCPFW "\"\n"
".type hdcp_handler, %function\n" ".type hdcp_handler, %function\n"
".size hdcp_handler, .- hdcp_handler\n" ".size hdcp_handler, .- hdcp_handler\n"
".popsection\n" ".popsection\n"
......
...@@ -5,20 +5,18 @@ ...@@ -5,20 +5,18 @@
*/ */
/* convoluted way to make sure that the define is pasted just the right way */ /* convoluted way to make sure that the define is pasted just the right way */
#define _INCBIN(file, sym, sec) \ #define INCBIN(file, sym, sec) \
__asm__( \ __asm__( \
".section " #sec "\n" \ ".section " sec "\n" \
".global " #sym "\n" \ ".global " sym "\n" \
".type " #sym ", %object\n" \ ".type " sym ", %object\n" \
".align 4\n" \ ".align 4\n" \
#sym ":\n" \ sym ":\n" \
".incbin \"" #file "\"\n" \ ".incbin \"" file "\"\n" \
".size " #sym ", .-" #sym "\n" \ ".size " sym ", .-" sym "\n" \
".global " #sym "_end\n" \ ".global " sym "_end\n" \
#sym "_end:\n" \ sym "_end:\n" \
) )
#define INCBIN(file, sym, sec) _INCBIN(file, sym, sec) INCBIN(RK3399M0FW, "rk3399m0_bin", ".sram.incbin");
INCBIN(RK3399M0PMUFW, "rk3399m0pmu_bin", ".pmusram.incbin");
INCBIN(RK3399M0FW, rk3399m0_bin, ".sram.incbin");
INCBIN(RK3399M0PMUFW, rk3399m0pmu_bin, ".pmusram.incbin");
...@@ -82,13 +82,13 @@ PLAT_M0 := ${PLAT}m0 ...@@ -82,13 +82,13 @@ PLAT_M0 := ${PLAT}m0
BUILD_M0 := ${BUILD_PLAT}/m0 BUILD_M0 := ${BUILD_PLAT}/m0
RK3399M0FW=${BUILD_M0}/${PLAT_M0}.bin RK3399M0FW=${BUILD_M0}/${PLAT_M0}.bin
$(eval $(call add_define,RK3399M0FW)) $(eval $(call add_define_val,RK3399M0FW,\"$(RK3399M0FW)\"))
RK3399M0PMUFW=${BUILD_M0}/${PLAT_M0}pmu.bin RK3399M0PMUFW=${BUILD_M0}/${PLAT_M0}pmu.bin
$(eval $(call add_define,RK3399M0PMUFW)) $(eval $(call add_define_val,RK3399M0PMUFW,\"$(RK3399M0PMUFW)\"))
HDCPFW=${RK_PLAT_SOC}/drivers/dp/hdcp.bin HDCPFW=${RK_PLAT_SOC}/drivers/dp/hdcp.bin
$(eval $(call add_define,HDCPFW)) $(eval $(call add_define_val,HDCPFW,\"$(HDCPFW)\"))
# CCACHE_EXTRAFILES is needed because ccache doesn't handle .incbin # CCACHE_EXTRAFILES is needed because ccache doesn't handle .incbin
export CCACHE_EXTRAFILES export CCACHE_EXTRAFILES
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment