fix(libSceLibcInternal): declare environ for the spawn test on macOS #11358

Merged
krishalivaibhav merged 1 commit from upstream-pr/11358 into main 2026-10-27 21:01:09 +00:00
krishalivaibhav commented 2026-10-26 08:12:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-26T08:12:10Z.


What

core/libs/tests/GuestPosixSpawn.cpp reads the host environ on every non-Windows host since 2bfcf6166a, but declares it only under __linux__. On macOS the test does not compile:

GuestPosixSpawn.cpp:234:38: error: use of undeclared identifier 'environ'

The declaration now covers every host except Windows, which keeps using _environ. Test-only change; Linux and Windows compile the same code as before.

Tested

macOS 27 on Apple Silicon M2, x86_64 Release under Rosetta 2, Apple clang, on main 14c99b52ac:

  • before: GuestPosixSpawn.cpp.o fails with the error above;
  • after: it compiles with 0 errors, and no warnings come from this file (the 7 warnings are from libc/include/Api.hpp and General.hpp, unchanged).

Not run: guest_posix_spawn itself. On current main the test program does not link on macOS, because libc's GuestAllocations.cpp needs <link.h> (fixed by #10366) and libkernel needs the open macOS PRs (#10552 and others). Linux and Windows were not rebuilt.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none to compile; running the test on macOS needs #10366 and #10552
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5014152546 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11358). Originally posted by [krishalivaibhav](https://github.com/krishalivaibhav) on 2026-10-26T08:12:10Z. --- ### What `core/libs/tests/GuestPosixSpawn.cpp` reads the host `environ` on every non-Windows host since `2bfcf6166a`, but declares it only under `__linux__`. On macOS the test does not compile: ``` GuestPosixSpawn.cpp:234:38: error: use of undeclared identifier 'environ' ``` The declaration now covers every host except Windows, which keeps using `_environ`. Test-only change; Linux and Windows compile the same code as before. ### Tested macOS 27 on Apple Silicon M2, x86_64 Release under Rosetta 2, Apple clang, on `main` 14c99b52ac: - before: `GuestPosixSpawn.cpp.o` fails with the error above; - after: it compiles with 0 errors, and no warnings come from this file (the 7 warnings are from `libc/include/Api.hpp` and `General.hpp`, unchanged). Not run: `guest_posix_spawn` itself. On current `main` the test program does not link on macOS, because libc's `GuestAllocations.cpp` needs `<link.h>` (fixed by #10366) and libkernel needs the open macOS PRs (#10552 and others). Linux and Windows were not rebuilt. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none to compile; running the test on macOS needs #10366 and #10552 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-26 08:15:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T08:15:47Z.

Review: APPROVED


Reviewed exact head 4580ed63016d647bbb032a49bb6dbeffdd01bfb0. The test references the host environ on POSIX hosts, so guarding its declaration with #ifndef _WIN32 matches the existing _environ path on Windows and exposes environ on macOS. The author reports the macOS test translation unit now compiles; I did not independently run AppleClang or the test binary. Hosted eligibility, conventions, intake and labels pass; product/relinker jobs are skipped by path policy. GuestPosixSpawn.cpp has not changed on main since this branch's base, and the current merge preview is clean.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5649079585 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11358#pullrequestreview-5649079585). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T08:15:47Z. **Review:** APPROVED --- Reviewed exact head `4580ed63016d647bbb032a49bb6dbeffdd01bfb0`. The test references the host `environ` on POSIX hosts, so guarding its declaration with `#ifndef _WIN32` matches the existing `_environ` path on Windows and exposes `environ` on macOS. The author reports the macOS test translation unit now compiles; I did not independently run AppleClang or the test binary. Hosted eligibility, conventions, intake and labels pass; product/relinker jobs are skipped by path policy. `GuestPosixSpawn.cpp` has not changed on main since this branch's base, and the current merge preview is clean.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!11358
No description provided.