Skip to content
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

Cross Compile ltrace and include it in the disk image. #2

Open
angrave opened this issue Jul 14, 2014 · 2 comments
Open

Cross Compile ltrace and include it in the disk image. #2

angrave opened this issue Jul 14, 2014 · 2 comments

Comments

@angrave
Copy link
Contributor

angrave commented Jul 14, 2014

Some possible ways compile ltrace in jor1k:

  1. Use jor1k

  2. Use the old premade virtual box image (need to bunzip2 after downloading). Also these translated notes might be relevant -
    http://www.programmershare.com/3163928/
    (search for or32-linux-gcc)

http://opencores.org/or1k/Ubuntu_VirtualBox-image_updates_and_information
(download; bunzip2; fire up in virtualbox. For happiness also install vbox extensions)

  1. Try to follow these inaccurate instructions -
    http://openrisc.net/toolchain-build.html

5 & 6. Try these two ways suggested by Sebastian -
(below is some email notes from concat'd together)

Got an uptodate linux machine? Try -
https://github.com/s-macke/jor1k/wiki/How-to-develop-for-jor1k

It provides you with a chroot environment and a virtual machine (qemu-user). This is by far the easiest way to develop for jor1k. No nasty cross compiling problems.

I haven't tested it yet because of lack of time today. Give it a try.
You should use Debian in a virtual machine or any other distribution.

The binfmt description however works only for Debian. But there similar solutions for each distribution.


https://github.com/bluecmd/or1k-debian

I will also write the binfmt support in a way that it works in every distribution.

My binfmt kernel file looks like

> cat /proc/sys/fs/binfmt_misc/qemu-or1k

enabled
interpreter /usr/bin/qemu-or1k-static
flags: OC
offset 0
magic 7f454c460102010000000000000000000002005c
mask fffffffffffffffffffffffffffffffffffeffff

With the new manual it works for me.


The manual is now written, that it should run in every distribution with
and x86-64 architecture and a rather new kernel.
This qemu executable runs on my virtual machine with CentOS and kernel 2.6.32.

Unfortunately, cross compiling is a mess. This has been a problem since the last 20 years and will probably never be solved. To compile everything for the provided jor1k images took me more than 2 months.

qemu-user and bin-fmt is a nice tool to circumvent a lot of problems. Unfortunately, you need a specialized version of it because not all patches necessary are in the official qemu distribution.


cd sysroot
mkdir root
cd root
mkdir ltrace
cd ltrace
git clone git://git.debian.org/git/collab-maint/ltrace.git
./autogen.sh
cd ..
cd ..
cd ..
chroot qemu .... # the command from the online manual
cd /root/ltrace
./configure --build=or32-unknown-linux --prefix=/usr
make

unfortunately it expects the libelf libraries which I haven's installed yet.
"

@neelabhg neelabhg added this to the UIUC senior project fall 2014 milestone Nov 22, 2014
@neelabhg
Copy link
Member

neelabhg commented Dec 1, 2014

There is also a wiki page in the upstream jor1k project: https://github.com/s-macke/jor1k/wiki/How-to-develop-for-jor1k

@neelabhg neelabhg modified the milestones: UIUC senior project Spring 2015, UIUC senior project Fall 2014 Dec 11, 2014
@ProofOfKeags
Copy link

Do not work on this issue until #51 is closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants