View Issue Details

IDProjectCategoryView StatusLast Update
0000567bareos-coreGeneralpublic2015-11-20 16:12
Reporterironiq Assigned Tomaik  
PrioritylowSeveritytextReproducibilityalways
Status closedResolutionunable to reproduce 
PlatformMinGW64OSopenSUSEOS Version13.2
Summary0000567: Compile error during crosscompiling win32 binary
DescriptionHi,

i'd like to build the win32 binaries, but i have problem with it. I installed a clean openSUSE 13.2 with the requested mingw64 packages. I pulled the git tree and tried to build src/win32 directory, with this error:

/usr/bin/x86_64-w64-mingw32-g++ -DBUILDING_DLL -DMINGW64 -DHAVE_WIN32 -DHAVE_MINGW -D_WIN32_WINNT=0x500 -I../.. -I../../include -I../include -I../compat/include -Wall -m64 -mwin32 -mthreads -O3 -fno-strict-aliasing -Wno-unknown-pragmas -c -o devlock.o ../../lib/devlock.c
In file included from ../../include/bareos.h:135:0,
                 from ../../lib/devlock.c:34:
../../lib/devlock.c: In member function 'int devlock::readlock()':
../../lib/devlock.c:175:7: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void'
       pthread_cleanup_pop(0);
       ^
../../lib/devlock.c: In member function 'int devlock::writelock(int, bool)':
../../lib/devlock.c:261:7: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void'
       pthread_cleanup_pop(0);
       ^
Makefile:87: recipe for target 'devlock.o' failed
make[1]: *** [devlock.o] Error 1
make[1]: Leaving directory '/root/projects/bareos/bareos.git/src/win32/lib'

root@BareBuilder:/root/projects/bareos/bareos.git/src/win32# cat /etc/os-release
NAME=openSUSE
VERSION="13.2 (Harlequin)"
VERSION_ID="13.2"
PRETTY_NAME="openSUSE 13.2 (Harlequin) (x86_64)"
ID=opensuse
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:opensuse:13.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://opensuse.org/"
ID_LIKE="suse"
root@BareBuilder:/root/projects/bareos/bareos.git/src/win32# git branch -a
  bareos-15.2
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/bareos-12.4
  remotes/origin/bareos-13.2
  remotes/origin/bareos-14.2
  remotes/origin/bareos-14.2-debian
  remotes/origin/bareos-15.2
  remotes/origin/master

I tried also the 'bareos-15.2' branch with the same result. Is there anything i missed?


Thanks,

IroNiQ
TagsNo tags attached.

Activities

mvwieringen

mvwieringen

2015-11-17 17:26

developer   ~0001979

Seems you using a wrong version of pthreads as the manpage says:

void pthread_cleanup_pop(int execute);

As we don't see this when building on OBS which essentially is also Suse
I guess someone on purpose broke pthreads. You can look in the specfiles
for building on OBS what gets used there as rpms for building it there.
e.g platforms/win32/winbareos32.spec
ironiq

ironiq

2015-11-17 17:44

reporter   ~0001980

Actually i don't really use OBS (and don't really want to use it). I'd like to build the win32 binaries locally on my infrastructure. I searched for "pthred" in my package list:
root@BareBuilder:/root/projects/bareos/bareos.git/src/win32# zypper se pthread | grep '^i'
i | mingw64-libwinpthread1 | A pthreads implementation for Windows | package
i | mingw64-pthreads-devel | MinGW pthread library | package
i | mingw64-winpthreads-devel | Development files for mingw64-winpthreads | package
root@BareBuilder:/root/projects/bareos/bareos.git/src/win32# zypper if mingw64-winpthreads-devel mingw64-pthreads-devel mingw64-libwinpthread1 | egrep '^(Name|Version|Vendor)'
Name: mingw64-winpthreads-devel
Version: 4.0.4-1.11
Vendor: obs://build.opensuse.org/windows:mingw
Name: mingw64-pthreads-devel
Version: 2.8.0-12.4
Vendor: obs://build.opensuse.org/windows:mingw
Name: mingw64-libwinpthread1
Version: 4.0.4-1.11
Vendor: obs://build.opensuse.org/windows:mingw

