PLCrashReporter not compiling in Xcode 10 beta 5

348 Views Asked by At

PLCrashReporter not compiling in Xcode 10 beta. Seems like register size issue.

error: invalid operand for instruction movq %cs, 160(%rsp);

error: invalid operand for instruction movq %fs, 168(%rsp);

error: invalid operand for instruction movq %gs, 176(%rsp);

I did follow this link https://github.com/plausiblelabs/plcrashreporter/pull/12/files after doing code changes the other instructions are getting error.

error: invalid operand for instruction movl %cs, 16 +56(%esp);

error: invalid operand for instruction movl %ds, 16 +60(%esp);

error: invalid operand for instruction movl %es, 16 +64(%esp);

Any help is much appreciated.

3

There are 3 best solutions below

0
On

It seems that beta 5 have a lot bugs.

Mine is ln error

beta 1~4 all works fine. plus Xcode 9

0
On

try change MOVQ to movw from line 96 to line 98 in PLCrashAsyncThread_current.S,like this:

movw    %cs, 160(%rsp);
movw    %fs, 168(%rsp);
movw    %gs, 176(%rsp);

more info check here

ps,there is anothre error in the file, you can check the solution from here which yumoji mentioned.

Best wishes!

0
On

Use this version which fixes some of the issues from the author's repository

https://github.com/Microsoft/PLCrashReporter

If you like to use the original version, replace following in PLCrashAsyncThread_current.S file (around line number 149) as reported here

#if 0
MOVL    (cs, 56);
MOVL    (ds, 60);
MOVL    (es, 64);
MOVL    (fs, 68);
MOVL    (gs, 72);
#undef MOVL
#else
movl    $0, 56(%esp);
movw    %cs, 56+OFF(%esp);
movl    $0, 60(%esp);
movw    %ds, 60+OFF(%esp);
movl    $0, 64(%esp);
movw    %es, 64+OFF(%esp);
movl    $0, 68(%esp);
movw    %fs, 68+OFF(%esp);
movl    $0, 72(%esp);
movw    %gs, 72+OFF(%esp);
#endif

Note that, this will only resolve it partially. PLCR still uses some deprecated functions for spinlocks and memory barrier that need to be fixed.