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

Re: git no longer builds on SunOS 5.10, a report

From
Alejandro R. Sedeño <asedeno@mit.edu>
Date
Oct 13, 2024, 22:50 UTC
Message-ID
<CAOO-Oz2gN1Y9h-p_AJ=7iKzxOK2ShmgEmWzpFrpwwAD2GH=6TQ@mail.gmail.com>
In-Reply-To
<ZwwmFtF1Y30y8eoU@pks.im>
On Sun, Oct 13, 2024 at 3:57 PM Patrick Steinhardt <ps@pks.im> wrote:
Show 11 quoted lines
> diff --git a/t/unit-tests/clar/clar.c b/t/unit-tests/clar/clar.c
> index cef0f023c2..064ca5c2ea 100644
> --- a/t/unit-tests/clar/clar.c
> +++ b/t/unit-tests/clar/clar.c
> @@ -4,6 +4,10 @@
>   * This file is part of clar, distributed under the ISC license.
>   * For full terms see the included COPYING file.
>   */
> +
> +#define _DARWIN_C_SOURCE
> +#define _POSIX_C_SOURCE=200809L
token "=" is not valid in preprocessor expressions.

2008 postdates my available compiler by many years, so trying to define this is not going to get you everything you might expect here.

Fixing the #define to use a space and not = results in

/usr/include/sys/feature_tests.h:332:2: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"

The relevant bits of the header:
#if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
        and pre-2001 POSIX applications"
#elif !defined(_STDC_C99) && \
        (defined(__XOPEN_OR_POSIX) && defined(_XPG6))
#error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications \
        require the use of c99"
#endif
Removing `#define _POSIX_C_SOURCE 200809L` results in successful compilation.
Show 25 quoted lines
> +
>  #include <assert.h>
>  #include <setjmp.h>
>  #include <stdlib.h>
> @@ -271,9 +275,7 @@ static double clar_time_diff(clar_time *start, clar_time *end)
>
>  static void clar_time_now(clar_time *out)
>  {
> -       struct timezone tz;
> -
> -       gettimeofday(out, &tz);
> +       gettimeofday(out, NULL);
>  }
>
>  static double clar_time_diff(clar_time *start, clar_time *end)
> diff --git a/t/unit-tests/clar/clar/sandbox.h b/t/unit-tests/clar/clar/sandbox.h
> index e25057b7c4..b499d2e1e6 100644
> --- a/t/unit-tests/clar/clar/sandbox.h
> +++ b/t/unit-tests/clar/clar/sandbox.h
> @@ -122,7 +122,7 @@ static int build_sandbox_path(void)
>
>         if (mkdir(_clar_path, 0700) != 0)
>                 return -1;
> -#elif defined(__TANDEM)
> +#elif defined(__sunos) || defined(__TANDEM)
I think we want __sun here, not __sunos.
>         if (mktemp(_clar_path) == NULL)
>                 return -1;
>
-Alejandro
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 7 of 30 in “git no longer builds on SunOS 5.10, a report”
  1. Alejandro R. SedeñoOct 12, 2024
  2. Patrick SteinhardtOct 12, 2024
  3. Alejandro R. SedeñoOct 12, 2024
  4. Makefile: adjust sed command for generating "clar-decls.h"Alejandro R. Sedeño, Oct 12, 2024
  5. Alejandro R. SedeñoOct 12, 2024
  6. Patrick SteinhardtOct 13, 2024
  7. Alejandro R. SedeñoOct 13, 2024
  8. Patrick SteinhardtOct 14, 2024
  9. 0/2 t/unit-tests: improve clar platform compatibilityPatrick Steinhardt, Oct 14, 2024
  10. 1/2 t/unit-tests: update clar to 0810a36Patrick Steinhardt, Oct 14, 2024
  11. 2/2 Makefile: adjust sed command for generating "clar-decls.h"Patrick Steinhardt, Oct 14, 2024
  12. Toon ClaesOct 18, 2024
  13. Taylor BlauOct 18, 2024
  14. Patrick SteinhardtOct 21, 2024
  15. 0/5 t/unit-tests: improve clar platform compatibilityPatrick Steinhardt, Oct 21, 2024
  16. 1/5 t/unit-tests: update clar to 206accbPatrick Steinhardt, Oct 21, 2024
  17. 2/5 Makefile: adjust sed command for generating "clar-decls.h"Patrick Steinhardt, Oct 21, 2024
  18. Kristoffer HaugsbakkOct 21, 2024
  19. Patrick SteinhardtOct 21, 2024
  20. 3/5 Makefile: extract script to generate clar declarationsPatrick Steinhardt, Oct 21, 2024
  21. 4/5 cmake: fix compilation of clar-based unit testsPatrick Steinhardt, Oct 21, 2024
  22. 5/5 cmake: set up proper dependencies for generated clar headersPatrick Steinhardt, Oct 21, 2024
  23. Johannes SchindelinNov 5, 2024
  24. Phillip WoodNov 6, 2024
  25. Patrick SteinhardtNov 8, 2024
  26. Taylor BlauOct 21, 2024
  27. karthik nayakOct 25, 2024
  28. Bagas SanjayaOct 26, 2024
  29. Patrick SteinhardtOct 27, 2024
  30. Taylor BlauOct 27, 2024

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.