[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Interest in a Cosmopolitan build?
From: |
Po Lu |
Subject: |
Re: Interest in a Cosmopolitan build? |
Date: |
Thu, 09 Nov 2023 08:00:58 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Alex Corcoles <alex@corcoles.net> writes:
> Hi,
>
>
>> Can you post the patches here? I'd prefer not to point people to
>> GitHub.
>
> Not sure if this will come out OK:
>
> 8< 8< 8< 8< 8< 8< 8< 8< 8< 8<
> --- ./emacs-29.1/src/config.in 2023-07-23 09:58:50.000000000 +0200
> +++ ./emacs-29.1/src/config.in.new 2023-11-05 10:42:18.274387041
> +0100
> @@ -1790,7 +1790,7 @@
> #undef INTERNAL_TERMINAL
>
> /* Define to read input using SIGIO. */
> -#undef INTERRUPT_INPUT
> +#undef INTERRUPT_INPUT0
>
> /* Returns true if character is any form of separator. */
> #undef IS_ANY_SEP
> @@ -2094,7 +2094,7 @@
> #undef UNIX98_PTYS
>
> /* Define to 1 if FIONREAD is usable. */
> -#undef USABLE_FIONREAD
> +#undef USABLE_FIONREAD0
Changing config.h is not correct, and it is automatically generated from
configure.ac at any rate. Corrections to macros defined in config.h
should be applied in the configury.
> /* Define to 1 if SIGIO is usable. */
> #undef USABLE_SIGIO
>
> --- ./emacs-29.1/src/filelock.c 2023-01-01 14:46:43.000000000 +0100
> +++ ./emacs-29.1/src/filelock.c.new 2023-11-04 17:53:19.163803983
> +0100
> @@ -298,7 +298,7 @@
> There is no way to tell whether a symlink call fails due to
> permissions issues or because links are not supported, but luckily
> the lock file code should work either way. */
> -enum { LINKS_MIGHT_NOT_WORK = EPERM };
> +#define LINKS_MIGHT_NOT_WORK EPERM
>
> /* Rename OLD to NEW. If FORCE, replace any existing NEW.
> It is OK if there are temporarily two hard links to OLD.
> @@ -498,17 +498,14 @@
>
> /* True if errno values are negative. Although the C standard
> requires them to be positive, they are negative in Haiku. */
> -enum { NEGATIVE_ERRNO = EDOM < 0 };
> +#define NEGATIVE_ERRNO (EDOM < 0)
>
> /* Nonzero values that are not errno values. */
> -enum
> - {
> - /* Another process on this machine owns it. */
> - ANOTHER_OWNS_IT = NEGATIVE_ERRNO ? 1 : -1,
> -
> - /* This Emacs process owns it. */
> - I_OWN_IT = 2 * ANOTHER_OWNS_IT
> - };
> +/* Another process on this machine owns it. */
> +#define ANOTHER_OWNS_IT (NEGATIVE_ERRNO ? 1 : -1)
> +
> +/* This Emacs process owns it. */
> +#define I_OWN_IT (2 * ANOTHER_OWNS_IT)
>
> /* Return 0 if nobody owns the lock file LFNAME or the lock is
> obsolete,
> ANOTHER_OWNS_IT if another process owns it
> 8< 8< 8< 8< 8< 8< 8< 8< 8< 8<
>
> The undef's I think clearly need to be solved in Cosmopolitan. The
> enums... I'm not so sure.
Why is that? errno values are constant expressions in Standard C, so
this is a deviation from it on the part of Cosmopolitan.
Now, furthermore, I see a more general shortcoming to this:
Emacs employs a statically linked library names gnulib that supplies
substitutes for operating system functions suffering from deficiencies.
To establish which substitutes must be applied, configure executes tests
for all known defects in various system functions. Since Cosmopolitan
binaries run on a variety of systems at once, these tests should be run
on all those systems, and the failures aggregated into a single
configuration file sourced from configure.ac. Absent these precautions,
the generated Emacs binary will not function properly.