From 4d2117ef2a5344d298dfa7768d01feab0cf86558 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Tue, 16 May 2017 17:58:36 +0200 Subject: [PATCH] edje: make the generated default program name reproducible over builds For programs without specific names edje_cc generated default names in the form of program_$MEMORY_ADDRESS. That worked well enough for keeping the names unique, but it causes problems if one wants to have these files being binary reproducible due to different memory layouts, compilers, etc. Simply using a counter as unique part should work well enough for our use case and help people who want to verify builds. Thanks a lot to Bernhard M. Wiedemann for review and testing. Fixes T5113 Ref T5495 --- src/bin/edje/edje_cc_handlers.c | 5 +++-- src/lib/edje/edje_private.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 43c292f..909b0e1 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -14666,14 +14666,15 @@ ob_collections_group_programs_program(void) epp->can_override = EINA_FALSE; /* generate new name */ - def_name = alloca(strlen("program_") + strlen("0xFFFFFFFFFFFFFFFF") + 1); - sprintf(def_name, "program_%p", ep); + def_name = alloca(strlen("program_") + strlen("FFFFFFFFFFFFFFFF") + 1); + sprintf(def_name, "program_%X", pc->programs.total_count); ep->name = strdup(def_name); if (pcp->default_source) ep->source = strdup(pcp->default_source); _edje_program_insert(pc, ep); current_program = ep; + pc->programs.total_count++; } static void diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index a4a334c..3c9916a 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -1096,6 +1096,7 @@ struct _Edje_Part_Collection unsigned int strncmp_count; unsigned int strrncmp_count; unsigned int nocmp_count; + unsigned int total_count; } programs; struct { /* list of limit that need to be monitored */ -- 2.7.4