On Friday, 6 November 2015 at 09:37:31 UTC, Vincent R wrote:
On Thursday, 5 November 2015 at 20:26:27 UTC, Johannes Pfau wrote:
Am Thu, 05 Nov 2015 18:42:32 +0000
schrieb Vincent R <l...@dlang.org>:

On Thursday, 5 November 2015 at 14:27:20 UTC, Vincent R wrote:
> [...]

I tried to add a version(MinGW) inside core.sys.posix.sys.types to just declare pthread_key_t but it didn't work because I still
have exactly the same error.
So am I supposed to do ?

Porting druntime to use the posix thread model for MinGW could be quite some work.

A simpler option is to simply build with the win32 thread model. Try to configure gcc with --enable-threads=win32

I tried with win32 and compilation stopped but don't know why:

...
config.status: executing gstdint.h commands
/mingw64/x86_64-w64-mingw32/bin/ranlib libgphobos2.a
make[4]: Leaving directory '/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libphobos/src' make[4]: Entering directory '/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libphobos' true "AR_FLAGS=rc" "CC_FOR_BUILD=x86_64-w64-mingw32-gcc" "CC_FOR_TARGET=/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/xgcc -B/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/" "CFLAGS=-g -march=x86-64 -mtune=generic -O2 -pipe" "CXXFLAGS=-g -march=x86-64 -mtune=generic -O2 -pipe" "CFLAGS_FOR_BUILD=-march=x86-64 -mtune=generic -O2 -pipe" "CFLAGS_FOR_TARGET=-g -march=x86-64 -mtune=generic -O2 -pipe" "GDC_FOR_TARGET=/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/gdc -B/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/" "GDC=/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/gdc -B/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/ -L/mingw64/x86_64-w64-mingw32/lib -L/mingw64/lib -isystem /mingw64/x86_64-w64-mingw32/include -isystem /mingw64/include -B/mingw64/x86_64-w64-mingw32/bin/ -B/mingw64/x86_64-w64-mingw32/lib/ -isystem /mingw64/x86_64-w64-mingw32/in!
clude -isystem /mingw64/x86_64-w64-mingw32/sys-include   " "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS=" "LIBCFLAGS=-g -march=x86-64 -mtune=generic -O2 
-pipe" "LIBCFLAGS_FOR_TARGET=-g -march=x86-64 -mtune=generic -O2 -pipe" "MAKE=make" "MAKEINFO=makeinfo --split-size=5000000 --split-size=5000000   " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/sh" "RUNTESTFLAGS=" "exec_prefix=/mingw64" 
"infodir=/mingw64/share/info" "libdir=/mingw64/lib" "includedir=/mingw64/include" "prefix=/mingw64" "tooldir=/mingw64/x86_64-w64-mingw32" "gdc_include_dir=/mingw64/lib/gcc/x86_64-w64-mingw32/5.2.0/include/d" "AR=/mingw64/x86_64-w64-mingw32/bin/ar" 
"AS=/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/as" "LD=/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/collect-ld" "RANLIB=/mingw64/x86_64-w64-mingw32/bin/ranlib" "NM=/home!
/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/nm" "NM_FOR_BUILD=" 
"NM_FOR_TARGET=/mingw64/x86_64-w64-mingw32/bin/nm" "DESTDIR=" "WERROR=" DO=all multi-do # make
make[4]: Leaving directory '/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libphobos' make[3]: Leaving directory '/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libphobos' make[2]: Leaving directory '/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libphobos' make[1]: Leaving directory '/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32'
Makefile:871: recipe for target 'all' failed
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

When lookint a bit more to log file I think I found the reason:

libtool: compile: /home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/xgcc -B/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/ -L/mingw64/x86_64-w64-mingw32/lib -L/mingw64/lib -isystem /mingw64/x86_64-w64-mingw32/include -isystem /mingw64/include -B/mingw64/x86_64-w64-mingw32/bin/ -B/mingw64/x86_64-w64-mingw32/lib/ -isystem /mingw64/x86_64-w64-mingw32/include -isystem /mingw64/x86_64-w64-mingw32/sys-include -DHAVE_CONFIG_H -I. -I../../../gcc-5.2.0/libbacktrace -I ../../../gcc-5.2.0/libbacktrace/../include -I ../../../gcc-5.2.0/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=atomic.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -Werror -fPIC -g -march=x86-64 -mtune=generic -O2 -pipe -c ../../../gcc-5.2.0/libbacktrace/atomic.c -DDLL_EXPORT -DPIC -o .libs/atomic.o ../../../gcc-5.2.0/libbacktrace/atomic.c:1:0: error: -fPIC ignored for target (all code is position independent) [-Werror]
 /* atomic.c -- Support for atomic functions if not present.
 ^
/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/gdc
 
-B/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/./gcc/
 -L/mingw64/x86_64-w64-mingw32/lib -L/mingw64/lib -isystem 
/mingw64/x86_64-w64-mingw32/include -isystem /mingw64/include 
-B/mingw64/x86_64-w64-mingw32/bin/ -B/mingw64/x86_64-w64-mingw32/lib/ -isystem 
/mingw64/x86_64-w64-mingw32/include -isystem 
/mingw64/x86_64-w64-mingw32/sys-include    -o std/socketstream.o -Wall  -g 
-frelease -O2 -nostdinc -pipe -Wno-deprecated 
-I../../../../gcc-5.2.0/libphobos/src 
-I../../../../gcc-5.2.0/libphobos/src/../libdruntime 
-I./libdruntime/x86_64-w64-mingw32  -c 
../../../../gcc-5.2.0/libphobos/src/std/socketstream.d
cc1.exe: all warnings being treated as errors
config.status: executing libtool commands
Makefile:420: recipe for target 'atomic.lo' failed
make[3]: *** [atomic.lo] Error 1
make[3]: Leaving directory '/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libbacktrace'
Makefile:323: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/19013692/MINGW-packages/mingw-w64-gcc/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libbacktrace'
Makefile:11495: recipe for target 'all-target-libbacktrace' failed
make[1]: *** [all-target-libbacktrace] Error 2
make[1]: *** Waiting for unfinished jobs....

I saw a patch talking about that https://github.com/venix1/MinGW-GDC/blob/master/patches/gcc/0001-Remove-fPIC-for-MinGW.patch so I am going to apply it and start again.

Reply via email to