Bingo's scripts, fear and trepidation

Go To Last Post
25 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note that I have used Bingo's scripts to build avr-ggc before.
Through no fault of Bingo or his scripts, the first time was a true horror.
Some of it was played out on this forum.
The horror turned out to be a file system bug.
Eventually the horror went away when I updated my distro.
Subsequent efforts were successful, but still rather difficult.

I truly hate the poke it and see what it does method
of discovering what something is supposed to do.

Also, building compilers is not noted for being easy.
Clearly erroneous instructions increases the fear,
even if the corrections are obvious.

Bingo600 wrote:
I am enclosing the scripts i use (credits of A. Erasmus) , if they could be of any use

The steps are these:

Read Readme.txt
Then install the packages listed in pre-reqs.txt.

There are two pre-reqs.txt's, a Readme.txt and a readme.txt.
Quote:
Note !!
Don't try to call the scripts from another directory location , always execute from same directory where the scripts are located.
The current scripts uses recursive deletes , that could erase the harddisk if the above isn't honored.
Ouch.
Do not do this as root.
Do not do this in a directory that is not expendable.
Only do this in a directory all whose ancestors are
either expendable or invulnrable.
Quote:
Then....

1: Make sure you are root (blushing) , or use sudo
2: Make a working directory , where you extract the files from the archive.

the archive? There are three zip files to download.
They extract into a directory each.
Are we supposed to merge them into one?
Quote:
3: If desired edit the buildavr-no-insight.sh file , to change the prefix .. default is : prefix=/usr/local/avr
4: Make sure that the prefix dir is empty or nonexisting
5: Run : chmod +x *.sh
Just once in just one directory?
Quote:
6: Run : ./getfiles.sh
7: Run : ./get-patches.sh
There are three of each, only one in a top-level directory.
Quote:
8: Run : ./buildinsight.sh
9: Run: ./buildavr-no-insight.sh

You just answer yes to the existing directory question in step 9.

When building is done , you might want to free around 500MB of diskspace by removing the sources and binaries used to make avr-gcc.
To do so Run: ./buildavr-cleanup.sh

Note this little script expects the "build prefix" to be /usr/local/avr/ .

My expectations are that I should
get the stuff in both pre-reqs.txt's,
read both ?eadme.txt's,
keep the directories separate,
make all the *.sh files executable, regardless of location,
run all the get-files.sh's and all the get-patches.sh's in their own directories,
run buildinsight.sh and buildavr-no-insight.sh from their own directories.

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

skeeve wrote:

archive? There are three zip files to download.


These are is 3 different versions , you'd prob. want the 4.5.1 version (topmost) , that's what 99% uses.

Do edit the buildavr-no-insight.sh file (aka build toolchain), to change the prefix .. default is : prefix=/usr/local/avr

3: Maybe change prefix to /home//avr-gcc , or anywhere your own user has write access to (then you can skip the sudo part) , and test the build out.

Change it in all 3 buildavrxxx.sh files , the prefix must be the same in all 3.

4: Make sure that the prefix dir is empty or nonexisting
5: Run : chmod +x *.sh
6: Run : ./getfiles.sh
7: Run : ./get-patches.sh

8: Run: ./buildavr-no-insight.sh - Has changed name to buildavr-toolchain.sh

9: Run : ./buildinsight.sh - Has changed name to buildavr-gdb.sh

You just answer yes to the existing directory question in step 9.

When building is done , you might want to free around 500MB of diskspace by removing the sources and binaries used to make avr-gcc. (remember the prefix change inside)
To do so Run: ./buildavr-cleanup.sh

All this "cleanup" does .. Is removing the build & source directories in the "prefix directory" , and the "okxxx files" in the "buildscript dir". You could do that manually.

With the current scripts i'm quite sure, i only use recursive deletes in the cleanup script.
I circumvented the other ones (with help from Axel W.)

If you want to rebuild i suggest you remove the "full prefix dir" before rebuilding (else the patching will prob fsck-up). Sont delete the scriptdir (where you extracted the downloaded buildscript).

And do delete all the "okxxx files in the scriptdir" , else the script thinks all "sub-builds" are ok , and the script does nothing.

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bingo600 wrote:
skeeve wrote:

archive? There are three zip files to download.


These are is 3 different versions , you'd prob. want the 4.5.1 version (topmost) , that's what 99% uses.
Ah. OK. Thanks much.
I had visions of something recursive.
Quote:
Do edit the buildavr-no-insight.sh file (aka build toolchain), to change the prefix .. default is : prefix=/usr/local/avr

