Makes softmmu compile with clang at HEAD
PATCH 1/1 Makes softmmu compile with clang at HEAD
With clang at HEAD, linking fails with "undefined symbol:qemu_build_not_reached". It's because store_helper and helper_ret_stb_mmu are mutually recursive and clang inlined latter inside the former, making store_helper a recursive function and no longer fully inlineable preventing constant propogation.
--- accel/tcg/cputlb.c | 1 + 1 file changed, 1 insertion(+)
accel/tcg/cputlb.c +1 -0
@@ -2050,6 +2050,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,store_memop (haddr, val, op); } +__attribute__((noinline))void helper_ret_stb_mmu (CPUArchState *env,target_ulong addr,uint8_t val,TCGMemOpIdx oi,uintptr_t retaddr) {
Signature · 1 line
2.25.1.481.gfbce0eb801-goog
Ping.
Quoted 28 lines · Shu-Chun Weng
With clang at HEAD, linking fails with "undefined symbol:
qemu_build_not_reached". It's becausestore_helperandhelper_ret_stb_mmuare mutually recursive and clang inlined latter inside the former, makingstore_helpera recursive function and no longer fully inlineable preventing constant propogation.Signed-off-by Shu-Chun Weng <[email protected]>--- accel/tcg/cputlb.c | 1 + 1 file changed, 1 insertion(+)accel/tcg/cputlb.c +1
-0@@ -2050,6 +2050,7 @@ store_helper(CPUArchState *env, target_ulong addr,uint64_t val,store_memop (haddr ,val ,op ); } +__attribute__((noinline))void helper_ret_stb_mmu (CPUArchState *env,target_ulong addr,uint8_t val,TCGMemOpIdx oi,uintptr_t retaddr){
--
2.25.1.481.gfbce0eb801-goog
Quoted 16 lines · Shu-Chun Weng
With clang at HEAD, linking fails with "undefined symbol:
qemu_build_not_reached". It's becausestore_helperandhelper_ret_stb_mmuare mutually recursive and clang inlined latter inside the former, makingstore_helpera recursive function and no longer fully inlineable preventing constant propogation.Signed-off-by Shu-Chun Weng <[email protected]>--- accel/tcg/cputlb.c | 1 + 1 file changed, 1 insertion(+)accel/tcg/cputlb.c +0
-0
accel/tcg/cputlb.c store_helper(CPUArchState *env, target_ulong addr, uint64_t val, · line 2055
Quoted 6 lines
accel/tcg/cputlb.c +1
-0@@ -2050,6 +2050,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,store_memop (haddr, val, op); } +__attribute__((noinline))void helper_ret_stb_mmu (CPUArchState *env,target_ulong addr,uint8_t val,TCGMemOpIdx oi,uintptr_t retaddr)
Hmm I wonder if the correct fix is for store_helper to callL
store_memop(addr + i, val8, MO_UB);
direct in the fallback case - although the page crossing may be tricky to get right. Perhaps we should out of line all the unaligned stuff?
Signature · 1 line
Alex Bennée