After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753745 - glib-genmarshal still needed for cross-compilation
glib-genmarshal still needed for cross-compilation
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: build
2.45.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-08-18 09:15 UTC by Miha
Modified: 2015-09-01 14:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Drop binary checks when cross-compiling (6.54 KB, patch)
2015-08-19 12:52 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
gio: Link against gmodule when building glib-compile-resources (831 bytes, patch)
2015-08-19 12:52 UTC, Emmanuele Bassi (:ebassi)
none Details | Review
gio: Link against gmodule when building tools (1.89 KB, patch)
2015-08-19 13:05 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
Build log of cross-compilation on i686 for ARM target (44.27 KB, application/x-compressed-tar)
2015-08-25 14:00 UTC, Miha
  Details
Build log of cross-compilation on i686 for x86_64 target (53.10 KB, application/x-compressed-tar)
2015-08-25 14:02 UTC, Miha
  Details

Description Miha 2015-08-18 09:15:42 UTC
When I am cross compiling glib, the configure step fails, because I don't have glib-genmarshal installed on my build machine. This should not happen because according to commit [1] and bug report #652168 [2], glib-genmarshal is no longer needed for building glib. When I am doing a normal build (i.e. not cross-compiling), glib-genmarshal is in fact not needed, but when I am cross compiling, configure step fails if there is no glib-genmarshal.

Here is the configure command that fails on my build machine:

./configure --build=i686-linux-gnu --host=arm-linux-gnueabihf glib_cv_stack_grows=no glib_cv_uscore=no ac_cv_func_posix_getpwuid_r=no ac_cv_func_posix_getgrgid_r=no

I guess that same problem appears on more normal setups. When I cross compile on my private machine with --host=i686-linux-gnu and --build=x86_64-linux-gnu, the configure step successfully finds glib-genmarshal, because I have it installed. But that is besides the point - the glib-genmarshal should not be needed at all for (cross-)compilation.

[1] https://git.gnome.org/browse/glib/commit/?id=b74e2a7
[2] https://bugzilla.gnome.org/show_bug.cgi?id=652168
Comment 1 Miha 2015-08-18 09:18:11 UTC
Here is the relevant part of the configure output:


...
checking for broken poll... no (cross compiling)
checking whether compiler understands -Wno-pointer-sign... yes
checking for EILSEQ... yes
checking for glib-genmarshal... no
configure: error: Could not find a glib-genmarshal in your PATH
...
Comment 2 Emmanuele Bassi (:ebassi) 2015-08-19 12:52:20 UTC
Created attachment 309573 [details] [review]
Drop binary checks when cross-compiling

We don't need to run binaries we just built in order to successfully
build GLib and friends any more.

Since commit b74e2a7, we don't need to run glib-genmarshal when building
GIO; since commit f9eb9eed, all our tests (including the ones that do
need to run binaries we just built) are only built when running "make
check", instead of unconditionally at every build.

This means that we don't need to check for existing, native binaries
when cross-compiling, and fail the configuration step if they are not
found — which also means that you don't need to natively build GLib for
your toolchain, in order to cross-compile GLib.

We can also use the cross-compilation conditional, and skip those tests
that require a binary we just built in order to build.
Comment 3 Emmanuele Bassi (:ebassi) 2015-08-19 12:52:26 UTC
Created attachment 309574 [details] [review]
gio: Link against gmodule when building glib-compile-resources

Otherwise cross-compilation will fail with linker errors.
Comment 4 Emmanuele Bassi (:ebassi) 2015-08-19 13:05:27 UTC
Created attachment 309580 [details] [review]
gio: Link against gmodule when building tools

Otherwise cross-compilation will fail with linker errors.
Comment 5 Colin Walters 2015-08-19 20:43:51 UTC
Review of attachment 309573 [details] [review]:

Sold.  And great commit message.
Comment 6 Colin Walters 2015-08-19 20:48:15 UTC
Review of attachment 309580 [details] [review]:

Hum...confused what this has to do with cross-compilation.  Are you sure it isn't that the target platform has -Wl,--as-needed in the default LDFLAGS?

gmodule.la is Requires.private in the PC file.  I'd be a little surprised if glib-compile-resources really needed it for example.

It's not really a big deal to add it though, so if this makes your build work I'm not going to object.
Comment 7 Miha 2015-08-20 14:17:20 UTC
If I apply both patches (attachment 309573 [details] [review] and attachment 309580 [details] [review]), then I can successfully cross compile on i686-linux-gnu for both x86_64-linux-gnu and arm-linux-gnueabihf.

If I use only the glib-genmarshal patch (attachment 309573 [details] [review]), then cross-compilation on i686-linux-gnu succeds for x86_64-linux-gnu target (see http://pastebin.com/SxshPc5T), but fails for arm-linux-gnueabihf target (see http://pastebin.com/vdUSXNPw). In the latter case it complains that it can't find libgmodule-2.0.so.0.
Comment 8 Colin Walters 2015-08-21 13:16:12 UTC
If you're posting build logs, please use `make V=1` so people can see the exact compiler flags used.
Comment 9 Miha 2015-08-25 14:00:22 UTC
Created attachment 309966 [details]
Build log of cross-compilation on i686 for ARM target

This is the verbose build log of cross-compilation on i686 for ARM when only the genmarshal patch is applied. The build fails.
Comment 10 Miha 2015-08-25 14:02:53 UTC
Created attachment 309967 [details]
Build log of cross-compilation on i686 for x86_64 target

This is the verbose build log of cross-compilation on i686 for x86_64 when only the genmarshal patch is applied. The build is a success.
Comment 11 Matthias Clasen 2015-09-01 14:40:45 UTC
Attachment 309573 [details] pushed as 5ce7091 - Drop binary checks when cross-compiling
Attachment 309580 [details] pushed as b04c565 - gio: Link against gmodule when building tools