Repository navigation
Commit f2e5bfe
committed
compiler: fix RC_ORACLE block — extern "C" only at namespace scope
Bug surfaced during Step 5 execution at HEAD 9cbf413:
/data/users/alexturner/phoenix/cpython/Python/jit/compiler.cpp:136:10:
error: expected unqualified-id
...:138:5: error: use of undeclared identifier 'rc_oracle_run'
Root cause: my push 44 W3 dispatcher (a99db92 Step 3.5, also in
6450421c93 amended → a99db92) declared `extern "C" int rc_oracle_run(...)`
inside the function body. C++17 [dcl.link] forbids linkage-specifications
in block scope — they may only appear at namespace scope.
Production builds (RC_ORACLE undefined) MASKED the bug because the
entire #ifdef block is absent; the linkage-specification only enters
the parser when RC_ORACLE is defined. push 44 gate caught nothing
because no python build defines RC_ORACLE.
Fix: move `extern "C" int rc_oracle_run(void *func);` to file scope
(line 32, between #include block and `namespace jit`), guarded by
the same #ifdef RC_ORACLE so production builds remain unaffected.
Inside the function body, just call rc_oracle_run() (now visible
via the file-scope declaration).
Verification:
- Production cmake --build phoenix_jit + make python: PASS, 0 errors
(RC_ORACLE undefined → both forward-decl and dispatcher absent)
- Out-of-band -DRC_ORACLE=1 compile of compiler.cpp:
PASS (3.2 MB compiler_rc_oracle.cpp.o), 0 errors
- nm production python | grep rc_oracle: 0 matches (Item python#15
falsifier still satisfied)
Push 45 (gate-script fix follow-up). Discovery + fix is itself the
push 44 W3 oracle's first real value: the synthetic-injection
infrastructure surfaced a real linkage bug in the dispatcher that
production gates would never have caught (RC_ORACLE not defined →
block absent → bug invisible).1 parent 9cbf413 commit f2e5bfe
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| |||
133 | 140 | | |
134 | 141 | | |
135 | 142 | | |
136 | | - | |
| 143 | + | |
| 144 | + | |
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
| |||
0 commit comments