[MacPorts] #71265: Adding pthread_[f]chdir_np to legacy-support - contribution guidelines?

MacPorts noreply at macports.org
Sun Nov 10 14:46:54 UTC 2024


#71265: Adding pthread_[f]chdir_np to legacy-support - contribution guidelines?
-----------------------------+--------------------
  Reporter:  RJVB            |      Owner:  (none)
      Type:  enhancement     |     Status:  new
  Priority:  Normal          |  Milestone:
 Component:  ports           |    Version:
Resolution:                  |   Keywords:
      Port:  legacy-support  |
-----------------------------+--------------------
Description changed by RJVB:

Old description:

> I have come across an application (not currently in MacPorts; Firefox
> Dynasty for "legacy" systems)  that can make an unprotected call to
> `pthread_chdir_np` or `pthread_fchdir_np`, two functions that were
> introduced in 10.12 but were available as syscalls from 10.5 onwards.
>
> Based on
> [https://chromium.googlesource.com/chromium/src/+/6eb6d90fa2ce1ff368e7d0088c734a7bc1c8eabd/base/process/launch_mac.cc#96
> old Chromium code] it should be possible to provide these functions on
> 10.11 and earlier with a pair of simple wrappers:
>
> {{{
> int pthread_chdir_np(const char* dir)
> {
>   return syscall(SYS___pthread_chdir, dir);
> }
>
> int pthread_fchdir_np(int fd)
> {
>   return syscall(SYS___pthread_fchdir, fd);
> }
> }}}
>
> I realise `port:legacy-support` is mainly intended for use with MacPorts
> and doesn't aim to provide every possible missing symbol, so I'd be
> perfectly happy with some guidelines or pointers how to add these 2
> wrappers the proper way in a personal fork of the repo (i.e. in such a
> way that they only get included on 10.11 and earlier).
>
> Reason I'm filing a trac ticket is that there is no dedicated issue
> tracker, and the application in question could make a valuable new port
> for other owners of retro systems (i.e. Firefox v132 that runs on at
> least 10.8 and up).
>

> (I did try to contribute a patch "upstream" but let's just say that my
> efforts weren't appreciated and the maintainer not particularly
> interested in bug reports.)

New description:

 I have come across an application (not currently in MacPorts; Firefox
 Dynasty for "legacy" systems)  that can make an unprotected call to
 `pthread_chdir_np` or `pthread_fchdir_np`, two functions that were
 introduced in 10.12 but were available as syscalls from 10.5 onwards.

 Based on
 [https://chromium.googlesource.com/chromium/src/+/6eb6d90fa2ce1ff368e7d0088c734a7bc1c8eabd/base/process/launch_mac.cc#96
 old Chromium code] it should be possible to provide these functions on
 10.11 and earlier with a pair of simple wrappers:

 {{{
 int pthread_chdir_np(const char* dir)
 {
   return syscall(SYS___pthread_chdir, dir);
 }

 int pthread_fchdir_np(int fd)
 {
   return syscall(SYS___pthread_fchdir, fd);
 }
 }}}

 I realise `port:legacy-support` is mainly intended for use with MacPorts
 and doesn't aim to provide every possible missing symbol, so I'd be
 perfectly happy with some guidelines or pointers how to add these 2
 wrappers the proper way in a personal fork of the repo (i.e. in such a way
 that they only get included on 10.11 and earlier).

 EDIT: I attached a proof of concept implementation that works for me on
 10.9 , based on my understanding of the implementation for other added
 symbols.

 Reason I'm filing a trac ticket is that there is no dedicated issue
 tracker, and the application in question could make a valuable new port
 for other owners of retro systems (i.e. Firefox v132 that runs on at least
 10.8 and up).


 (I did try to contribute a patch "upstream" but let's just say that my
 efforts weren't appreciated and the maintainer not particularly interested
 in bug reports but more in calling names on here).

--

-- 
Ticket URL: <https://trac.macports.org/ticket/71265#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list