Cannot cross compile 32-bit curl apps on x86_64

Bug #723739 reported by Mike Heffner
84
This bug affects 18 people
Affects Status Importance Assigned to Milestone
curl (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Cross compiling (-m32) a 32-bit application that relies on libcurl in a 64-bit host fails with:

In file included from /usr/include/curl/curl.h:35,
                 from ....:
/usr/include/curl/curlrules.h:143: error: size of array '__curl_rule_01__' is negative
/usr/include/curl/curlrules.h:153: error: size of array '__curl_rule_02__' is negative

This is due to libcurl's installation of a generated, architecture dependent, header file "curlbuild.h". Design decisions aside, I think the package should handle this so the user doesn't have to install a parallel installation of 32-bit libcurl to cross-compile curl apps.

One possible solution is to the use approach Fedora takes and install both curlbuild.h's side-by-side and switch on __WORDSIZE:

$ ls /usr/include/curl/curlbuild*
/usr/include/curl/curlbuild-32.h /usr/include/curl/curlbuild-64.h /usr/include/curl/curlbuild.h

$ cat /usr/include/curl/curlbuild.h
#include <bits/wordsize.h>

#if __WORDSIZE == 32
#include "curlbuild-32.h"
#elif __WORDSIZE == 64
#include "curlbuild-64.h"
#else
#error "Unknown word size"
#endif

There is also a forum thread discussing this same issue: http://ubuntuforums.org/showthread.php?t=1680426

Julian Taylor (jtaylor)
affects: ubuntu → curl (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in curl (Ubuntu):
status: New → Confirmed
Revision history for this message
meh (meh-deactivatedaccount) wrote :

This is prolly the same reason that the 32bit -dev package conflicts with the 64bit one.
Any chance for a fix?

Revision history for this message
Alessandro Ghedini (ghedo) wrote :

The fix would be to make the -dev packages multi-arch enabled too, but IMO it is a bit late in the Debian development cycle to do this kind of changes. The Ubuntu folks may want to do this anyway though. See [0] and [1] as an example fix.

[0] http://anonscm.debian.org/gitweb/?p=collab-maint/curl.git;a=commitdiff;h=2258d719
[1] http://anonscm.debian.org/gitweb/?p=collab-maint/curl.git;a=commitdiff;h=a808dd64

Revision history for this message
3t0g0 (freetogo) wrote :

Still not fixed?

Revision history for this message
Charles (charles-raymond) wrote :
Revision history for this message
Vadim Kotov (kotov) wrote :

Issue in curl's Github repo -- https://github.com/curl/curl/issues/1456

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.