Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ HelenOS.config	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -605,4 +605,7 @@
 ! CONFIG_STRIP_BINARIES (n/y)
 
+% Strip revision information (helpful when comparing outputs)
+! CONFIG_STRIP_REVISION_INFO (n/y)
+
 % Optimization level
 @ "3" Level 3 (recommended).
Index: boot/Makefile.build
===================================================================
--- boot/Makefile.build	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ boot/Makefile.build	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -46,5 +46,6 @@
 COMMON_CFLAGS = $(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
 	-ffreestanding -fno-builtin -nostdlib -nostdinc \
-	-fexec-charset=UTF-8 -finput-charset=UTF-8 -fno-common
+	-fexec-charset=UTF-8 -finput-charset=UTF-8 -fno-common \
+	-fdebug-prefix-map=$(realpath $(ROOT_PATH))=.
 
 GCC_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ kernel/Makefile	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -84,5 +84,6 @@
 COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
 	-ffreestanding -fno-builtin -nostdlib -nostdinc \
-	-fexec-charset=UTF-8 -finput-charset=UTF-8 -fno-common
+	-fexec-charset=UTF-8 -finput-charset=UTF-8 -fno-common \
+	-fdebug-prefix-map=$(realpath $(ROOT_PATH))=.
 
 GCC_CFLAGS = -std=gnu99 -Wall -Wextra -Wno-unused-parameter \
Index: tools/config.py
===================================================================
--- tools/config.py	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ tools/config.py	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -445,6 +445,14 @@
 def create_output(mkname, mcname, config, rules):
 	"Create output configuration"
-
-	timestamp_unix = int(time.time())
+	
+	varname_strip = 'CONFIG_STRIP_REVISION_INFO'
+	strip_rev_info = (varname_strip in config) and (config[varname_strip] == 'y')
+	
+	if strip_rev_info:
+		timestamp_unix = int(0)
+	else:
+		# TODO: Use commit timestamp instead of build time.
+		timestamp_unix = int(time.time())
+	
 	timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(timestamp_unix))
 	
@@ -458,5 +466,5 @@
 		sys.stderr.write("failed\n")
 	
-	if len(version) == 3:
+	if (not strip_rev_info) and (len(version) == 3):
 		revision = version[1]
 		if version[0] != 1:
Index: tools/mkarray.py
===================================================================
--- tools/mkarray.py	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ tools/mkarray.py	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -70,4 +70,6 @@
 	section = sys.argv[4]
 	
+	timestamp = (1980, 1, 1, 0, 0, 0)
+	
 	header_ctx = []
 	desc_ctx = []
@@ -79,5 +81,5 @@
 	archive = zipfile.ZipFile("%s.zip" % dest, "w", zipfile.ZIP_STORED)
 	
-	for src in sys.argv[5:]:
+	for src in sorted(sys.argv[5:]):
 		basename = os.path.basename(src)
 		plainname = os.path.splitext(basename)[0]
@@ -95,5 +97,6 @@
 			src_data = deflate(src_data)
 			src_fname = os.path.basename("%s.deflate" % src)
-			archive.writestr(src_fname, src_data)
+			zipinfo = zipfile.ZipInfo(src_fname, timestamp)
+			archive.writestr(zipinfo, src_data)
 		else:
 			src_fname = src
@@ -155,5 +158,6 @@
 	data += "\n\n"
 	data += "#endif\n"
-	archive.writestr("%s.h" % dest, data)
+	zipinfo = zipfile.ZipInfo("%s.h" % dest, timestamp)
+	archive.writestr(zipinfo, data)
 	
 	data = ''
@@ -166,5 +170,6 @@
 	data += "\n".join(data_ctx)
 	data += "\n"
-	archive.writestr("%s.s" % dest, data)
+	zipinfo = zipfile.ZipInfo("%s.s" % dest, timestamp)
+	archive.writestr(zipinfo, data)
 	
 	data = ''
@@ -180,5 +185,6 @@
 	data += "\n".join(size_ctx)
 	data += "\n"
-	archive.writestr("%s_desc.c" % dest, data)
+	zipinfo = zipfile.ZipInfo("%s_desc.c" % dest, timestamp)
+	archive.writestr(zipinfo, data)
 	
 	archive.close()
Index: uspace/Makefile.common
===================================================================
--- uspace/Makefile.common	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ uspace/Makefile.common	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -110,4 +110,6 @@
 LIBSOFTINT_PREFIX = $(LIB_PREFIX)/softint
 
+STARTUP = $(LIBC_PREFIX)/arch/$(UARCH)/src/entry.o
+
 LIBMATH_PREFIX = $(LIB_PREFIX)/math
 LIBMATH_INCLUDES_FLAGS = \
@@ -234,5 +236,6 @@
 COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
 	-ffreestanding -fno-builtin -nostdlib -nostdinc -fexec-charset=UTF-8 \
