diff --git a/Makefile b/Makefile index d0b18c9d981c535da105170dcc6149351adc121e..e1a350118f69632f0a4db36de0d5982c0ead4a0c 100644 --- a/Makefile +++ b/Makefile @@ -353,8 +353,11 @@ $(BUILD_DIR) : $(ELF) : $(OBJS) $(LINKERFILE) @echo " LD $$@" + @echo 'const char build_message[] = "Built : "__TIME__", "__DATE__;' | \ + $$(CC) $$(CFLAGS) -xc - -o $(BUILD_DIR)/build_message.o $$(Q)$$(LD) -o $$@ $$(LDFLAGS) -Map=$(MAPFILE) --script $(LINKERFILE) \ - --entry=$(BL$(1)_ENTRY_POINT) $(OBJS) + --entry=$(BL$(1)_ENTRY_POINT) $(OBJS) \ + $(BUILD_DIR)/build_message.o $(DUMP) : $(ELF) @echo " OD $$@" diff --git a/bl1/bl1_main.c b/bl1/bl1_main.c index b3adc251414f79544338d729b25a109053e8cd6f..401a525bf337f32ba43f891672fdeadcf23ad5c4 100644 --- a/bl1/bl1_main.c +++ b/bl1/bl1_main.c @@ -70,7 +70,7 @@ void bl1_main(void) /* Announce our arrival */ printf(FIRMWARE_WELCOME_STR); - printf("Built : %s, %s\n\r", __TIME__, __DATE__); + printf("%s\n\r", build_message); /* * Find out how much free trusted ram remains after BL1 load diff --git a/bl2/bl2_main.c b/bl2/bl2_main.c index 74952dafafaa1388b9ea6b0fafdf685c4b85fdd0..1deebc83526f5e0d7ce9a4cd67fdf46d18231dd6 100644 --- a/bl2/bl2_main.c +++ b/bl2/bl2_main.c @@ -58,9 +58,7 @@ void bl2_main(void) /* Perform platform setup in BL1 */ bl2_platform_setup(); -#if defined(__GNUC__) - printf("BL2 Built : %s, %s\n\r", __TIME__, __DATE__); -#endif + printf("BL2 %s\n\r", build_message); /* Find out how much free trusted ram remains after BL2 load */ bl2_tzram_layout = bl2_plat_sec_mem_layout(); diff --git a/bl31/bl31_main.c b/bl31/bl31_main.c index 82449f5ea1ac3f73da5a8b6711f6f299f7eb91cb..536bb864c5e7325f68242ad24c44a6b17cfc17de 100644 --- a/bl31/bl31_main.c +++ b/bl31/bl31_main.c @@ -83,9 +83,8 @@ void bl31_main(void) /* Perform platform setup in BL1 */ bl31_platform_setup(); -#if defined (__GNUC__) - printf("BL31 Built : %s, %s\n\r", __TIME__, __DATE__); -#endif + printf("BL31 %s\n\r", build_message); + /* Initialise helper libraries */ bl31_lib_init(); diff --git a/bl32/tsp/tsp_main.c b/bl32/tsp/tsp_main.c index 05907f5c85403d74b735d6aa192f912487cb2602..366aef09a22af349461f32ba1baaea8d7c712da5 100644 --- a/bl32/tsp/tsp_main.c +++ b/bl32/tsp/tsp_main.c @@ -121,9 +121,7 @@ uint64_t tsp_main(void) tsp_stats[linear_id].cpu_on_count++; spin_lock(&console_lock); -#if defined (__GNUC__) - printf("TSP Built : %s, %s\n\r", __TIME__, __DATE__); -#endif + printf("TSP %s\n\r", build_message); INFO("Total memory base : 0x%x\n", mem_layout->total_base); INFO("Total memory size : 0x%x bytes\n", mem_layout->total_size); INFO("Free memory base : 0x%x\n", mem_layout->free_base); diff --git a/include/bl_common.h b/include/bl_common.h index aad3d22c2a372b8fdaa4a1f78a10b5c9ca421126..8139282b010ec82cdae98b2601118729c0f9e63b 100644 --- a/include/bl_common.h +++ b/include/bl_common.h @@ -140,6 +140,7 @@ extern void __dead2 run_image(unsigned long entrypoint, void *first_arg, void *second_arg); extern unsigned long *get_el_change_mem_ptr(void); +extern const char build_message[]; #endif /*__ASSEMBLY__*/