Summary: | some sort of build breakage on mingw | ||
---|---|---|---|
Product: | dbus | Reporter: | Simon McVittie <smcv> |
Component: | core | Assignee: | D-Bus Maintainers <dbus> |
Status: | RESOLVED INVALID | QA Contact: | D-Bus Maintainers <dbus> |
Severity: | normal | ||
Priority: | medium | CC: | ralf.habacker |
Version: | git master | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Simon McVittie
2015-09-21 13:09:12 UTC
(In reply to Simon McVittie from comment #0) > ../../dbus-master/test/test-utils-glib.c: In function 'test_init': > ../../dbus-master/test/test-utils-glib.c:434:3: warning: implicit > declaration of function 'alarm' [-Wimplicit-function-declaration] > alarm (TIMEOUT + 10); This is not compiled unless G_OS_UNIX is defined, which should only happen on a Unix host architecture. I suspect you are using the headers of a GLib that was compiled for Linux, not one that was compiled for mingw. Here is how I configure D-Bus for mingw: ${srcdir}/configure \ --enable-maintainer-mode --enable-developer \ --enable-installed-tests --enable-modular-tests --with-glib \ --build=x86_64-pc-linux-gnu --host=i686-w64-mingw32 \ build_alias=x86_64-pc-linux-gnu host_alias=i686-w64-mingw32 \ --prefix=/opt/i686-w64-mingw32 \ LDFLAGS=-L/opt/i686-w64-mingw32/lib \ CPPFLAGS=-I/opt/i686-w64-mingw32/include \ PKG_CONFIG_LIBDIR=/opt/i686-w64-mingw32/lib/pkgconfig \ PKG_CONFIG_PATH= I have GLib installed with --prefix=/opt/i686-w64-mingw32. You'd use /usr/i686-w64-mingw32/sys-root/mingw instead, I think. (In reply to Simon McVittie from comment #1) > (In reply to Simon McVittie from comment #0) > > ../../dbus-master/test/test-utils-glib.c: In function 'test_init': > > ../../dbus-master/test/test-utils-glib.c:434:3: warning: implicit > > declaration of function 'alarm' [-Wimplicit-function-declaration] > > alarm (TIMEOUT + 10); > > This is not compiled unless G_OS_UNIX is defined, which should only happen > on a Unix host architecture. > > I suspect you are using the headers of a GLib that was compiled for Linux, > not one that was compiled for mingw. > > Here is how I configure D-Bus for mingw: > > ${srcdir}/configure \ > --enable-maintainer-mode --enable-developer \ > --enable-installed-tests --enable-modular-tests --with-glib \ > --build=x86_64-pc-linux-gnu --host=i686-w64-mingw32 \ > build_alias=x86_64-pc-linux-gnu host_alias=i686-w64-mingw32 \ > --prefix=/opt/i686-w64-mingw32 \ > LDFLAGS=-L/opt/i686-w64-mingw32/lib \ > CPPFLAGS=-I/opt/i686-w64-mingw32/include \ > PKG_CONFIG_LIBDIR=/opt/i686-w64-mingw32/lib/pkgconfig \ > PKG_CONFIG_PATH= > > I have GLib installed with --prefix=/opt/i686-w64-mingw32. You'd use > /usr/i686-w64-mingw32/sys-root/mingw instead, I think. Looks indeed to be a local configure error. Yesterday I added a opensuse package for dbus-1.10 and enabled embedded tests, which compiled without any problem. See https://build.opensuse.org/build/home:rhabacker:branches:windows:mingw:win32/openSUSE_13.1/x86_64/mingw32-dbus-1/_log for the log file. The related configure line is. ./configure --host=i686-w64-mingw32 --build=x86_64-suse-linux-gnu --target=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/sys-root/mingw --exec-prefix=/usr/i686-w64-mingw32/sys-root/mingw --bindir=/usr/i686-w64-mingw32/sys-root/mingw/bin --sbindir=/usr/i686-w64-mingw32/sys-root/mingw/sbin --sysconfdir=/usr/i686-w64-mingw32/sys-root/mingw/etc --datadir=/usr/i686-w64-mingw32/sys-root/mingw/share --includedir=/usr/i686-w64-mingw32/sys-root/mingw/include --libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib --libexecdir=/usr/i686-w64-mingw32/sys-root/mingw/libexec --localstatedir=/usr/i686-w64-mingw32/sys-root/mingw/var --sharedstatedir=/usr/i686-w64-mingw32/sys-root/mingw/com --mandir=/usr/i686-w64-mingw32/sys-root/mingw/share/man --infodir=/usr/i686-w64-mingw32/sys-root/mingw/share/info --enable-maintainer-mode --disable-static --enable-verbose-mode --enable-embedded-tests --enable-checks --enable-asserts --disable-xml-docs --disable-doxygen-docs. So I recreated a fresh build dir and did run ../dbus/autogen.sh --host=i686-w64-mingw32 --build=x86_64-suse-linux-gnu --target=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/sys-root/mingw --exec-prefix=/usr/i686-w64-mingw32/sys-root/mingw --bindir=/usr/i686-w64-mingw32/sys-root/mingw/bin --sbindir=/usr/i686-w64-mingw32/sys-root/mingw/sbin --sysconfdir=/usr/i686-w64-mingw32/sys-root/mingw/etc --datadir=/usr/i686-w64-mingw32/sys-root/mingw/share --includedir=/usr/i686-w64-mingw32/sys-root/mingw/include --libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib --libexecdir=/usr/i686-w64-mingw32/sys-root/mingw/libexec --localstatedir=/usr/i686-w64-mingw32/sys-root/mingw/var --sharedstatedir=/usr/i686-w64-mingw32/sys-root/mingw/com --mandir=/usr/i686-w64-mingw32/sys-root/mingw/share/man --infodir=/usr/i686-w64-mingw32/sys-root/mingw/share/info --enable-maintainer-mode --disable-static --enable-verbose-mode --enable-embedded-tests --enable-checks --enable-asserts --disable-xml-docs --disable-doxygen-docs and got still the same error. Greping "usr/include" in <build-root>/config.status returns S["GLIB_CFLAGS"]="-pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include " S["oldincludedir"]="/usr/include" This looks wrong. The pathes should be prefixed with /usr/i686-... autoconf/pkgconfig issue ? This is not a D-Bus bug, as far as I can see. (In reply to Ralf Habacker from comment #2) > autoconf/pkgconfig issue ? Yes, looks like it. If you are cross-compiling anything that uses pkg-config, you need to do at least one of these two things: * set PKG_CONFIG_PATH and/or PKG_CONFIG_LIBDIR so that pkg-config will look in the appropriate prefix or sysroot to find your foreign (mingw) libraries; or * have a ${tuple}-pkg-config in your $PATH which looks in the appropriate prefix or sysroot to find the foreign libraries, or set ${PKG_CONFIG} to point to a script or executable that does so ${tuple} represents the host alias, which is i686-w64-mingw32 in your case. ${tuple}-pkg-config is usually implemented as a shell script that sets PKG_CONFIG_PATH and/or PKG_CONFIG_LIBDIR, then execs the real pkg-config. If you don't do either of those, then pkg-config will find your build system's GLib instead of the foreign GLib, and you get these errors. You can see from the log that the OBS build procedure has in fact done *both*: [ 83s] + PKG_CONFIG_PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/share/pkgconfig [ 83s] + export PKG_CONFIG_PATH and [ 83s] + declare -x PKG_CONFIG=/usr/bin/i686-w64-mingw32-pkg-config [ 83s] + export PKG_CONFIG (In reply to Ralf Habacker from comment #2) > So I recreated a fresh build dir and did run > > ../dbus/autogen.sh --host=i686-w64-mingw32 --build=x86_64-suse-linux-gnu > --target=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/sys-root/mingw > --exec-prefix=/usr/i686-w64-mingw32/sys-root/mingw > --bindir=/usr/i686-w64-mingw32/sys-root/mingw/bin > --sbindir=/usr/i686-w64-mingw32/sys-root/mingw/sbin > --sysconfdir=/usr/i686-w64-mingw32/sys-root/mingw/etc > --datadir=/usr/i686-w64-mingw32/sys-root/mingw/share > --includedir=/usr/i686-w64-mingw32/sys-root/mingw/include > --libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib > --libexecdir=/usr/i686-w64-mingw32/sys-root/mingw/libexec > --localstatedir=/usr/i686-w64-mingw32/sys-root/mingw/var > --sharedstatedir=/usr/i686-w64-mingw32/sys-root/mingw/com > --mandir=/usr/i686-w64-mingw32/sys-root/mingw/share/man > --infodir=/usr/i686-w64-mingw32/sys-root/mingw/share/info > --enable-maintainer-mode --disable-static --enable-verbose-mode > --enable-embedded-tests --enable-checks --enable-asserts --disable-xml-docs > --disable-doxygen-docs > > and got still the same error. For your information, you don't need *all* those directory options: the OBS build system is putting them in for completeness, but --prefix=/usr/i686-w64-mingw32/sys-root/mingw (or even just --prefix=/mingw) should be enough. You also don't need --target, because dbus is not a compiler (again, OBS is just putting it in for completeness). However, you do need to set up pkg-config to be looking in the right place for libraries. The simplest way is as I described in Comment #1. (In reply to Simon McVittie from comment #3) > This is not a D-Bus bug, as far as I can see. > > > > ../dbus/autogen.sh --host=i686-w64-mingw32 --build=x86_64-suse-linux-gnu > > --target=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/sys-root/mingw > > --exec-prefix=/usr/i686-w64-mingw32/sys-root/mingw > > --bindir=/usr/i686-w64-mingw32/sys-root/mingw/bin > > --sbindir=/usr/i686-w64-mingw32/sys-root/mingw/sbin > > --sysconfdir=/usr/i686-w64-mingw32/sys-root/mingw/etc > > --datadir=/usr/i686-w64-mingw32/sys-root/mingw/share > > --includedir=/usr/i686-w64-mingw32/sys-root/mingw/include > > --libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib > > --libexecdir=/usr/i686-w64-mingw32/sys-root/mingw/libexec > > --localstatedir=/usr/i686-w64-mingw32/sys-root/mingw/var > > --sharedstatedir=/usr/i686-w64-mingw32/sys-root/mingw/com > > --mandir=/usr/i686-w64-mingw32/sys-root/mingw/share/man > > --infodir=/usr/i686-w64-mingw32/sys-root/mingw/share/info > > --enable-maintainer-mode --disable-static --enable-verbose-mode > > --enable-embedded-tests --enable-checks --enable-asserts --disable-xml-docs > > --disable-doxygen-docs > > > > and got still the same error. This bug has been introduced with dbus-1.10. Compiling dbus-1.8 branch with the same configure line do not show this compile error :-( (In reply to Simon McVittie from comment #3) > [ 83s] + > PKG_CONFIG_PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686- > w64-mingw32/sys-root/mingw/share/pkgconfig > [ 83s] + export PKG_CONFIG_PATH > > and > > [ 83s] + declare -x PKG_CONFIG=/usr/bin/i686-w64-mingw32-pkg-config > [ 83s] + export PKG_CONFIG > For the record: pkgconfig uses cross pkg-config and looks okay. S["PKG_CONFIG"]="/usr/bin/i686-w64-mingw32-pkg-config" (In reply to Ralf Habacker from comment #5) > (In reply to Simon McVittie from comment #3) > > > [ 83s] + > > PKG_CONFIG_PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686- > > w64-mingw32/sys-root/mingw/share/pkgconfig > > [ 83s] + export PKG_CONFIG_PATH > > > > and > > > > [ 83s] + declare -x PKG_CONFIG=/usr/bin/i686-w64-mingw32-pkg-config > > [ 83s] + export PKG_CONFIG > > > > For the record: pkgconfig uses cross pkg-config and looks okay. > S["PKG_CONFIG"]="/usr/bin/i686-w64-mingw32-pkg-config" and running for i in $(/usr/bin/i686-w64-mingw32-pkg-config --list-all | gawk '{ print $1}'); do /usr/bin/i686-w64-mingw32-pkg-config --cflags $i; done | grep /usr/include do not return any reference of /usr/include. It looks that with dbus-1.10 autotools build system introduces hardcoded /usr/include pathes regardless of choosen build target platform. (In reply to Ralf Habacker from comment #6) > It looks that with dbus-1.10 autotools build system introduces hardcoded > /usr/include pathes regardless of choosen build target platform. After switching back to dbus-1.10 after the dbus-1.8 recompile I got the error again once and then no more. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.