-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FreeBSD port #81
Comments
You know you're doing something interesting when you crash the linker 😄 I notice you said 2.37 and not 2.38 - is it possible this is already fixed? |
Now I tried building 2.38 locally (we need to modify
Trying to figure out what's happening here -- are these undefined references symbols present on System V and Linux but not on BSD? |
Okay, got it to link by modifying Next step is fixing file mapping -- |
Program segfaults on startup:
|
System call trace from
|
Looks like a wrapper around
Program runs, accepts input, the cursor moves around, but the output is all blank (no visible characters or highlighting). |
My guess here is that System V |
I think maybe |
(I did the same thing as you to figure out the structure, looked at the disassembly and googled for old header files!) |
@taviso Spot on, intercepting FreeBSD port now seems to work 🎉 Since the undefine/redefine lists might differ between platforms, we'll need some sort of platform-specific configuration prior to build. I can try to cobble up some shell script for this. Please let me know your thoughts. |
@vrza I am curious what ver. of FreeBSD are you as not even the binutils can be compiled... |
@Unixware You probably misunderstood the conversation above, the GNU binutils suite itself could be compiled on FreeBSD. Since the conversation above is from June 2022, it was probably on FreeBSD 13.1, it had devel/binutils-2.37 in ports, and I compiled a newer version (binutils-2.38) from the upstream tarball. What's described in the conversation above are various issues in getting not binutils, but this project (123elf) to compile and link on FreeBSD (which is basically the point of this GitHub ticket) and these issues I solved back then in PR #86. The feature branch is still up, try it on FreeBSD. By this time I'd expect it to link just fine using the ports version of binutils. |
thanks! Sorry I thought your PR was merged already! |
@Unixware The original 123 object code that this project is linking is i386, so you must have coff-i386 in order to build it. |
thanks Vladimir, using the latest binutils works! 123 loads ok , Just segfault while trying to open the 'help' (F1 key) |
FreeBSD has a procfs implementation but it is not preferred, and on many systems is not normally mounted. The canonical way to query this on FreeBSD is via the sysctl(3) interface. There's a good blog on implementing this functionality for FreeBSD in GHC at https://frasertweedale.github.io/blog-fp/posts/2021-01-01-fixing-getExecutablePath-FreeBSD.html (and the sysctl node itself is documented in the man page, https://man.freebsd.org/cgi/man.cgi?sysctl(3) ) |
ld
(GNU binutils 2.37) segfaults when attempting to link123
on FreeBSD:The text was updated successfully, but these errors were encountered: