Files
mckernel/executer/kernel/mcctrl/CMakeLists.txt
Dominique Martinet b87ac8b8c0 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
2019-03-22 05:01:32 +00:00

33 lines
995 B
CMake

file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/arch/${ARCH})
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
-I${IHK_FULL_SOURCE_DIR}/linux/include/ihk/arch/${ARCH}
-I${IHK_FULL_SOURCE_DIR}/ikc/include
-I${IHK_FULL_SOURCE_DIR}/ikc/include/ikc/arch/${ARCH}
-I${IHK_FULL_SOURCE_DIR}/include
-I${IHK_FULL_SOURCE_DIR}/include/arch/${ARCH}
-I${PROJECT_SOURCE_DIR}/executer/include
-I${CMAKE_CURRENT_SOURCE_DIR}/arch/${ARCH}/include
-I${PROJECT_BINARY_DIR}
-I${PROJECT_SOURCE_DIR}/kernel/include
-DMCEXEC_PATH=\\"${MCEXEC_PATH}\\"
${ARCH_C_FLAGS}
SOURCES
driver.c control.c ikc.c syscall.c procfs.c binfmt_mcexec.c
sysfs.c sysfs_files.c arch/${ARCH}/archdeps.c
EXTRA_SYMBOLS
${PROJECT_BINARY_DIR}/ihk/linux/core/Module.symvers
DEPENDS
ihk_ko
INSTALL_DEST
${KMODDIR}
)