Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GNU/Hurd build fixes #316

Merged
merged 3 commits into from
Jul 21, 2024
Merged

GNU/Hurd build fixes #316

merged 3 commits into from
Jul 21, 2024

Conversation

pinotree
Copy link
Contributor

@pinotree pinotree commented Jun 9, 2024

This PR fixes the build of quickjs on GNU/Hurd:

  • use malloc_usable_size() when using glibc
  • use ftello() & fseeko() when using glibc (they could be used more, I took a conservative approach)
  • provide a fallback PATH_MAX if not available

See the messages of the various commits for longer explanations.

TooTallNate pushed a commit to TooTallNate/quickjs that referenced this pull request Jul 3, 2024
* Improve string parsing and JSON parsing

- fix JSON parsing of non ASCII string contents
- more precise string parsing errors
- more precise JSON parsing errors
- add `JS_ParseState::buf_start` to compute line/column
- fix HTML comment detection at start of source code
- improve v8 Failure messages (pulled and modified `formatFailureText` from **mjsunit.js**) 
- ignore more v8 tests
malloc_usable_size() is a GNU extension in GNU libc; hence, use it
every time GNU libc is used, rather than only on Linux.
Strictly speaking, they are available in POSIX.1-2008 [1][2], so they
could be used on more platforms/OSes. To be cautious, enable them when
using GNU libc, since they have been available with that libc for a
very long time.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftell.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/fseek.html
PATH_MAX is optional in POSIX, and it is not available on GNU/Hurd.
While it could be possible to not rely on PATH_MAX, for now provide a
fallback definition (which should be safe enough) to get quickjs built
on GNU/Hurd.
@chqrlie chqrlie merged commit 012451d into bellard:master Jul 21, 2024
13 checks passed
@pinotree pinotree deleted the hurd branch July 21, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants