diff mbox series

[atusb/fw,1/2] atusb: fw: Update toolchain instructions

Message ID 20220905204318.1324284-1-miquel.raynal@bootlin.com (mailing list archive)
State Superseded
Headers show
Series [atusb/fw,1/2] atusb: fw: Update toolchain instructions | expand

Commit Message

Miquel Raynal Sept. 5, 2022, 8:43 p.m. UTC
Those instructions do not work anymore for several reaons:
- Two out of the three files to download return a 404 error:
      * The binutils version does not exist, it was 2.21.1 or 2.21.1a
        instead of just 2.21.
      * The avr-libc is no longer hosted on the pointed website, I've
        found an alternate.
- The binutils version mentioned is not able to compile the firmware on
  a recent distribution, the Internet advised to update its version and
  it worked.
- Most of these compilations will throw warnings if you use a recent
  gcc. Sometimes -Werror is set and it fails the build. To avoid that,
  just use --disable-werror in the ./configure options.
- I had issues building the gcc doc but those issues are trivial to
  fix inline.

Update the instructions for building the toolchain and while at it,
start the file by mentioning that this is maybe not useful anymore, and
provide the packets to install.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 atusb/fw/README | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

Comments

Alexander Aring Sept. 5, 2022, 11:33 p.m. UTC | #1
Hi,

On Mon, Sep 5, 2022 at 4:43 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Those instructions do not work anymore for several reaons:
> - Two out of the three files to download return a 404 error:
>       * The binutils version does not exist, it was 2.21.1 or 2.21.1a
>         instead of just 2.21.
>       * The avr-libc is no longer hosted on the pointed website, I've
>         found an alternate.
> - The binutils version mentioned is not able to compile the firmware on
>   a recent distribution, the Internet advised to update its version and
>   it worked.
> - Most of these compilations will throw warnings if you use a recent
>   gcc. Sometimes -Werror is set and it fails the build. To avoid that,
>   just use --disable-werror in the ./configure options.
> - I had issues building the gcc doc but those issues are trivial to
>   fix inline.
>
> Update the instructions for building the toolchain and while at it,
> start the file by mentioning that this is maybe not useful anymore, and
> provide the packets to install.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  atusb/fw/README | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/atusb/fw/README b/atusb/fw/README
> index 99ceb22..44f65f5 100644
> --- a/atusb/fw/README
> +++ b/atusb/fw/README
> @@ -1,4 +1,6 @@
> -Requires a very recent toolchain, because ATmega32U2 is relatively new.
> +- Toolchain:
> +
> +  apt install avr-gcc libc-avr
>

grml, it's just the other name around... but I think an important
notice is here "use the debian packages".

gcc-avr avr-libc

I know it was swapped and was not checking it... it was a 50/50 chance.

- Alex
Miquel Raynal Sept. 6, 2022, 7:56 a.m. UTC | #2
Hi Alexander,

aahringo@redhat.com wrote on Mon, 5 Sep 2022 19:33:47 -0400:

> Hi,
> 
> On Mon, Sep 5, 2022 at 4:43 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > Those instructions do not work anymore for several reaons:
> > - Two out of the three files to download return a 404 error:
> >       * The binutils version does not exist, it was 2.21.1 or 2.21.1a
> >         instead of just 2.21.
> >       * The avr-libc is no longer hosted on the pointed website, I've
> >         found an alternate.
> > - The binutils version mentioned is not able to compile the firmware on
> >   a recent distribution, the Internet advised to update its version and
> >   it worked.
> > - Most of these compilations will throw warnings if you use a recent
> >   gcc. Sometimes -Werror is set and it fails the build. To avoid that,
> >   just use --disable-werror in the ./configure options.
> > - I had issues building the gcc doc but those issues are trivial to
> >   fix inline.
> >
> > Update the instructions for building the toolchain and while at it,
> > start the file by mentioning that this is maybe not useful anymore, and
> > provide the packets to install.
> >
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > ---
> >  atusb/fw/README | 18 ++++++++++--------
> >  1 file changed, 10 insertions(+), 8 deletions(-)
> >
> > diff --git a/atusb/fw/README b/atusb/fw/README
> > index 99ceb22..44f65f5 100644
> > --- a/atusb/fw/README
> > +++ b/atusb/fw/README
> > @@ -1,4 +1,6 @@
> > -Requires a very recent toolchain, because ATmega32U2 is relatively new.
> > +- Toolchain:
> > +
> > +  apt install avr-gcc libc-avr
> >  
> 
> grml, it's just the other name around... but I think an important
> notice is here "use the debian packages".
> 
> gcc-avr avr-libc
> 
> I know it was swapped and was not checking it... it was a 50/50 chance.

Haha I blindly trusted you, I should have double checked.

Thanks,
Miquèl
diff mbox series

Patch

diff --git a/atusb/fw/README b/atusb/fw/README
index 99ceb22..44f65f5 100644
--- a/atusb/fw/README
+++ b/atusb/fw/README
@@ -1,4 +1,6 @@ 
-Requires a very recent toolchain, because ATmega32U2 is relatively new.
+- Toolchain:
+
+  apt install avr-gcc libc-avr
 
 - Building:
 
@@ -64,12 +66,13 @@  apt-get install libmpfr-dev libmpc-dev
 
 # binutils
 
-wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
-tar xfj binutils-2.21.tar.bz2 
-cd binutils-2.21
-./configure --target=avr --disable-nls
+wget https://ftp.gnu.org/gnu/binutils/binutils-2.27.tar.bz2
+tar xfj binutils-2.27.tar.bz2
+cd binutils-2.27
+./configure --target=avr --disable-nls --disable-werror
 make
 make install
+ln -s /usr/local/bin/avr-as /usr/bin/avr-as
 
 # gcc
 
@@ -85,9 +88,8 @@  cd obj-avr
 make
 make install
 
-wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-1.7.1.tar.bz2
-tar xfj avr-libc-1.7.1.tar.bz2 
-cd avr-libc-1.7.1
+wget https://android.googlesource.com/toolchain/avr-libc/+archive/master/avr-libc-1.7.1.tar.gz
+tar xf avr-libc-1.7.1.tar.gz
 ./bootstrap	# the automake at the end takes a while
 ./configure --build=`./config.guess` --host=avr
 make