Project

General

Profile

Bug #8123

developer/git build fails with GCC on SPARC

Added by Gary Mills over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
OI-Userland
Target version:
-
Start date:
2017-04-28
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

A build of the developer/git component with GCC on SPARC hardware failed with this error message:

CURL_SIZEOF_LONG definition is missing!

This error was caused by the /usr/include/curl/curlbuild.h header file which assumes that only the Studio compiler runs on SPARC hardware. Patching the http.h header, in the git source, to define __SUNPRO_C immediately before including curl/curl.h, and to undefine it immediately afterward, fixes the problem.

History

#1

Updated by Alexander Pyhalov over 2 years ago

That's strange. I see in web/curl/patches/001-culbuild.h.patch:

#elif defined(GNUC)
# if defined(sun) || defined(sun) || defined(_sun)
# include <stdint.h>
# include <sys/types.h>
# include <sys/socket.h>
# define CURL_TYPEOF_CURL_OFF_T off_t
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
# if defined(x86_64) || defined(sparcv9)
# define CURL_SIZEOF_CURL_OFF_T 8
# define CURL_SIZEOF_LONG 8
# define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_FORMAT_OFF_T "%ld"
# define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL
# else /* (
_i386) || (sparc) /
# define CURL_SIZEOF_LONG 4
# if FILE_OFFSET_BITS == 64 && _LARGEFILE_SOURCE != 0
# define CURL_SIZEOF_CURL_OFF_T 8
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_FORMAT_OFF_T "%lld"
# define CURL_SUFFIX_CURL_OFF_T LL
# define CURL_SUFFIX_CURL_OFF_TU ULL
# else
# define CURL_SIZEOF_CURL_OFF_T 4
# define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_FORMAT_OFF_T "%ld"
# define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL
# endif
# endif
# else /
!((sun) || (_sun) || (__sun
)) */

If something is wrong with curl on SPARC, the correct approach is to patch curl.

#2

Updated by Gary Mills over 2 years ago

Yes, that patch fixes the problem with that header. However, the package available for oi_151a8 does not have the patch applied. The change I'm proposing does permit the developer/git to build under oi_151a8. It's tightly conditioned like this:

#if defined(GNUC) && defined(__sparc) && (LIBCURL_VERSION_NUM < 0x073201)

I tried submitting a PR, but it wouldn't merge automatically. I deleted it. I'll try again later.

Also available in: Atom PDF