git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Unable to cross compile git. http.c generating errors.
@ 2023-05-06 18:38 PEEX Gamer
  2023-05-11  3:39 ` Bagas Sanjaya
  2023-05-11  6:28 ` Jeff King
  0 siblings, 2 replies; 3+ messages in thread
From: PEEX Gamer @ 2023-05-06 18:38 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 951 bytes --]

I was trying to compile git for x86_64 FreeBSD 13.2 on x86_64 linux
without any success.
I was using clang toolchain that worked for native Freebsd 13.2 compilation.
The errors i had:
First thing was that config.mak.uname was trying to include sysinfo
because of host machine being linux which was weird. I ommited this
error by replacing linux section with freebsd and everythink was
smooth until http.c which generates output attached in email. Why
would somethink like this happen when same code was compiled with
success on FreeBSD machine but for some reason it can't cross compile.
stdio.h come from official FreeBSD 13.2 base. I checked also when was
http.c modified but this part is like that for last 5 years. Looks
like i might have done somethink wrong with my toolchain but the same
toolchain generated working tests (i ran them on FreeBSD machine,
worth noting that this tests were using stdio.h) and also built
working curl from source.

[-- Attachment #2: error_stdio.PNG --]
[-- Type: image/png, Size: 9929 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unable to cross compile git. http.c generating errors.
  2023-05-06 18:38 Unable to cross compile git. http.c generating errors PEEX Gamer
@ 2023-05-11  3:39 ` Bagas Sanjaya
  2023-05-11  6:28 ` Jeff King
  1 sibling, 0 replies; 3+ messages in thread
From: Bagas Sanjaya @ 2023-05-11  3:39 UTC (permalink / raw)
  To: PEEX Gamer, git; +Cc: Junio C Hamano, Masaya Suzuki

[-- Attachment #1: Type: text/plain, Size: 1438 bytes --]

On Sat, May 06, 2023 at 08:38:40PM +0200, PEEX Gamer wrote:
> I was trying to compile git for x86_64 FreeBSD 13.2 on x86_64 linux
> without any success.
> I was using clang toolchain that worked for native Freebsd 13.2 compilation.
> The errors i had:
> First thing was that config.mak.uname was trying to include sysinfo
> because of host machine being linux which was weird. I ommited this
> error by replacing linux section with freebsd and everythink was
> smooth until http.c which generates output attached in email. Why
> would somethink like this happen when same code was compiled with
> success on FreeBSD machine but for some reason it can't cross compile.
> stdio.h come from official FreeBSD 13.2 base. I checked also when was
> http.c modified but this part is like that for last 5 years. Looks
> like i might have done somethink wrong with my toolchain but the same
> toolchain generated working tests (i ran them on FreeBSD machine,
> worth noting that this tests were using stdio.h) and also built
> working curl from source.

I don't see the error message unless I open this email on Thunderbird
(you attach it as image instead of copy-paste from terminal). Please
show us the error.

Anyway, the culprit line is introduced by e6cf87b12d (http: enable
keep_error for HTTP requests, 2019-01-10), so I Cc: the commit author.

Thanks.

-- 
An old man doll... just what I always wanted! - Clara

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unable to cross compile git. http.c generating errors.
  2023-05-06 18:38 Unable to cross compile git. http.c generating errors PEEX Gamer
  2023-05-11  3:39 ` Bagas Sanjaya
@ 2023-05-11  6:28 ` Jeff King
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff King @ 2023-05-11  6:28 UTC (permalink / raw)
  To: PEEX Gamer; +Cc: git

On Sat, May 06, 2023 at 08:38:40PM +0200, PEEX Gamer wrote:

> I was trying to compile git for x86_64 FreeBSD 13.2 on x86_64 linux
> without any success.
> I was using clang toolchain that worked for native Freebsd 13.2 compilation.
> The errors i had:
> First thing was that config.mak.uname was trying to include sysinfo
> because of host machine being linux which was weird. I ommited this
> error by replacing linux section with freebsd and everythink was
> smooth until http.c which generates output attached in email. 

Looks like you're having problems with fileno() being passed a void
pointer. Try compiling with:

  make FILENO_IS_A_MACRO=Yes

That is generally set automatically on FreeBSD via config.mak.uname;
perhaps you missed it when moving things around there.

I've never tried cross-compiling Git, but I'd guess that your best bet
is to override the uname_* variables, like:

  make uname_S=FreeBSD uname_R=13.2

(there are others, but those are the main ones we use to set defaults
for various Makefile knobs). Of course you can tweak all the Makefile
knobs yourself, but that may be tedious.

-Peff

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-11  6:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-06 18:38 Unable to cross compile git. http.c generating errors PEEX Gamer
2023-05-11  3:39 ` Bagas Sanjaya
2023-05-11  6:28 ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).