~xoich

Recent activity

Re: Build error when linking with libc on Void Linux aarch64-musl a month ago

From xoich to ~sircmpwn/hare-users

About the linker relocation error obtained on a normal build they answered me on the QBE mailing list. It is solved by adding -no-pie to the cc command. Not entirely sure why it fixes the problem, but maybe it's an idea to add this option to the cc command? (only on aarch64 perhaps).

Re: Linker relocation error when building on Void Linux aarch64-musl a month ago

From xoich to ~mpu/qbe

I have no errors with -no-pie on gcc, thank you!

Linker relocation error when building on Void Linux aarch64-musl a month ago

From xoich to ~mpu/qbe

Hello, I'm trying to build the example snippet in the homepage with qbe 1.0, I
get an error though:

        $ qbe -o out.s test.ssa
        $ cc out.s
        /bin/ld: /tmp/ccdbCNAD.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against
        symbol `printf' which may bind externally can not be used when making a
        shared object; recompile with -fPIC
        /bin/ld: /tmp/ccdbCNAD.o(.text+0x3c): unresolvable
        R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `printf'
        /bin/ld: final link failed: bad value
        collect2: error: ld returned 1 exit status

Let me know if you need any other info, thank you.

Re: Build error when linking with libc on Void Linux aarch64-musl a month ago

From xoich to ~sircmpwn/hare-users

I tried a little troubleshooting.  As suggested by gcc message I added
-fPIC or -fPIE to cc compilation command but it gave the same error.
I think it's because the rt module Hare is passing to cc is already
assembled as a non-position independent object (I verified this with
readelf).  I looked at the man of as but I don't find any -fpic option
for aarch64, so I'm not sure how to proceed with that.

Then I tried adding the -static option to cc and compilation worked!
Unfortunately all the resulting binaries segfault.  Running these with
gdb it seems that they are using the _start function provided by libc
instead of the one from Hare rt module. I'm not sure why or how to
change that.