@xenic
Yes, Sebastian added it few days ago, and we do some tests with him in that terms: it works in general. At least simple c++11 threaded test cases (see test/ directory in adtools repo).
That all is some "initial" attempt, where Sebastian enable posix-threads, which works over our pthreads.library. There is through some shortcomings currently: we need to provide special linker-script to be able to link final binary which use those c++11 threads. The problem is, that the pthread constructor is called too late, and without shiftin-sections a bit (via that special ld-script) , we will crash. Sebastian says that is fixable in principe in the libthread.a itself , but that in turn mean new SDK and all that wait-when-released-shit. So that "in progress" mean later Sebatian will change it all so no special linker script need to provide.
If anyone want right now to have compiler with enabled posix-threads, he need:
Usuall stuff to download it all:
mkdir /amiga
cd /amiga
git clone https://github.com/sba1/adtools
cd adtools/
bin/adtclone
bin/adtcheckout binutils 2.23.2
bin/adtcheckout gcc 5
Then change in adtools/native-build/makefile:
CROSS_PREFIX?=$(ROOT_DIR)/root-cross
on
CROSS_PREFIX?=/usr/local/amiga/
(so to have compiler installed in /usr/local/amiga/)
and in gcc-build/Makefile add --enable-threads=posix in 2 places.
Then we do (for me on cygwin it is gcc-cross flag, on native probably just gcc flag)
# make -C native-build gcc-cross
wait till sdk and some other archives downloads,unpacks,and binutils start configure procedure.
CTRL+C (to interrupt whole process)
and then:
# make -C native-build additionals-libs gcc-cross
So, build system will also unpack additional-libs (pthreads, zlib and co) to SDK directory.
After we done, we can do "ppc-amigaos-gcc -v" , and there will be : "Thread model: posix"
Simple test case:
hereThat special linker script (to shift some stuff a bit):
hereTo compile:
//compile object:
ppc-amigaos-g++ -std=c++11 -ffunction-sections -fdata-sections -MD -c test-thread.cpp -o test-thread.o
//link to binary with special ld-script:
ppc-amigaos-g++ -std=c++11 test-thread.o -o test-thread -lpthread -Wl,--gc-sections -Wl,-T,test-thread-ldscript
//run test case:
5. Ram Disk:> test-thread
Start join
Hello, World
Thread is about to finish
Join done
5. Ram Disk:>
That all didn't mean it all fully works and as should, but at least such simple test case works, and code in odyssey related to c++11 threads compiles too. So more tests and bug-reports are need it of course.
Edited by kas1e on 2016/1/27 10:22:00