Skip to content

Commit

Permalink
Add binutils patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Aug 9, 2015
1 parent 54b11a3 commit 95b56e8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
12 changes: 10 additions & 2 deletions doc/manual/installing.rst
Expand Up @@ -81,15 +81,23 @@ and the ARTIQ kernels.

$ mkdir ~/artiq-dev

* Clone ARTIQ repository: ::

$ cd ~/artiq-dev
$ git clone --recursive https://github.com/m-labs/artiq

* Install OpenRISC binutils (or1k-linux-...): ::

$ cd ~/artiq-dev
$ wget https://ftp.gnu.org/gnu/binutils/binutils-2.25.1.tar.bz2
$ tar xvf binutils-2.25.1.tar.bz2
$ rm binutils-2.25.1.tar.bz2

$ mkdir binutils-2.25.1/build
$ cd binutils-2.25.1/build
$ cd binutils-2.25.1
$ patch -p1 <~/artiq-dev/misc/binutils-2.25.1-or1k-R_PCREL-pcrel_offset.patch

$ mkdir build
$ cd build
$ ../configure --target=or1k-linux --prefix=/usr/local
$ make -j4
$ sudo make install
Expand Down
29 changes: 29 additions & 0 deletions misc/binutils-2.25.1-or1k-R_PCREL-pcrel_offset.patch
@@ -0,0 +1,29 @@
--- a/bfd/elf32-or1k.c 2015-08-02 15:45:34.275922535 +0300
+++ b/bfd/elf32-or1k.c 2015-08-02 15:45:36.635931622 +0300
@@ -199,7 +199,7 @@
FALSE, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */

HOWTO (R_OR1K_16_PCREL,
0, /* rightshift */
@@ -213,7 +213,7 @@
FALSE, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */

HOWTO (R_OR1K_8_PCREL,
0, /* rightshift */
@@ -227,7 +227,7 @@
FALSE, /* partial_inplace */
0, /* src_mask */
0xff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */

HOWTO (R_OR1K_GOTPC_HI16, /* Type. */
16, /* Rightshift. */

1 comment on commit 95b56e8

@sbourdeauducq
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.