public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Mack Wallace <mackbw@mapinternet.com>
To: binutils@sourceware.org
Subject: Porting binutils to Amiga Unix
Date: Thu, 16 Feb 2017 02:11:00 -0000	[thread overview]
Message-ID: <CFEDEDC3-E90C-4048-8141-A6A709B51861@mapinternet.com> (raw)


I’m attempting to port binutils to Amiga Unix which is AT&T SVr4. I’m doing this because there are a few things I’d like to compile for which the native ld hangs as well as some pieces of software naturally recommend the gnu tools. However, I have some questions that I hope someone can help with. What I think I need help with is determining the emulation parameters: i.e. TEXT_START_ADDR, MAXPAGESIZE, NOP, etc. for ld? How do I go about determining these? More information regarding what I have and what I’m dealing with follows.

Here is what I have to work with:
AT&T Unix SVr4 on an Amiga with a 68030 processor, 16MB ram, 256MB swap.
Version 2.7.2.3 gcc compiler.
Version 2.2 libtool.

As this Unix is rather old, it does not have many c headers that are common today like stdint. I’m guessing this means it is either best / easiest to work with an earlier / early release of binutils.

If I try binutils version 2.8.1, it’s config.guess will recognize the canonical name of the machine m68k-cbm-sysv4. Later versions do not, simply returning m68k-unknown-sysv4, while the config.guess does recognize that it is an amiga and not amiga bsd. I presume dropping the canonical name was due to lack of interest or activity in development, and being designated m68k-unknown-sysv4 doesn’t affect much. In either case, while configuring ld, configure fails because "*** ld does not support target m68k-unknown-sysv4.”

So it looks like I need to setup something in configure.tgt to set targ_emul variable and then go from there.

My understanding has been that Amiga Unix uses the elf format for binaries. Looking at some binaries on the system, they begin with the magic number 7F. Wondering if the information I require could be gleaned by readelf, I downloaded the earliest copy of binutils that has that. I was able to compile readelf and its dependencies. Looking at some binaries, the “Entry Point Address” is something greater than 0x80000000 (I’ve seen addresses of 0x800000f94, 0x80000117c, 0x8000027d0). This is a guess, but using m68kelf.sh in emulparameters as a starting point: TEXT_START_ADDR=0x80000000? For both paged and non-paged?

If I run pagesize from the command prompt, I get a page size of 2048. So should I set my “MAXPAGESIZE” to 0x800? 

What should NOP be? In some emulation parameters, it’s not set at all.

Are there any other parameters that I should be setting?

Hope someone will be so kind as to provide some guidance. The porting guide that I looked at doesn’t seem to discuss the emulation parameters themselves.

I have continued trying to compile the rest of binutils. I have addr2line, ar, nm, objcopy, objdum, ranlib, readelf, size, strings, and strip compiled. Gas compiles but hangs during linking with AT&T ld. 

Regards,

Mack B Wallace

             reply	other threads:[~2017-02-16  2:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16  2:11 Mack Wallace [this message]
2017-02-16  9:47 ` Andreas Schwab
2017-02-16  9:53 ` Andreas Schwab
2017-04-11  0:17   ` Mack Wallace
2017-04-11  7:55     ` Nick Clifton
2017-04-15  0:14       ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CFEDEDC3-E90C-4048-8141-A6A709B51861@mapinternet.com \
    --to=mackbw@mapinternet.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).