[CRIU] [PATCH] compel: no -r for ARM ldflags
Dmitry Safonov
dsafonov at virtuozzo.com
Fri Mar 17 02:47:14 PDT 2017
On 03/17/2017 03:25 AM, Kir Kolyshkin wrote:
> Nevermind, this is not a complete solution, need to straighten out
> pie building process first.
>
>
> On 03/16/2017 04:05 PM, Kir Kolyshkin wrote:
>> Commit d9486bd720 ("arm/pie/build: do not produce relocatable parasite
>> object") removed -r from LDFLAGS used to compile criu pie. This
>> functionality somehow never made it to criu-dev, and was also lost
>> in master then compel was ported to it.
>>
>> Make it work with compel.
>>
>> Cc: Dmitry Safonov <dsafonov at virtuozzo.com>
>> Signed-off-by: Kir Kolyshkin <kir at openvz.org>
>> ---
>> compel/src/main.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/compel/src/main.c b/compel/src/main.c
>> index ea3da89..a66d60c 100644
>> --- a/compel/src/main.c
>> +++ b/compel/src/main.c
>> @@ -26,7 +26,11 @@
>> #define COMPEL_CFLAGS_PIE CFLAGS_DEFAULT_SET "-fpie"
>> #define COMPEL_CFLAGS_NOPIC CFLAGS_DEFAULT_SET "-fno-pic"
>> +#ifdef NO_RELOCS
>> +#define COMPEL_LDFLAGS_COMMON "-z noexecstack -T "
>> +#else
>> #define COMPEL_LDFLAGS_COMMON "-r -z noexecstack -T "
>> +#endif
>> typedef struct {
>> const char *arch; // dir name under arch/
>
I guess, it could be nicer if we add another field into flags_t:
static const flags_t flags = {
#if defined CONFIG_X86_64
.arch = "x86",
.cflags = COMPEL_CFLAGS_PIE,
.cflags_compat = COMPEL_CFLAGS_NOPIC,
But I don't mind, it's just a preference.
Another thing - it's that we still must test arm/arm64 if it works
after all :)
Blindely patching is good, but it would be better, if we would be sure
that it works..
--
Dmitry
More information about the CRIU
mailing list