On 11/11/26 15:12, Michael Tokarev wrote:
Currently the linux-user vdso*.so files are not reproducible,
because for one, the binaries embed a random temporary file
name used by the compiler during compilation, such as ccuckKYd.o.

At the very least, use -pipe to avoid the need to have a temp
file in the first place - this makes the build repeatable.

--- a/linux-user/aarch64/Makefile.vdso
+++ b/linux-user/aarch64/Makefile.vdso
@@ -3,6 +3,8 @@ include $(BUILD_DIR)/linux-user/aarch64/config-target.mak
  SUBDIR = $(SRC_PATH)/linux-user/aarch64
  VPATH += $(SUBDIR)
+REPRODUCIBLE = -pipe
+
  all: $(SUBDIR)/vdso-be.so $(SUBDIR)/vdso-le.so
LDFLAGS = -nostdlib -shared -Wl,-h,linux-vdso.so.1 \
@@ -10,7 +12,7 @@ LDFLAGS = -nostdlib -shared -Wl,-h,linux-vdso.so.1 \
          -Wl,-z,max-page-size=4096 -Wl,-T,$(SUBDIR)/vdso.ld
$(SUBDIR)/vdso-be.so: vdso.S vdso.ld
-       $(CC) -o $@ $(LDFLAGS) -mbig-endian $<
+       $(CC) $(REPRODUCIBLE) -o $@ $(LDFLAGS) -mbig-endian $<
Unfortunately this doesn't work anyway.  I dunno why but apparently
some gcc versions ignore -pipe and still use a random file in /tmp.

Besides, it is still too gcc-version-specific - for example, a more
recent gcc generates additional sections in the resulting binary -
.ARM.attributes, and even symbol referencs - aeabi_feature_and_bits.

Sigh.

Thanks,

/mjt

Reply via email to