reproductible builds: remove most install paths in c code

In order to speed up test bot work it would be helpful to check for
identical build outputs and skip tests if required.

This removes most use of the install path in c code:
 - ql_mpi uses /proc/self/exe and looks for talker/server in same
directory as itself
 - mcexec looks for libihk.so in /proc/self/maps and use that path for
LD_PRELOAD prefix path
 - rootfsdir is not used right now but until a better fix happens just
hardcode it, someone who wants to change it can set it through cmake

There is one last occurence of the install directory, MCEXEC_PATH in
mcctrl's binfmt code, for which the build system will just overwrite it
to a constant string at build time instead of trying to remove it too
hard. It would be possible to pass it as a kernel parameter or look for
mcexec in PATH but this is too much work for now.

Change-Id: I5d1352bc5748a1ea10dcae4be630f30a07609296
This commit is contained in:
Dominique Martinet
2019-03-01 15:30:39 +09:00
committed by Masamichi Takagi
parent a48a2cd3e8
commit b87ac8b8c0
5 changed files with 96 additions and 25 deletions

View File

@ -4,6 +4,8 @@ if(ARCH STREQUAL "x86_64")
set(ARCH_C_FLAGS "-mno-red-zone -mcmodel=kernel")
endif()
set(MCEXEC_PATH "${CMAKE_INSTALL_FULL_BINDIR}/mcexec" CACHE STRING "mcexec path for binfmt")
kmod(mcctrl
C_FLAGS
-I${IHK_FULL_SOURCE_DIR}/linux/include
@ -16,7 +18,7 @@ kmod(mcctrl
-I${CMAKE_CURRENT_SOURCE_DIR}/arch/${ARCH}/include
-I${PROJECT_BINARY_DIR}
-I${PROJECT_SOURCE_DIR}/kernel/include
-DMCEXEC_PATH=\\"${CMAKE_INSTALL_FULL_BINDIR}/mcexec\\"
-DMCEXEC_PATH=\\"${MCEXEC_PATH}\\"
${ARCH_C_FLAGS}
SOURCES
driver.c control.c ikc.c syscall.c procfs.c binfmt_mcexec.c