3: Maybe change prefix to /home//avr-gcc , or anywhere your own user has write access to (then you can skip the sudo part) , and test the build out.

Change it in all 3 buildavrxxx.sh files , the prefix must be the same in all 3.

In my last successful build, I made /usr/local/avr owned by me.
I did the build from a sub-directory of /tmp .
The last thing I did was to change the ownership of /usr/local/avr back to root.
It avoids the fear associated with running someone else's scripts as root.

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Prerequisites are giving me a problem
I'm trying to build on Centos not Ubuntu.
I've not been able to find build-essentials, libcwidget-dev or their likely replacements.
Here is what I have so far:

Ubuntu package     CentOS         CentOS
                   replacement    Version
build-essential
libcwidget-dev
tcl8.4-dev         tcl-devel      8.5.7       
tk8.4-dev          tk-devel       8.5.7
libncurses5-dev    ncurses-devel  5.7
libx11-dev         libX11-devel   1.3
binutils-dev       binutils-devel 2.20.51.0.2
libusb-0.1-4       libusb         0.1.12
libusb-dev         libusb-devel   0.1.12
libmpfr-dev        mpfr-devel     2.4.1
libexpat1-dev      expat-devel    2.0.1
python-dev         python-devel   2.6.6

What do build-essential and libcwidget-dev provide that I need to replace?

How fussy are the scripts about versions,
especially regarding tcl8.4-dev, tk8.4-dev, libncurses5.dev, libusb-0.1-4 and libexpat1-dev ?

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Michael,

If you want to know about Ubuntu package contents you will find this site very useful:

http://packages.ubuntu.com/preci...

That just happens to be the details of build-essential for Ubuntu 12.04. If you look at the "list of files" (either 386 or AMD versions) you'll find that it's a virtually empty package as it's really just a "meta package", one who's header lists a number of dependencies so what that page is really saying is that installing build-essentials is going to get you:

dpkg_dev (>= 1.13.5)
g++ (>= 4.4.3)
gcc (>= 4.4.3)
libc6-dev
make

The ones with version numbers specified say "no need to get anything if your package cache says you already have a version newer than this". If you don't have the package or it's too old the latest of each will be installed.

If you click through the link for gcc (say) you will see that in 12.04 what you will be installing is 4.6.3-1ubuntu5 (for example).

I have a feeling that the Tcl/Tk and ncurses versions probably don't matter much. I think the Tck/Tk is only involved in Mfile. As for the libusb stuff I'm guessing that will only affect the utility of any avrdude you happen to build.

Forgot: precise=12.04, lucid=10.04 (which is what I think Bingo built is latest version on in fact).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

build-essential as Cliff mentioned is just a quick way of getting the native GCC, make & other native Compiler related stuff installed.

I think Tcl/Tk was needed for avr-insight (witch is now dropped) and now only avr-gdb is build.
The script doesn't build mfile or depend on it , but there is a working (mfile ubuntu) version on wrightflyer

Just give the build a try , and note the error message if any , then lookup the error msg on Google.
And someone prob mentioned what package or function is missing , then look that package/function up on google , and you'll know what package to install. That's how i found out most of the Ubuntu package requirements.

Just give it a go ... :-)

/Bingo

And Cliff is correct . the latest script & .deb packages was tested/build on/with Ubuntu 10.04

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm been trying to give it a go, but I can't seem to connect to Denmark.
Is there a replacement for ftp.dkuug.dk ?
'Tain't even pingable.

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ahhh ...

There's many repositories hosting the files you need.
I'll let you & google find them.

Just replace the url's in getfiles , with the ones you & google discovers.

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bingo600 wrote:
There's many repositories hosting the files you need.
I'll let you & google find them.

Just replace the url's in getfiles , with the ones you & google discovers.

From that I infer that it doesn't matter much from which repositories I get the files,
i.e. I can safely rely on repositories with the same file names to have the same code in the named files.

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used
wget -c ftp://ftp.gnu,org/binutils/binut...
and
wget -c ftp://ftp.gnu.org/gnu/gcc/gcc-4....
To get insight, I used
wget -c http://pkgs.fedoraproject.org/re...
From sourceware.org, I got a no such file message.

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

To get insight