-	-finput-charset=UTF-8 -D__$(ENDIANESS)__ -fno-common
+	-finput-charset=UTF-8 -D__$(ENDIANESS)__ -fno-common \
+	-fdebug-prefix-map=$(realpath $(ROOT_PATH))=.
 
 GCC_CFLAGS = -ffunction-sections -Wall -Wextra -Wno-clobbered \
@@ -301,5 +304,5 @@
 
 $(BINARY): $(LINKER_SCRIPT) $(OBJECTS) $(LIBS) $(BASE_LIBS)
-	$(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(BINARY).map -o $(BINARY) $(OBJECTS) $(LIBS) $(BASE_LIBS)
+	$(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(BINARY).map -o $(BINARY) $(STARTUP) $(OBJECTS) $(LIBS) $(BASE_LIBS)
 ifeq ($(CONFIG_STRIP_BINARIES),y)
 	$(STRIP) $(BINARY)
@@ -337,5 +340,5 @@
 ifneq ($(TEST_OUTPUT),)
 $(TEST_OUTPUT): $(LINKER_SCRIPT) $(TEST_OBJECTS) $(TEST_OUTPUT_LIBS)
-	$(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(TEST_OUTPUT).map -o $@ $(TEST_OBJECTS) $(TEST_OUTPUT_LIBS) $(LIBS) $(BASE_LIBS)
+	$(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(TEST_OUTPUT).map -o $@ $(STARTUP) $(TEST_OBJECTS) $(TEST_OUTPUT_LIBS) $(LIBS) $(BASE_LIBS)
 ifeq ($(CONFIG_STRIP_BINARIES),y)
 	$(STRIP) $(TEST_OUTPUT)
Index: uspace/lib/c/arch/abs32le/_link.ld.in
===================================================================
--- uspace/lib/c/arch/abs32le/_link.ld.in	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ uspace/lib/c/arch/abs32le/_link.ld.in	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -1,3 +1,2 @@
-STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/c/arch/amd64/_link.ld.in
===================================================================
--- uspace/lib/c/arch/amd64/_link.ld.in	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ uspace/lib/c/arch/amd64/_link.ld.in	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -1,3 +1,2 @@
-STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/c/arch/arm32/_link.ld.in
===================================================================
--- uspace/lib/c/arch/arm32/_link.ld.in	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ uspace/lib/c/arch/arm32/_link.ld.in	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -1,3 +1,2 @@
-STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/c/arch/ia32/_link.ld.in
===================================================================
--- uspace/lib/c/arch/ia32/_link.ld.in	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ uspace/lib/c/arch/ia32/_link.ld.in	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -1,4 +1,3 @@
 #ifndef SHLIB
-STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 #endif
Index: uspace/lib/c/arch/ia64/_link.ld.in
===================================================================
--- uspace/lib/c/arch/ia64/_link.ld.in	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ uspace/lib/c/arch/ia64/_link.ld.in	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -1,3 +1,2 @@
-STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/c/arch/mips32/_link.ld.in
===================================================================
--- uspace/lib/c/arch/mips32/_link.ld.in	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ uspace/lib/c/arch/mips32/_link.ld.in	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -1,3 +1,2 @@
-STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/c/arch/ppc32/_link.ld.in
===================================================================
--- uspace/lib/c/arch/ppc32/_link.ld.in	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ uspace/lib/c/arch/ppc32/_link.ld.in	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -1,3 +1,2 @@
-STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/c/arch/riscv64/_link.ld.in
===================================================================
--- uspace/lib/c/arch/riscv64/_link.ld.in	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ uspace/lib/c/arch/riscv64/_link.ld.in	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -1,3 +1,2 @@
-STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/c/arch/sparc64/_link.ld.in
===================================================================
--- uspace/lib/c/arch/sparc64/_link.ld.in	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ uspace/lib/c/arch/sparc64/_link.ld.in	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -1,3 +1,2 @@
-STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/pcut/Makefile
===================================================================
--- uspace/lib/pcut/Makefile	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ uspace/lib/pcut/Makefile	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -36,4 +36,4 @@
 
 test-libpcut-%: $(OUTPUT)
-	$(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -o $@ $^ $(OUTPUT) $(BASE_LIBS)
+	$(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -o $@ $(STARTUP) $^ $(OUTPUT) $(BASE_LIBS)
 
Index: uspace/lib/pcut/update-from-master.sh
===================================================================
--- uspace/lib/pcut/update-from-master.sh	(revision 0798689015f6ea90e886a343e0eb42cff7ca5c2a)
+++ uspace/lib/pcut/update-from-master.sh	(revision 9b642f928e6f3106fa5085c544c08c91166ba0f3)
@@ -80,5 +80,5 @@
 
 test-libpcut-%: $(OUTPUT)
-	$(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -o $@ $^ $(OUTPUT) $(BASE_LIBS)
+	$(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -o $@ $(STARTUP) $^ $(OUTPUT) $(BASE_LIBS)
 
 EOF_MAKEFILE_TAIL
