git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] build: fix FreeBSD build when sysinfo compat library installed

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 7, 2025, 15:40 UTC
Message-ID
<xmqqzfdg3t78.fsf@gitster.g>
In-Reply-To
<CAPig+cTybBgkwFEsMVNNu2o1w9T5qnhau4chvGU2opEPJO78zg@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 20 quoted lines
>>     need to link a separate library (-lsysinfo). (This would require
>>     a similar change to meson.build).
>>
>>   - change the order of the preprocessor conditionals in the total_ram()
>>     function in 'builtin/gc.c', so that the *BSD sysctl() function
>>     (in the HAVE_BSD_SYSCTL block) takes priority over the sysinfo()
>>     function (in the HAVE_SYSINFO block).
>>
>>   - suppress the setting of HAVE_SYSINFO when HAVE_BSD_SYSCTL has been
>>     defined (in both configure.ac and meson.build).
>> ...
>> The second solution would only be required by the autoconf and meson
>> build systems, the Makefile already sets the build variables to the
>> required values (since they are not 'auto-detected').
> ...
> The final solution is almost certainly good enough (and is definitely
> simple), although the second solution has the benefit that it "fixes"
> the problem once and for all even if someone defines both
> HAVE_BSD_SYSCTL and HAVE_SYSINFO (say, in config.mak), assuming I'm
> understanding correctly.
Yeah, I think I agree with this assessment.
Show 8 quoted lines
>> In order to fix the FreeBSD build, move the sysinfo() check after the
>> determination of the HAVE_BSD_SYSCTL build variable, suppressing the
>> setting of HAVE_SYSINFO if HAVE_BSD_SYSCTL is defined. Apply this logic
>> to both the configure.ac and meson.build file.
>
> Nicely described. I wasn't really following along with the discussion,
> but this commit message summarizes the situation well, so I can
> understand the reason for the change and (I hope) the implications.
Agreed.  Thanks, all.
Previous: Eric SunshineNext: Ramsay Jones
Message 3 of 6 in “build: fix FreeBSD build when sysinfo compat library installed”
  1. build: fix FreeBSD build when sysinfo compat library installedRamsay Jones, Jul 4, 2025
  2. Eric SunshineJul 4, 2025
  3. Junio C HamanoJul 7, 2025
  4. Ramsay JonesJul 7, 2025
  5. Ramsay JonesJul 7, 2025
  6. Junio C HamanoJul 7, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.