Comments (18)
There is. Compile with this additional flag: USE_LD=ld
from amiberry.
So Amiberry internally chooses ld.gold?
In the Makefile.. USE_LD ?= gold
If ld.gold doesn't work on riscv64, that needs to be fixed (but I don't have riscv64 hardware)
from amiberry.
from amiberry.
Checking the file list, there is a gold
binary at least: https://packages.debian.org/sid/riscv64/binutils-riscv64-linux-gnu/filelist
/usr/bin/riscv64-linux-gnu-gold
But it is not in PATH:
root@Star64:~# which ld
/usr/bin/ld
root@Star64:~# which ld.gold
root@Star64:~# which gold
root@Star64:~#
root@Star64:~# ls -l /usr/bin/*ld*
-rwxr-xr-x 1 root root 35824 Jan 2 14:54 /usr/bin/fold
lrwxrwxrwx 1 root root 20 Dec 27 10:36 /usr/bin/ld -> riscv64-linux-gnu-ld
lrwxrwxrwx 1 root root 24 Dec 27 10:36 /usr/bin/ld.bfd -> riscv64-linux-gnu-ld.bfd
lrwxrwxrwx 1 root root 32 Dec 3 14:23 /usr/bin/ld.so -> /lib/ld-linux-riscv64-lp64d.so.1
-rwxr-xr-x 1 root root 5407 Dec 3 14:23 /usr/bin/ldd
-rwxr-xr-x 1 root root 14768 Dec 3 14:23 /usr/bin/pldd
lrwxrwxrwx 1 root root 24 Dec 27 10:36 /usr/bin/riscv64-linux-gnu-ld -> riscv64-linux-gnu-ld.bfd
-rwxr-xr-x 1 root root 2076792 Dec 27 10:36 /usr/bin/riscv64-linux-gnu-ld.bfd
Probably this would work?
ln -s riscv64-linux-gnu-gold /usr/bin/ld.gold
But it states that ld
is missing, not ld.gold
🤔.
from amiberry.
from amiberry.
Sadly that did not help.
from amiberry.
Perhaps the gold-linker doesn't work on risc-v? I don't have access to a risc-v machine, so I can't be sure.
from amiberry.
I guess so. Also this riscv64-linux-gnu-gold
actually does not exist in the package. There is a strange bug with the online file list (linked above): It is doubled, with a different list appended at the end of the actual (first) list. There are two /usr/bin
sections: The actual first one does not have that binary, only the repeated one below has. However, when you check the actual content of the package, only the first one is present:
root@Star64:~# ls -l /usr/bin/riscv64-linux-gnu-gold
ls: cannot access '/usr/bin/riscv64-linux-gnu-gold': No such file or directory
Hence makes sense that the symlink had no effect 😄.
I first thought the ones at the bottom are symlinks (which are commonly sorted below real files), but vast parts of the paths are indeed doubled, and those which are additionally present at the bottom are completely missing in the package.
Is there a way to tell g++
to use the actual ld
command pointing to /usr/bin/riscv64-linux-gnu-ld.bfd
, instead of ld.gold
?
from amiberry.
Confusing:
g++: error: unrecognized command-line option ‘-fuse-ld=ld’; did you mean ‘-fuse-ld=lld’?
Now I start to think that actually ld
is tried to be used already (somehow makes sense according to error message and it explicitly is the default linker), but is not possible to be used for some reason in this case with g++
. gold
might probably work, so I could try to define it explicitly as well, but went with the suggestion as I also read that the LLVM linker is quite a good replacement nowadays.
from amiberry.
Sorry, that should be USE_LD=ld.bfd
from amiberry.
Right, USE_LD=lld
cause the same error about missing "ld" as when not defining it.
from amiberry.
USE_LD=ld.bfd
worked 🎉 !
ldd
of course could not work, as it is not included in binutils
either, but a dedicated package ldd
.
So this means that neither gold
nor GNU ld
works with RISC-V in this case? Is there any theory why? And does it probably make sense to internally define USE_LD=ld.bfd
for this build target/the architecture, if it was not explicitly set differently, to prevent others from running into this error?
from amiberry.
Okay, while it compiles fine now, it does not yet run on my PINE64 Star64 SBC.
I use a kernel based on StarFive's Linux 6.1 build for the VisionFive 2, but rebased onto latest mainline Linux 6.1, and pulled on top the changes for the Star64 from Fishwaldo's repo, the only one I currently know for this SBC (as long as upstreaming from StarFive has not finished): https://github.com/Fishwaldo/Star64_linux
It runs, it starts X11 desktops using DRI, but in case of Amiberry it first throws something like:
MESA-LOADER: failed to open starfive: /usr/lib/dri/starfive_dri.so: cannot open shared object file: No such file or directory
I looked around and found this library provided in StarFive's Debian userspace repo: https://github.com/starfive-tech/Debian/blob/20221225T084846Z/gpu/DDK1.19-binary-xorg/IMG_GPU-xorg.tar.gz
This archive contains a lot of GPU/DRM/GL(ES) related libraries, and the missing one as well. Copied it in place, and now get:
did not find extension DRI_Mesa version 1
failed to bind extensions
Now I remember that I asked about this already some time ago on a RISC-V/StarFive forum: https://forum.rvspace.org/t/failed-to-open-starfive-usr-lib-dri-starfive-dri-so/2325
This is definitely no Amiberry issue. But if someone was able to get it running on VisionFive 2 or Star64, I would be interested. Surely this affects other applications as well.
Final solution is of course using mainline Linux, after everything has been upstreamed. But some components I do not want to miss are still missing, including DRM 😉: https://rvspace.org/en/project/JH7110_Upstream_Plan
from amiberry.
ld comes with binutils, and it comes in to "flavors" ld.bfd and ld.gold.
from amiberry.
Okay, and ld.bfd
is the default ld
:
root@VM-Trixie:~# ls -l /usr/bin/*ld*
-rwxr-xr-x 1 root root 43920 Sep 20 2022 /usr/bin/fold
lrwxrwxrwx 1 root root 21 Dec 27 10:36 /usr/bin/gold -> x86_64-linux-gnu-gold
lrwxrwxrwx 1 root root 34 Oct 2 16:11 /usr/bin/grub-ntldr-img -> ../lib/grub/i386-pc/grub-ntldr-img
lrwxrwxrwx 1 root root 19 Dec 27 10:36 /usr/bin/ld -> x86_64-linux-gnu-ld
lrwxrwxrwx 1 root root 23 Dec 27 10:36 /usr/bin/ld.bfd -> x86_64-linux-gnu-ld.bfd
lrwxrwxrwx 1 root root 24 Dec 27 10:36 /usr/bin/ld.gold -> x86_64-linux-gnu-ld.gold
lrwxrwxrwx 1 root root 27 Dec 3 14:23 /usr/bin/ld.so -> /lib64/ld-linux-x86-64.so.2
-rwxr-xr-x 1 root root 5348 Dec 3 14:23 /usr/bin/ldd
-rwxr-xr-x 1 root root 23232 Dec 3 14:23 /usr/bin/pldd
lrwxrwxrwx 1 root root 24 Dec 27 10:36 /usr/bin/x86_64-linux-gnu-gold -> x86_64-linux-gnu-ld.gold
lrwxrwxrwx 1 root root 23 Dec 27 10:36 /usr/bin/x86_64-linux-gnu-ld -> x86_64-linux-gnu-ld.bfd
-rwxr-xr-x 1 root root 1422768 Dec 27 10:36 /usr/bin/x86_64-linux-gnu-ld.bfd
-rwxr-xr-x 1 root root 3265248 Dec 27 10:36 /usr/bin/x86_64-linux-gnu-ld.gold
So Amiberry internally chooses ld.gold
? And that one is not available on riscv64
, currently:
root@Star64:~# ls -l /usr/bin/*ld*
-rwxr-xr-x 1 root root 35824 Jan 2 14:54 /usr/bin/fold
lrwxrwxrwx 1 root root 20 Dec 27 10:36 /usr/bin/ld -> riscv64-linux-gnu-ld
lrwxrwxrwx 1 root root 24 Dec 27 10:36 /usr/bin/ld.bfd -> riscv64-linux-gnu-ld.bfd
lrwxrwxrwx 1 root root 32 Dec 3 14:23 /usr/bin/ld.so -> /lib/ld-linux-riscv64-lp64d.so.1
-rwxr-xr-x 1 root root 5407 Dec 3 14:23 /usr/bin/ldd
-rwxr-xr-x 1 root root 14768 Dec 3 14:23 /usr/bin/pldd
lrwxrwxrwx 1 root root 24 Dec 27 10:36 /usr/bin/riscv64-linux-gnu-ld -> riscv64-linux-gnu-ld.bfd
-rwxr-xr-x 1 root root 2076792 Dec 27 10:36 /usr/bin/riscv64-linux-gnu-ld.bfd
Not sure if this is a Debian thing, or if gold
generally has issues with RISC-V and is not available on other distros as well.
from amiberry.
It seems so, though I fail to find some official info about this, only what has been found on other projects:
- riscv-collab/riscv-gnu-toolchain#787
- NixOS/nixpkgs#207672
- https://ubuntuforums.org/showthread.php?t=2476019
So yes, sounds like it makes sense to change the default in the Makefile
to bfd
for the riscv64
target/architecture.
from amiberry.
Perhaps we should skip the whole idea of trying to "force" the LD selection. I understand that gold
might be a little faster, but maybe it's not worth the trouble.
@solskogen what do you think about this?
from amiberry.
We can add USE_LD=ld.bfd on RISC-V exclusively.
from amiberry.
Related Issues (20)
- Mouse gets stuck in GUI window in latest Preview
- Networking / bsdsocket.library not working correctly HOT 7
- SpaceQuestEnhanced_v1.3_MT32_2222.lha does not start (missing xpkmaster.library v4) HOT 16
- Controller has no function in the game (amiberry-v5.7.3-debian-buster-armhf-rpi3) HOT 26
- Query: wiki/WHDLoad-Auto-booting [discrepancy] HOT 2
- Amiberry 4.7.1 does not run on RetroPie 4.8 HOT 2
- Query: capsimg.so doesn't compile? (also not present in recent binary releases) HOT 8
- When VSync is enabled, framerate is set to 60Hz erroneously HOT 8
- GUI -> Sound panel --> Push audio checkbox [cosmetic]
- Support for Raspberry Pi 1 dropped intentionally? HOT 3
- macOS default folder changes
- Add A3000 SCSI controller and tape support for Amiga UNIX (amix) HOT 13
- Query: when using select file/image in GUI->Quickstart, Floppy Drives & Hard drives/CD panels not refreshed [cosmetic]
- Record actual cmdline used in amiberry.log when logging is enabled?
- Add the ability to open CD media contained as a .zip file? HOT 2
- Doc: improve install documentation (particularly wrt MacOS)
- GUI -> Quickstart panel --> WHDLoad auto-config: --- 'Eject' button does not action correctly.
- Xbox 360 wireless controller stops working after returning from menu to game HOT 23
- Query: GUI -> Paths panel --> paths in textboxes are editable, but manual edits not saved? HOT 3
- MT-32 ROMs not found if the file names are upper-case HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amiberry.