From e9fd1fc49f6f9168e81e12286e99065189deb880 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Mon, 6 Dec 2021 11:44:56 +0100 Subject: [PATCH] build(core/emulator): build with -fPIE Otherwise "cargo test" fails with errors like: Compiling trezor_lib v0.1.0 (embed/rust) error: linking with `cc` failed: exit status: 1 | = note: ld: build/unix/rust/debug/build/trezor_lib-a046f8e3db087595/out/libcore_lib.a(obj.o): relocation R_X86_64_32S against `.rodata.types.1' can not be used when making a PIE object; recompile with -fPIE --- core/SConscript.unix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/SConscript.unix b/core/SConscript.unix index 6da55c542..251531b1e 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -398,7 +398,7 @@ env.Replace( CCFLAGS='$COPT ' '-g3 ' '-std=gnu99 -Wall -Werror -Wuninitialized -Wno-missing-braces ' - '-fdata-sections -ffunction-sections ' + CCFLAGS_MOD, + '-fdata-sections -ffunction-sections -fPIE ' + CCFLAGS_MOD, CCFLAGS_QSTR='-DNO_QSTR -DN_X64 -DN_X86 -DN_THUMB', LIBS=['m'], CPPPATH=[