Do you really want insight? I wouldn't put too much effort into that. As long as you have avr-gdb building OK you can wrap other IDEs around it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Strange ....

Does the latest script
http://www.avrfreaks.net/index.p...

Still get insight ??

I abandoned insight, 2 releases ago. And just build avr-gdb.

... I just checked , and find no insight references in the getfiles

Heyyyyy .......

I sense a flashback...
http://www.avrfreaks.net/index.p...

Just noticed the 4.2.4 vers of GCC ....
You're using the old buildscript ....
Don't use that one (won't build) , use the one i have linked to in this post.

It's also the first one in the sticky.

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bingo600 wrote:
Just noticed the 4.2.4 vers of GCC ....
You're using the old buildscript ....
Don't use that one (won't build) , use the one i have linked to in this post.

It's also the first one in the sticky.

Thanks much for catching that.
I had downloaded the new scripts from the sticky.
How the old version got in there, I have no idea.

I have now getfiles.sh'd successfully.
Here are the replacements I had to make:

#wget -c ftp://ftp.dkuug.dk/pub/gnu/ftp/g...${binutilstar}
wget -c ftp://ftp.gnu.org/gnu/binutils/${binutilstar}

#wget -c ftp://ftp.dkuug.dk/pub/gnu/ftp/g...${gcccore}/${gcccoretar}
wget -c ftp://ftp.gnu.org/gnu/gcc/${gcccore}/${gcccoretar}

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I got stuff downloaded, but I still cannot build.
./buildavr-toolchain.sh 2>&1 | tee buildavr-toolchain.out
Produced the attached output, gzipped for size and suffix.
I tried to post the tail end of it, but I kept getting an empty page.

From /usr/local/avr , here is the output of
find build -type f -exec grep -H genmodes "{}" \;

build/gcc-4.5.1/gcc/Makefile:s-modes: build/genmodes$(build_exeext)
build/gcc-4.5.1/gcc/Makefile:	$(RUN_GEN) build/genmodes$(build_exeext) > tmp-modes.c
build/gcc-4.5.1/gcc/Makefile:s-modes-h: build/genmodes$(build_exeext)
build/gcc-4.5.1/gcc/Makefile:	$(RUN_GEN) build/genmodes$(build_exeext) -h > tmp-modes.h
build/gcc-4.5.1/gcc/Makefile:s-modes-m: build/genmodes$(build_exeext)
build/gcc-4.5.1/gcc/Makefile:	$(RUN_GEN) build/genmodes$(build_exeext) -m > tmp-min-modes.c
build/gcc-4.5.1/gcc/Makefile:build/genmodes.o : genmodes.c $(BCONFIG_H) $(SYSTEM_H) errors.h		\
build/gcc-4.5.1/gcc/Makefile:build/genmodes$(build_exeext) : $(BUILD_ERRORS)
[hennebry@67-61-185-76 avr]$ gvim build/gcc-4.5.1/gcc/Makefile

Debugging an autoconf-generated make file is beyond my expertise.
There seems to be no mechanism for making build/genmodes .
Since other people have done it, I expect there is a way to make it go,
but I have no clue.
Any ideas?

Attachment(s): 

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I notice 2 things.

1: The build says the $pefix dir allready exists.
Rember to delete the full $prefix dir , before attempting a new rebuild of the toolchain.
It's only when the toolchain is build ok , and you build avr-gdb , this warning is ok to ignore.

2:
Could either of these apply ?
http://gcc.gnu.org/ml/gcc-help/2...
http://cboard.cprogramming.com/t...
http://www.avrfreaks.net/index.p...

It means ... NEVER invoke a build from within the source tree - Here i'd say $prefix dir (or below)

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've run all scripts from their own directory,
not from any sub-directory of /usr .
/usr/local/avr existed, but was empty.
I empty it instead of deleting it because it's owned by me.
That way I can run ./buildavr-toolchain.sh as myself and not worry about root on a rampage.
I infer that that is allowed.
Otherwise the question would not make sense, nor would the -p option on mkdir.

Just to be sure that I hadn't forgotten my cleaning,
I cleaned /usr/local/avr again and ran the script again from
/home/hennebry/data/projects/avr/gcc/build-avr-gcc-4.5.1-binutils-2.20.1-libc-1.8.0-gdb-7.3.1-dude-5.11.1-avarice-2.12-aw/make-avr-gcc .
I got the same result.

For the last run, I did make one change to the script:

# check on target directory

