Maybe you can write the code needs __seg_gs in C, compile and link it with other C++ files, as a workaround. HTH, chenwj 2017-03-27 21:22 GMT+08:00 J.W. Jagersma <jwjagersma@xxxxxxxxx>: > I don't see any mention of C++ specifically on that page... but is > there any reason it's not implemented? It would be very useful, right > now I'm stuck using inline assembly to access non-ds segments. > Also found this (unanswered) bug report asking about the same thing: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69549 > > On 27 March 2017 at 12:16, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote: >> On 26 March 2017 at 17:04, J.W. Jagersma <jwjagersma@xxxxxxxxx> wrote: >> On 26 March 2017 at 05:39, J.W. Jagersma <jwjagersma@xxxxxxxxx> wrote: >>>> However I just found that it does compile when it's a .c file, but not >>>> as a .cpp file. Is __seg_gs only implemented in C for some reason? >> >> Yes, that is true according to the docs: >> https://gcc.gnu.org/onlinedocs/gcc/Named-Address-Spaces.html -- Wei-Ren Chen (陳韋任) Homepage: http://people.cs.nctu.edu.tw/~chenwj