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

Missing $INODE64 versions for readdir_r and fdopendir? #1

Closed
dkegel-fastly opened this issue Feb 18, 2022 · 3 comments
Closed

Missing $INODE64 versions for readdir_r and fdopendir? #1

dkegel-fastly opened this issue Feb 18, 2022 · 3 comments

Comments

@dkegel-fastly
Copy link

Over in tinygo, tinygo-org/tinygo#2644 shows two interesting errors:

ld.lld: error: undefined symbol: _readdir_r$INODE64
tinygo:ld.lld: error: undefined symbol: _fdopendir$INODE64

Those errors go away if you revert tinygo-org/tinygo#2586

Those function calls have been in use since tinygo-org/tinygo#2499 landed.

@aykevl
Copy link
Member

aykevl commented Feb 19, 2022

Shorter reproducer: GOOS=darwin tinygo test -c compress/flate

aykevl added a commit that referenced this issue Feb 19, 2022
This header is needed for better TinyGo support.
For details, see: #1
@aykevl
Copy link
Member

aykevl commented Feb 19, 2022

Fixed with ebb736f. It was basically just a matter of adding the dirent.h header file.

@aykevl
Copy link
Member

aykevl commented Feb 19, 2022

In case such issues occur in the future, these are the steps I took:

  • I looked up the header file for the missing symbols. For both readdir_r and fdopendir it is <dirent.h>.
  • I added this header to src/libSystem.h.
  • I ran ./update.sh to update all generated files.
  • I found that sys/dirent.h was missing. I found it in the XNU source code, so I added that header to update.sh
  • I re-ran ./update.sh. This time it succeeded.
  • I checked the generated code (to check that everything is under an open source license) and committed the result.

In some cases these header files need a bit more massaging, see update.sh.

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

No branches or pull requests

2 participants