hiya, I'm making a toy compiler with cranelift, and I'm running into this error
/usr/sbin/ld: out.o: warning: relocation against `exit@@GLIBC_2.2.5' in read-only section `.text'
/usr/sbin/ld: warning: creating DT_TEXTREL in a PIE
I can, I guess, just ignore these, since my executable works anyway, but I'd like to address it eventually. what's the best way to do that? from what I can gather, it seems I need cranelift to generate calls to library functions differently, but I'm not sure how to accomplish that. or maybe I need to do something else entirely, not sure. I'm just linking with gcc out.o -o out
, but I did try -fno-pie
and it produced the same error
Hi @ThatsNoMoon, I'm not completely sure how the linkage works in the static-AOT case, but @bjorn3 might know better (how does cg_clif generate external symbol refs)?
cg_clif simply uses declare_function
with Linkage::Import
.
bjorn3 said:
cg_clif simply uses
declare_function
withLinkage::Import
.
that's also what I did... do you think I might need to link differently? I wish I knew more about how linking works lol
Is the code available somewhere?
Do you set the is_pic
flag when building the TargetIsa
?
sorry for the late reply, I had to fix a lot of other things before I could get back to this, but that fixed it! thanks!
Last updated: Nov 22 2024 at 16:03 UTC