summaryrefslogtreecommitdiff
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-05-16 17:58:36 +0200
commit8800eb0ba29fe56855e3d521387635fc3aebd515 (patch)
tree9359d8ba7847daa3b75cda4671e2838d4ab3e6e0
parent88f328efd2d92f02c6a680872263227d3ac95f8d (diff)
downloadefl-devs/stefan/reproducible-edj-T5113.tar.gz
edje: make the generated default program name reproducible over buildsdevs/stefan/reproducible-edj-T5113
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. Ref T5113
-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 a3f5ddd15e..cd6b353b72 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -14608,14 +14608,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_") + sizeof(unsigned int) + 1);
+ sprintf(def_name, "program_%i", 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 94c994a9a7..9c0186158a 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -1087,6 +1087,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 */