[CRIU] [PATCH] compel: no -r for ARM ldflags

Kir Kolyshkin kir at openvz.org
Fri Mar 17 20:09:39 PDT 2017


On 03/17/2017 02:47 AM, Dmitry Safonov wrote:
> 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.

That was my first idea too, but as we already define NO_RELOCS,
which is arch-independent and means we don't want relocations
(including -r), it looks more logical to use it.

>
> 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..

I totally agree. Alas, no arm on Travis, and no arm vendor is helping us :(



More information about the CRIU mailing list