{"thread":{"id":"59701","subject":"Unable to cross compile git. http.c generating errors.","startedAt":"2023-05-06T18:38:56Z","lastAt":"2023-05-11T06:28:34Z","messageCount":3,"participants":["PEEX Gamer","Bagas Sanjaya","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"476681","messageId":"CALpgS-OQzoopjKd2a3NBkaefHoqR_wLop5x3Y7U8e0eVUO7XJQ@mail.gmail.com","threadId":"59701","inReplyTo":null,"subject":"Unable to cross compile git. http.c generating errors.","fromName":"PEEX Gamer","fromEmail":"czupux@gmail.com","sentAt":"2023-05-06T18:38:40Z","receivedAt":"2023-05-06T18:38:56Z","isPatch":false,"sender":{"key":"czupux@gmail.com","avatar":null},"body":"I was trying to compile git for x86_64 FreeBSD 13.2 on x86_64 linux\nwithout any success.\nI was using clang toolchain that worked for native Freebsd 13.2 compilation.\nThe errors i had:\nFirst thing was that config.mak.uname was trying to include sysinfo\nbecause of host machine being linux which was weird. I ommited this\nerror by replacing linux section with freebsd and everythink was\nsmooth until http.c which generates output attached in email. Why\nwould somethink like this happen when same code was compiled with\nsuccess on FreeBSD machine but for some reason it can't cross compile.\nstdio.h come from official FreeBSD 13.2 base. I checked also when was\nhttp.c modified but this part is like that for last 5 years. Looks\nlike i might have done somethink wrong with my toolchain but the same\ntoolchain generated working tests (i ran them on FreeBSD machine,\nworth noting that this tests were using stdio.h) and also built\nworking curl from source.\n"},{"id":"477017","messageId":"ZFxjglvEHz9ESyRE@debian.me","threadId":"59701","inReplyTo":"CALpgS-OQzoopjKd2a3NBkaefHoqR_wLop5x3Y7U8e0eVUO7XJQ@mail.gmail.com","subject":"Re: Unable to cross compile git. http.c generating errors.","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2023-05-11T03:39:46Z","receivedAt":"2023-05-11T03:40:01Z","isPatch":false,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"On Sat, May 06, 2023 at 08:38:40PM +0200, PEEX Gamer wrote:\n> I was trying to compile git for x86_64 FreeBSD 13.2 on x86_64 linux\n> without any success.\n> I was using clang toolchain that worked for native Freebsd 13.2 compilation.\n> The errors i had:\n> First thing was that config.mak.uname was trying to include sysinfo\n> because of host machine being linux which was weird. I ommited this\n> error by replacing linux section with freebsd and everythink was\n> smooth until http.c which generates output attached in email. Why\n> would somethink like this happen when same code was compiled with\n> success on FreeBSD machine but for some reason it can't cross compile.\n> stdio.h come from official FreeBSD 13.2 base. I checked also when was\n> http.c modified but this part is like that for last 5 years. Looks\n> like i might have done somethink wrong with my toolchain but the same\n> toolchain generated working tests (i ran them on FreeBSD machine,\n> worth noting that this tests were using stdio.h) and also built\n> working curl from source.\n\nI don't see the error message unless I open this email on Thunderbird\n(you attach it as image instead of copy-paste from terminal). Please\nshow us the error.\n\nAnyway, the culprit line is introduced by e6cf87b12d (http: enable\nkeep_error for HTTP requests, 2019-01-10), so I Cc: the commit author.\n\nThanks.\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"477023","messageId":"20230511062824.GA1971463@coredump.intra.peff.net","threadId":"59701","inReplyTo":"CALpgS-OQzoopjKd2a3NBkaefHoqR_wLop5x3Y7U8e0eVUO7XJQ@mail.gmail.com","subject":"Re: Unable to cross compile git. http.c generating errors.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-05-11T06:28:24Z","receivedAt":"2023-05-11T06:28:34Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, May 06, 2023 at 08:38:40PM +0200, PEEX Gamer wrote:\n\n> I was trying to compile git for x86_64 FreeBSD 13.2 on x86_64 linux\n> without any success.\n> I was using clang toolchain that worked for native Freebsd 13.2 compilation.\n> The errors i had:\n> First thing was that config.mak.uname was trying to include sysinfo\n> because of host machine being linux which was weird. I ommited this\n> error by replacing linux section with freebsd and everythink was\n> smooth until http.c which generates output attached in email. \n\nLooks like you're having problems with fileno() being passed a void\npointer. Try compiling with:\n\n  make FILENO_IS_A_MACRO=Yes\n\nThat is generally set automatically on FreeBSD via config.mak.uname;\nperhaps you missed it when moving things around there.\n\nI've never tried cross-compiling Git, but I'd guess that your best bet\nis to override the uname_* variables, like:\n\n  make uname_S=FreeBSD uname_R=13.2\n\n(there are others, but those are the main ones we use to set defaults\nfor various Makefile knobs). Of course you can tweak all the Makefile\nknobs yourself, but that may be tedious.\n\n-Peff\n"}]}