[CRIU] [PATCH] restorer: Add "memory" constraint into asm statement

Huang Qiang h.huangqiang at huawei.com
Tue Sep 25 07:15:21 EDT 2012


On 2012/9/25 17:47, Cyrill Gorcunov wrote:
> On Tue, Sep 25, 2012 at 01:39:23PM +0400, Glauber Costa wrote:
>> On 09/24/2012 07:23 PM, Cyrill Gorcunov wrote:
>>> It seems otherwise older gcc compilers do treat this
>>> statement as incomplete.
>>>
>>> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
>>> ---
>>>  restorer.c |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/restorer.c b/restorer.c
>>> index d516bed..df95e00 100644
>>> --- a/restorer.c
>>> +++ b/restorer.c
>>> @@ -705,6 +705,6 @@ core_restore_failed:
>>>  		"jmp *%%rax				\n"
>>>  		:
>>>  		: "r"(ret)
>>> -		: );
>>> +		: "memory");
>>>  	return ret;
>>>  }
>>>
>> You can just add "" if you don't want to actually clobber memory, IIRC.
> 
> Well, "memory" actually won't hurt here as well ;) The problem is that
> the reporter has not replied me if such trick helped him build the
> program. It seems some older gcc series do not like empty clobbering
> fields.
> 

Sorry for the late replay. Yes, of course your patch can help me build the
program, I thought you already tested it on the exactly environment.

And I just tested Glauber's way, but I got error:
restorer.c: In function ‘__export_restore_task’:
restorer.c:702: error: unknown register name ‘’ in ‘asm’
make[1]: *** [restorer.o] Error 1
make: *** [pie] Error 2

The same as before, gcc version is 4.3.4.




More information about the CRIU mailing list