If i missed something, please tell me.
mvwieringen

mvwieringen

2015-11-17 17:49

developer   ~0001981

We have our own copy of the mingw stuff as upstream tends to some time
break things in gross ways. Seems that is now also happening. So you probably
want to find out how they defined pthread_cleanup_pop() in the mingw headers.
ironiq

ironiq

2015-11-17 18:06

reporter   ~0001982

Well, if i'm right, then this will be the definition:

/* Note that if async cancelling is used, then there is a race here */
#define pthread_cleanup_pop(E)\
    (*pthread_getclean() = _pthread_cup.next, (E?_pthread_cup.func((pthread_once_t *)_pthread_cup.arg):0));}


I don't really know anything about this (i'm not a developer), maybe it can help.
mvwieringen

mvwieringen

2015-11-17 18:44

developer   ~0001983

You could try changing the definition to

#define pthread_cleanup_pop(E)\
    (*pthread_getclean() = _pthread_cup.next, (E?_pthread_cup.func((pthread_once_t *)_pthread_cup.arg):NULL));}
ironiq

ironiq

2015-11-17 20:44

reporter   ~0001984

Same result...
mvwieringen

mvwieringen

2015-11-18 13:51

developer   ~0001992

As this clearly is a problem in your build chain (probably a gcc being a
bit to new and giving errors on external headers provided by pthreads) I
close this as its not a bareos problem as we implement the call right and
can also build things on every platform we support with it.
ironiq

ironiq

2015-11-18 16:28

reporter   ~0001995

Then can you please tell me more about the "proper" build chain (versions, etc)? It's not an option to use OBS (we have to build it locally).
maik

maik

2015-11-20 14:47

administrator   ~0002009

Please see http://www.bareos.com, if you need further assistance.
ironiq

ironiq

2015-11-20 15:43

reporter   ~0002010

If i would buy something for backup, i'm pretty sure i will not choose Bareos, neither Bacula...
maik

maik

2015-11-20 16:12

administrator   ~0002011

Your choice.

You can also use the installation packages provided for free here:
http://download.bareos.org

Issue History

Date Modified Username Field Change
2015-11-17 15:55 ironiq New Issue
2015-11-17 17:26 mvwieringen Note Added: 0001979
2015-11-17 17:26 mvwieringen Assigned To => mvwieringen
2015-11-17 17:26 mvwieringen Status new => feedback
2015-11-17 17:44 ironiq Note Added: 0001980
2015-11-17 17:44 ironiq Status feedback => assigned
2015-11-17 17:49 mvwieringen Note Added: 0001981
2015-11-17 18:06 ironiq Note Added: 0001982
2015-11-17 18:44 mvwieringen Note Added: 0001983
2015-11-17 18:45 mvwieringen Assigned To mvwieringen =>
2015-11-17 18:45 mvwieringen Status assigned => feedback
2015-11-17 20:44 ironiq Note Added: 0001984
2015-11-17 20:44 ironiq Status feedback => new
2015-11-18 13:51 mvwieringen Note Added: 0001992
2015-11-18 13:51 mvwieringen Status new => feedback
2015-11-18 16:28 ironiq Note Added: 0001995
2015-11-18 16:28 ironiq Status feedback => new
2015-11-20 14:47 maik Note Added: 0002009
2015-11-20 14:47 maik Priority normal => low
2015-11-20 14:47 maik Severity minor => text
2015-11-20 14:47 maik Status new => closed
2015-11-20 14:47 maik Resolution open => unable to reproduce
2015-11-20 15:43 ironiq Note Added: 0002010
2015-11-20 15:43 ironiq Status closed => feedback
2015-11-20 15:43 ironiq Resolution unable to reproduce => reopened
2015-11-20 16:12 maik Note Added: 0002011
2015-11-20 16:12 maik Status feedback => closed
2015-11-20 16:12 maik Assigned To => maik
2015-11-20 16:12 maik Resolution reopened => unable to reproduce