~sircmpwn/hare-users

2 2

harec generates impossible relocations on riscv64

Andreas Schwab <schwab@suse.de>
Details
Message ID
<mvmwmf5nvgg.fsf@suse.de>
DKIM signature
pass
Download raw message
The hare-libnotify package fails to build on riscv64:

https://build.opensuse.org/package/live_build_log/openSUSE:Factory:RISCV/hare-libnotify/standard/riscv64

cc      /home/abuild/rpmbuild/BUILD/hare-libnotify-1.0.0/cmd/notify-send.ha
/usr/lib64/gcc/riscv64-suse-linux/14/../../../../riscv64-suse-linux/bin/ld: unresolvable R_RISCV_PCREL_HI20 relocation against symbol `environ@@GLIBC_2.27'
collect2: error: ld returned 1 exit status
cc for /home/abuild/rpmbuild/BUILD/hare-libnotify-1.0.0/cmd/notify-send.ha exited with status 1
make: *** [Makefile:18: notify-send] Error 255

The problem is that environ is an external symbol, so you cannot use a
pc-relative relocation for it.  It must either use the GOT (for PIC) or
absolute relocation (for non-PIC).

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Details
Message ID
<D6XEZQXX7C4C.3GSP1ICYMUF0J@cmpwn.com>
In-Reply-To
<mvmwmf5nvgg.fsf@suse.de> (view parent)
DKIM signature
pass
Download raw message
You should probably reach out to the maintainer of libnotify about this,
unless you can reproduce this on more Hare libraries/programs.
Andreas Schwab <schwab@suse.de>
Details
Message ID
<mvmikqonrw5.fsf@suse.de>
In-Reply-To
<D6XEZQXX7C4C.3GSP1ICYMUF0J@cmpwn.com> (view parent)
Sender timestamp
1736426010
DKIM signature
pass
Download raw message
On Jan 09 2025, Drew DeVault wrote:

> You should probably reach out to the maintainer of libnotify about this,
> unless you can reproduce this on more Hare libraries/programs.

The reference is coming from rt/+linux/start+libc.ha, this has nothing
to do with libnotify.

$ cat helloha.ha 
use fmt;
export fn main() void = {
  fmt::printfln("Hello World!")!;
};
$ hare build -v -lc helloha.ha
cc      /tmp/helloha.ha
/usr/lib64/gcc/riscv64-suse-linux/14/../../../../riscv64-suse-linux/bin/ld: unresolvable R_RISCV_PCREL_HI20 relocation against symbol `environ@@GLIBC_2.27'
collect2: error: ld returned 1 exit status
cc for /tmp/helloha.ha exited with status 1

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Reply to thread Export thread (mbox)