summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@osg.samsung.com>2017-05-16 17:58:36 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2017-08-07 14:35:32 +0200
commit4d2117ef2a5344d298dfa7768d01feab0cf86558 (patch)
tree9577a21c1cac481c957ba1c7619d18acd0a6f83d /src
parent3adf2ebddf0c4668f6a51593cf00f7c2f5c117d1 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/bin/edje/edje_cc_handlers.c5
-rw-r--r--src/lib/edje/edje_private.h1
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 43c292f1d7..909b0e153b 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)
14666 epp->can_override = EINA_FALSE; 14666 epp->can_override = EINA_FALSE;
14667 14667
14668 /* generate new name */ 14668 /* generate new name */
14669 def_name = alloca(strlen("program_") + strlen("0xFFFFFFFFFFFFFFFF") + 1); 14669 def_name = alloca(strlen("program_") + strlen("FFFFFFFFFFFFFFFF") + 1);
14670 sprintf(def_name, "program_%p", ep); 14670 sprintf(def_name, "program_%X", pc->programs.total_count);
14671 ep->name = strdup(def_name); 14671 ep->name = strdup(def_name);
14672 if (pcp->default_source) 14672 if (pcp->default_source)
14673 ep->source = strdup(pcp->default_source); 14673 ep->source = strdup(pcp->default_source);
14674 _edje_program_insert(pc, ep); 14674 _edje_program_insert(pc, ep);
14675 14675
14676 current_program = ep; 14676 current_program = ep;
14677 pc->programs.total_count++;
14677} 14678}
14678 14679
14679static void 14680static void
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index a4a334ccc0..3c9916a35d 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -1096,6 +1096,7 @@ struct _Edje_Part_Collection
1096 unsigned int strncmp_count; 1096 unsigned int strncmp_count;
1097 unsigned int strrncmp_count; 1097 unsigned int strrncmp_count;
1098 unsigned int nocmp_count; 1098 unsigned int nocmp_count;
1099 unsigned int total_count;
1099 } programs; 1100 } programs;
1100 1101
1101 struct { /* list of limit that need to be monitored */ 1102 struct { /* list of limit that need to be monitored */