tests: Add -mno-relax to link flags for server test 54/291354/2
authorŁukasz Stelmach <l.stelmach@samsung.com>
Fri, 7 Apr 2023 10:49:25 +0000 (12:49 +0200)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Thu, 13 Apr 2023 19:30:59 +0000 (21:30 +0200)
commit3d1bd7de02c1f436351ce739f6614d9d5e7eb7df
treea3003672ca7eaf5e29d9c1abe8eb7a7d85176343
parent209bc14435580ed340b8bdb10f134d6de76b3bb0
tests: Add -mno-relax to link flags for server test

The flag is required to prevent the test binary from using the gp register
on RISC-V to access global variables. RISC-V ABI assumes the value of the register
is assigned once at sartup (see load_gp() in sysdeps/riscv/start.S in
glibc sources). During tests this code is called for the second time when
app2sd-server-test uses dlopen() to load app2sd-server. Therefore with
relaxed linking enabled for both binaries, the value set at the start
of app2sd-server-test gets overwriten and the test process crashes in
semi-random places.

Change-Id: I6c5d550340c222bb53f8affd0d0c188cc5311765
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
packaging/app2sd.spec
unit-tests/CMakeLists.txt