Skip to contentSkip to conversation

qemu-coroutine.c: error: thread-local storage not supported for this target

Qemu-devel Programmingkid 3 participants 11 messages Jan 23, 2015 – Jan 24, 2015

lore
Share & tools
lore
#0 lore raw

I used the newest version from QEMU's git with this id: a46b3aaf6bb038d4f6f192a84df204f10929e75c. When I tried to compile QEMU on Mac OS 10.6.8, I saw this error: qemu-coroutine.c:29: error: thread-local storage not supported for this target.

#1 lore raw
Quoted 4 lines · Programmingkid

I used the newest version from QEMU's git with this id:
a46b3aaf6bb038d4f6f192a84df204f10929e75c. When I tried to compile QEMU on Mac OS 10.6.8, I saw this error: qemu-coroutine.c:29: error:
thread-local storage not supported for this target.

GCC or clang?

Paolo

#2 lore raw
Quoted 11 lines · Paolo Bonzini
Quoted 4 lines · Programmingkid

I used the newest version from QEMU's git with this id:
a46b3aaf6bb038d4f6f192a84df204f10929e75c. When I tried to compile QEMU on Mac OS 10.6.8, I saw this error: qemu-coroutine.c:29: error:
thread-local storage not supported for this target.

GCC or clang?

Paolo

GCC 4.2.1.

#3 lore raw
Quoted 7 lines · Programmingkid
Quoted 4 lines · Programmingkid

I used the newest version from QEMU's git with this id:
a46b3aaf6bb038d4f6f192a84df204f10929e75c. When I tried to compile QEMU on Mac OS 10.6.8, I saw this error: qemu-coroutine.c:29: error:
thread-local storage not supported for this target.

GCC 4.2.1.

Use clang then.

Paolo

#4 lore raw
Quoted 9 lines · Paolo Bonzini
Quoted 6 lines · Programmingkid
Quoted 4 lines · Programmingkid

I used the newest version from QEMU's git with this id:
a46b3aaf6bb038d4f6f192a84df204f10929e75c. When I tried to compile QEMU on Mac OS 10.6.8, I saw this error: qemu-coroutine.c:29: error:
thread-local storage not supported for this target.

Quoted 5 lines
Quoted 1 line

GCC 4.2.1.

Use clang then.

Paolo

Could you provide directions on how you want me to do this? In the configure options, this was all I found:
--objcc=OBJCC use Objective-C compiler OBJCC [clang]

#5 lore raw
Quoted 4 lines · Programmingkid
Quoted 1 line

Use clang then.

Could you provide directions on how you want me to do this? In the configure options, this was all I found:
--objcc=OBJCC use Objective-C compiler OBJCC [clang]

./configure --cc=clang --cxx=clang++

But QEMU uses "cc" and "c++" by default, not "gcc" and "g++", and on Mac OS X "cc" and "c++" should be clang. So "./configure" should just work.

Paolo

#6 lore raw
Quoted 5 lines · Paolo Bonzini
Quoted 2 lines · Programmingkid
Quoted 1 line

Use clang then.

Quoted 7 lines
Quoted 2 lines

Could you provide directions on how you want me to do this? In the configure options, this was all I found:
--objcc=OBJCC use Objective-C compiler OBJCC [clang]

./configure --cc=clang --cxx=clang++

But QEMU uses "cc" and "c++" by default, not "gcc" and "g++", and on Mac OS X "cc" and "c++" should be clang. So "./configure" should just work.

Sorry, I was wrong. I missed that you are using 10.6.x.

Thread-local storage was introduced on Mac OS X in 10.7. For 10.6.x you'll have to compile GCC 4.3 or newer yourself (or take it from fink/homebrew/whatever the Mac folks use these days).

Paolo

#7 lore raw
Quoted 13 lines · Paolo Bonzini
Quoted 10 lines · Paolo Bonzini
Quoted 4 lines · Programmingkid
Quoted 1 line

Use clang then.

Could you provide directions on how you want me to do this? In the configure options, this was all I found:
--objcc=OBJCC use Objective-C compiler OBJCC [clang]

./configure --cc=clang --cxx=clang++

Quoted 9 lines
Quoted 2 lines

But QEMU uses "cc" and "c++" by default, not "gcc" and "g++", and on Mac OS X "cc" and "c++" should be clang. So "./configure" should just work.

Sorry, I was wrong. I missed that you are using 10.6.x.

Thread-local storage was introduced on Mac OS X in 10.7. For 10.6.x you'll have to compile GCC 4.3 or newer yourself (or take it from fink/homebrew/whatever the Mac folks use these days).

The code that causes this problem needs to be #ifdef'ed. I'm just not sure what the problem code is.

#8 lore raw
Quoted 8 lines · Programmingkid
Quoted 5 lines

Sorry, I was wrong. I missed that you are using 10.6.x.

Thread-local storage was introduced on Mac OS X in 10.7. For 10.6.x you'll have to compile GCC 4.3 or newer yourself (or take it from fink/homebrew/whatever the Mac folks use these days).

The code that causes this problem needs to be #ifdef'ed. I'm just not sure what the problem code is.

Thread-local storage will become more and more fundamental as QEMU makes more use of threads. Another use of __thread will be committed in a matter of weeks; __thread is simpler and potentially faster than pthread TLS.

A possible alternative would be to enable QEMU to compile with a C++ compiler and use Boost's thread-local storage module. Using #ifdef makes code ugly for no reason, and is not an acceptable alternative.

Note that GCC 4.3 was released almost seven years ago; we've been requiring it on Windows for three years (commit 00dccaf, coroutine:
introduce coroutines, 2011-01-17), and no one has ever complained.

Apple is not providing it for Mac OS X 10.6.x only because of political reasons. Complain to them, not to the QEMU project.

Paolo

#9 lore raw
Quoted 6 lines · Paolo Bonzini

Note that GCC 4.3 was released almost seven years ago; we've been requiring it on Windows for three years (commit 00dccaf, coroutine:
introduce coroutines, 2011-01-17), and no one has ever complained.

Apple is not providing it for Mac OS X 10.6.x only because of political reasons. Complain to them, not to the QEMU project.

Apple's not providing it on 10.6.x because 10.6.x is obsolete as far as Apple is concerned. Supported versions of OSX use clang, which has support for __thread. Missing __thread support is an "old platform" thing, not a political GPL thing.

-- PMM

#10 lore raw

The lack of emulated TLS on 10.6 is the consequence of a political choice, though. GCC 4.3 was released long before Snow Leopard, but users are stuck with 4.2.1 because of the license.

Paolo

-----Original Message-----
From: Peter Maydell [[email protected]]
Received: sabato, 24 gen 2015, 20:33
To: Paolo Bonzini [[email protected]]
CC: Programmingkid [[email protected]]; Kevin Wolf [[email protected]]; qemu-devel qemu-devel [[email protected]]
Subject: Re: [Qemu-devel] qemu-coroutine.c: error: thread-local storage not supported for this target

Quoted 6 lines · Paolo Bonzini

Note that GCC 4.3 was released almost seven years ago; we've been requiring it on Windows for three years (commit 00dccaf, coroutine:
introduce coroutines, 2011-01-17), and no one has ever complained.

Apple is not providing it for Mac OS X 10.6.x only because of political reasons. Complain to them, not to the QEMU project.

Apple's not providing it on 10.6.x because 10.6.x is obsolete as far as Apple is concerned. Supported versions of OSX use clang, which has support for __thread. Missing __thread support is an "old platform" thing, not a political GPL thing.

-- PMM