if [ -d $prefix ] && ls $prefix/* > /dev/null ;
then
   cecho "\n"
   ask "${RED}$prefix already exists and is not empty, continue?";

   if [ "$?" -eq 1 ]
   then
      exit
   fi
fi

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm out of ideas

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I found this, but I'm not at all sure where it comes from:

checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for avr-as... no
checking what assembler to use... 
checking for avr-ld... no
basename: missing operand
Try `basename --help' for more information.
checking what linker to use... 
checking for avr-nm... no
checking what nm to use... 
checking for avr-objdump... no
checking what objdump to use... not found
checking for readelf... /usr/bin/readelf
checking what readelf to use... /usr/bin/readelf
checking assembler flags...  

I also do not know whether the missing operand caused the subsequent failure.

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avr-binutils must be found.

Just configure and install binutils with the same --target and --prefix.

avrfreaks does not support Opera. Profile inactive.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SprinterSB wrote:
avr-binutils must be found.

Just configure and install binutils with the same --target and --prefix.

This is way too cryptic for me.
I don't know what went wrong or what you are suggesting I do about it.
Was I supposed to give ./buildavr-toolchain.sh some arguments?
Its last error message seems to have come from here:
   echo "($0) configuring GCC source"
   ../../source/${gccbase}/configure -v --target=${target} --disable-nls \
      --prefix=$prefix --with-gnu-ld --with-gnu-as --enable-languages="c,c++" --disable-libssp --with-dwarf2 \
      --with-gmp-include=$prefix/source/${gccbase}/gmp
   cerror "GCC configuration failed"

   echo "($0) building GCC"
#   make all install clean LANGUAGES="c obj-c++"
   make -j${Cores} all LANGUAGES="c c++"
   make install clean
   cerror "GCC build failed"
   touch ${base}/ok-build-${gccbase}
   fi

I found this in /usr/local/avrbuild/gcc-4.5.1 :

# The target built for a native non-bootstrap build.
.PHONY: all
all:
	@: $(MAKE); $(unstage)
	@r=`${PWD_COMMAND}`; export r; \
	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \
	&& :

Why is it trying to build a native compiler?
Why does the second command end in "&& :"?

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When running get-patches and executing the line:
wget -c --user-agent=MyBrowser http://www.freebsd.org/cgi/cvswe...

freebsd barfs at me with:

--2012-11-15 17:15:09-- http://www.freebsd.org/cgi/cvswe...
Resolving www.freebsd.org... 69.147.83.34, 2001:4f8:fff6::22
Connecting to www.freebsd.org|69.147.83.34|:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2012-11-15 17:15:10 ERROR 500: Internal Server Error.

Is this a transient error that will go away soon, or is this a fundamental change that requires changing our scripts?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have asked Jörg W , but to me it seems like the freebsd.org server has a problem.

The cvs access isn't functioning.

Edit: Jörg confirmed that it looks like a server misconfiguration

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Seems like the server hasn't been fixed yet (did anyone report this ?)

I have snipped a "patches" dir from a toochain build on my HDD (attached), as it is created in march-2012 it should be for the current "avr-gcc 4.5.1 script"

Quote:
build-avr-gcc-4.5.1-binutils-2.20.1-libc-1.8.0-gdb-7.3.1-dude-5.11.1-avarice-2.12-aw.zip

Unpack to the "root of" the existing patches dir,included with the script (meaning don't unpack to patches/patches/avr-xxx but to patches/avr-xxx).

I'd expect that "getpatches.sh" could be skipped totally.

/Bingo

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm back at my computer again and am still struggling.
This section of the output from buildavr-toolchain.sh seems interesting:

Quote:
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (ld) supports shared libraries... /usr/local/avr/source/gcc-4.5.1/mpc/configure: line 8413: : supported targets:.* elf: command not found
no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... unsupported
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for ANSI C header files... (cached) no
checking complex.h usability... yes
checking complex.h presence... no
configure: WARNING: complex.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: complex.h: proceeding with the compiler's result
checking for complex.h... yes
checking locale.h usability... yes
gcc -static doesn't work?
libtool doesn't support shared libraries?
complex.h? Wow.
I did find this:
http://www.mail-archive.com/autoconf@gnu.org/msg09268.html, but I don't know what to do about it.

International Theophysical Year seems to have been forgotten..
Anyone remember the song Jukebox Band?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The freebsd.org servers are back online, so patches are accessible again.