From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21827 invoked by alias); 16 Jun 2013 10:59:39 -0000 Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org Received: (qmail 21812 invoked by uid 89); 16 Jun 2013 10:59:36 -0000 X-Spam-SWARE-Status: No, score=1.2 required=5.0 tests=AWL,BAYES_00,KHOP_DNSBL_BUMP,RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_L3,TW_MX autolearn=ham version=3.3.1 Received: from webbox220.server-home.org (HELO webbox220.server-home.org) (83.220.144.69) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 16 Jun 2013 10:59:34 +0000 Received: from idefix (p5498349E.dip0.t-ipconnect.de [84.152.52.158]) by webbox220.server-home.org (Postfix) with ESMTPSA id 2A037C06ED for ; Sun, 16 Jun 2013 12:59:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by idefix (Postfix) with ESMTP id 15AC38043 for ; Sun, 16 Jun 2013 12:59:30 +0200 (CEST) Received: from idefix ([127.0.0.1]) by localhost (gallien.homelinux.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6g+jy5YACxhD for ; Sun, 16 Jun 2013 12:59:29 +0200 (CEST) Received: from [192.168.0.29] (p5498349E.dip0.t-ipconnect.de [84.152.52.158]) by idefix (Postfix) with ESMTPSA id AD588803B for ; Sun, 16 Jun 2013 12:59:29 +0200 (CEST) Message-ID: <51BD9A91.10101@dl5rcw.de> Date: Sun, 16 Jun 2013 10:59:00 -0000 From: Lars User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: pthreads-win32@sourceware.org Subject: CONDITION_VARIABLE native_cond - threading issue on mysql-connector-c and pthreads-win32 with gcc (mingw) Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-SW-Source: 2013/txt/msg00007.txt.bz2 Dear community, I want to add libmysql to mxe (www.mxe.cc). MXE (M cross environment) is a Makefile that compiles a cross compiler and cross compiles many free libraries such as SDL and Qt. Thus, it provides a nice cross compiling environment for various target platforms. There is one issue that I would like to check with you could possibly be a threading issue. Upon build, unknown type name 'CONDITION VARIABLE' CONDITION VARIABLE native_cond; came up and broke it. native_cond seems to belong to windows implementations. It was stated that pthrads-win32 should provide those. Unfortunately, SWRLOCK seems to be native Vista and later versions and not provided by pthreads 2.9.1 (?). Here is the commplete output: [ 0%] Built target INFO_BIN [ 0%] Built target INFO_SRC [ 6%] Built target zlib [ 6%] Building C object extra/yassl/CMakeFiles/yassl.dir/__/__/client/get_password.c.obj In file included from /share/mxe+mysql-connector/tmp-mysql-connector-c/mysql-connector-c-6.1.0-src/include/my_sys.h:44:0, from /share/mxe+mysql-connector/tmp-mysql-connector-c/mysql-connector-c-6.1.0-src/client/get_password.c:21: /share/mxe+mysql-connector/tmp-mysql-connector-c/mysql-connector-c-6.1.0-src/include/my_pthread.h:59:3: error: unknown type name 'CONDITION_VARIABLE' CONDITION_VARIABLE native_cond; ^ In file included from /share/mxe+mysql-connector/tmp-mysql-connector-c/mysql-connector-c-6.1.0-src/include/my_sys.h:44:0, from /share/mxe+mysql-connector/tmp-mysql-connector-c/mysql-connector-c-6.1.0-src/client/get_password.c:21: /share/mxe+mysql-connector/tmp-mysql-connector-c/mysql-connector-c-6.1.0-src/include/my_pthread.h:682:5: error: unknown type name 'SRWLOCK' SRWLOCK srwlock; /* native reader writer lock */ ^ /share/mxe+mysql-connector/tmp-mysql-connector-c/mysql-connector-c-6.1.0-src/client/get_password.c: In function 'yassl_mysql_get_tty_password_ext': /share/mxe+mysql-connector/tmp-mysql-connector-c/mysql-connector-c-6.1.0-src/client/get_password.c:90:5: warning: implicit declaration of function 'iscntrl' [-Wimplicit-function-declaration] if (iscntrl(tmp) || pos == end) ^ /share/mxe+mysql-connector/tmp-mysql-connector-c/mysql-connector-c-6.1.0-src/client/get_password.c:95:3: warning: implicit declaration of function 'isspace' [-Wimplicit-function-declaration] while (pos != to && isspace(pos[-1]) == ' ') ^ /share/mxe+mysql-connector/tmp-mysql-connector-c/mysql-connector-c-6.1.0-src/client/get_password.c:72:7: warning: unused variable 'i' [-Wunused-variable] int i=0; ^ make[2]: *** [extra/yassl/CMakeFiles/yassl.dir/__/__/client/get_password.c.obj] Fehler 1 make[1]: *** [extra/yassl/CMakeFiles/yassl.dir/all] Fehler 2 make: *** [all] Fehler 2 I wrote the mysql-connect-c.mk file to add the download and build into mxe. For the build process based on cmake, I chose following definition: mkdir '$(1).build' cd '$(1).build' && cmake \ -DSTACK_DIRECTION=1 \ -DCMAKE_INSTALL_PREFIX=$(PREFIX)/$(TARGET) \ -DCMAKE_TARGET='$(TARGET)' \ -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ '$(1)' $(MAKE) -C '$(1).build' -j '$(JOBS)' VERBOSE=1 $(MAKE) -C '$(1).build' -j 1 install VERBOSE=1 Toolchain file is: set(CMAKE_SYSTEM_NAME Windows) set(MSYS 1) set(BUILD_SHARED_LIBS OFF) set(CMAKE_BUILD_TYPE Release) set(CMAKE_FIND_ROOT_PATH /share/mxe+mysql-connector-c/usr/i686-pc-mingw32) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_C_COMPILER /share/mxe+mysql-connector-c/usr/bin/i686-pc-mingw32-gcc) set(CMAKE_CXX_COMPILER /share/mxe+mysql-connector-c/usr/bin/i686-pc-mingw32-g++) set(CMAKE_Fortran_COMPILER /share/mxe+mysql-connector-c/usr/bin/i686-pc-mingw32-gfortran) set(CMAKE_RC_COMPILER /share/mxe+mysql-connector-c/usr/bin/i686-pc-mingw32-windres) set(PKG_CONFIG_EXECUTABLE /share/mxe+mysql-connector-c/usr/bin/i686-pc-mingw32-pkg-config) set(QT_QMAKE_EXECUTABLE /share/mxe+mysql-connector-c/usr/i686-pc-mingw32/qt/bin/qmake) set(CMAKE_INSTALL_PREFIX /share/mxe+mysql-connector-c/usr/i686-pc-mingw32 CACHE PATH "Installation Prefix") set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug|Release|RelWithDebInfo|MinSizeRel") As prerequirement, I had gcc, boost, openssl and pthreads added. gcc version is 4.8.0 boost version is 1.53.0 pthreads version is 2.9.1 openssl version is 1.0.1e If anyone would like to reproduce this, please feel free to contact me and I can provide the index.html and mysql-connect-c.mk file for MXE. Any help or hint is highly appreciated as I would like to quickly see this contributed to MXE. Best regards, Lars