AVR-GCC/NetBeans/Ubuntu (was: Bingo-build structure)

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

Friends!

My recent woes re having any IDE at all to do AVR development from/in has led me to do some tests with Bingos builds and NetBeans on GNU/Linux (Ubuntu 11.04 to be precise).

It seems I have successfully installed the pre-built .deb package of Bingos build (specifically avr-gcc-4.3.4-avrfreaks-30-jun-2010-u10.04.i386.deb as hosted by Cliff).

I have not tested this through, but I get the expected files if I test build some trivial "null app".

In /usr/local I see stuff that I do not really understand:

In /usr/local/avr/bin I find the toolchain with the names I recognize from e.g. WinAVR (they have the prefix "avr-"). These are the ones that work as expected.

In /usr/local/avr/avr/bin I find some parts of some toolchain (e.g "gcc" with no prefix). Not all files seen in the previous directory are present here, but those that are seem to be identical re timestamp and size. Still theses does not work for me. E.g.

/usr/local/avr/avr/bin/gcc -c main.c -o main.o

gives this error

gcc: error trying to exec 'cc1': execvp: No such file or directory

So, I could use the former directory you say?

Well, on to NetBeans.. It has a dialogue to set up a tool chain. In this dialogue you must start by supplying a "Base directory" in which NetBeans then tries to locate the components of a GNU tool chain. Problem is that

i) it seems it only finds e.g. "gcc". If I point to /usr/local/avr/avr/bin/ it detects the tool chain there (but that one won't work in NetBeans just as t didn't work in a terminal). If I point to /usr/local/avr/bin then it will not detect the tool chain.

ii) while one can re-point the individual tools, this must be relative to the "base directory" and must be in or below that.

So, I can not use /usr/local/avr/bin since I can not even specify that as a base directory (so I never get to the point where I would be able to tell NetBeans that e.g. gcc is rather named avr-gcc). And I can not use /usr/local/avr/avr/bin since the tool chain there seems to be dysfunctional in general.

My GNU/Linux skills in general are flaky to say the least. My understanding of the philosophy behind Unix/Linux organization of directories are even weaker (example: Why would a directory called "usr" contain subdirectories/files that are general rather than user specific?).

I hope you now have some picture of where I stand in the general Unix/Linux land, and in this specific issue.

While I can pose some specific questions, if you spot anything that might help me find my way through this I would be very grateful if you toss some explanation or suggestion in here:

Why are some of the tool chain files present in two different directories? And then, why not all?

Do you see any reason that NetBeans should assume that a GCC compiler always is named "gcc" (or is that just an "over-asumption" of the NetBeans folks)?

While the error I get says that cc1 can not be found, I can not see any cc1 being present in the tool set that actually works in a terminal - how can this be? (Yes, I know about gcc being a "driver" that runs cc1, cc2 and ld (or some such)...)

And now for the rant - if you'd like to help and can't stand my bad mood airings then stop reading here.
[rant]
I am genuinely fed up with AS5's sluggishness, it's shakiness when going in and out of debugWire, and the inferior replacement for Visual Studios code navigation, autocomplete, refactoring etc. Right now, the only nice thing with AS5 is AnkhSVN.

While minor, it really pisses me off that I am told, with a very low-level technical message/error that there is no pre-build and post-build step in my project, or - if I lower the verbosity level of the build results to get rid of those I also lose the avr-size output.

And as reported elsewhere, I can no longer run AS4 (this is most likely/mainly a problem with my machine, not primarily AS4).

So I am between a rock and a hard place. I also feel that if an IDE gives the user of it little or no opportunity to tune it then it must really be stellar in how it does things and what it offers the user.

So out goes AS5 - hopefully, and I will instead try to get something limping forward with NetBeans. If I can build with NetBeans that would be the first step. Next, I could live with invoking AVRdude in some more or less clunky way for the time being for programming purposes. The crucial part is to see how far I can get with setting up an "OCD stack" which would be something like (bottom up): Dragon, AVaRICE, (...?...), NetBeans. Jörg has given me a glimpse of hope for this..

So, would that be an ultimate solution? No, but at the points where it is "clunky" I know where, how and why, and will have a reasonable opportunity to circumvent these in some way. AS5 is a close monolithinc POS (crap squared, if you like) and will not give me any such options for workarounds. I hate it when I'm forced into a corner..

Phew! That felt good..
[/rant]

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Sun. Sep 4, 2011 - 09:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If netbeans doesn't recognize avr-gcc you could create a symlink called gcc in that directory.

Quote:
Why would a directory called "usr" contain subdirectories/files that are general rather than user specific?).
I use this link as a reference but each distro seems to do things differently.

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

Quote:
Why are some of the tool chain files present in two different directories? And then, why not all?
This is the default structure for GCC cross-compilers. It copies stuff from bin into {target}/bin. I'm not sure why though.

Quote:
Do you see any reason that NetBeans should assume that a GCC compiler always is named "gcc" (or is that just an "over-asumption" of the NetBeans folks)?
It seems like an oversight by NetBeans devs.

Quote:
While the error I get says that cc1 can not be found, I can not see any cc1 being present in the tool set that actually works in a terminal - how can this be? (Yes, I know about gcc being a "driver" that runs cc1, cc2 and ld (or some such)...)

For some reason the full path name isn't given for bin/gcc. You could also try making a symlink of everything in libexec/gcc/avr/4.3.4/ to bin/gcc.

john@ubuntu:/usr/local/avr$ ls
avr  bin  etc  include  info  lib  libexec  man  share
john@ubuntu:/usr/local/avr$ bin/avr-gcc -print-prog-name=cc1
/usr/local/avr/libexec/gcc/avr/4.3.4/cc1
john@ubuntu:/usr/local/avr$ avr/bin/gcc -print-prog-name=cc1
cc1
john@ubuntu:/usr/local/avr$
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I use this link as a reference

Good link! (Though it does not give any explanation as to why the specific name "usr" was chose. I also note in that text that there is a root directory "opt" which "is reserved for the installation of add-on application software packages". So, why does not e.g. avr-gcc go there? These are honest questions - I honestly have a problem with understanding the philosophy/system/model-of-thought behind some stuff in the Unix/Linux world.)

Quote:
You could also try making a symlink of everything in libexec/gcc/avr/4.3.4/[my emphasis]

Huh?! Are the AVR GCC tool chain files present in yet another directory?!? [goes off to check][comes back]OK, some of the toolchain files re there, e.g. cc1.

Testing the symlink idea gave nothing. Still the same error about not finding cc1.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Partial progress: I simply renamed /usr/local/avr/bin/avr-gcc to /usr/local/avr/bin/gcc. This convinces NetBeans that the directory contains a GCC tool chain, and it works.

From here I suspect these will be the next issues:

1. Getting include directories correct (I have not even dared to do #include yet...)

1b. The above will likely lead to getting the -mmcu stuff correct.

2. Right now I get an output file with the same name as the project, and with no extension (i.e. "avrtest1"). I presume that this is the ELF file, but I will have to make sure. I'd be more comfortable with this file having an explicit .elf extension so this will be next.

3. After this I need to find a way to specify post-build steps for objcopy'ing the elf to a hex. And for running avr-size on the .elf.

Now to get some more sleep - didn't get more than a few hours since my OP.

I still appreciate any and all comments, hints or advice re the possible conglomerate AVR-GCC/NetBeans/Linux! This just might turn out to be real fun - or another frustrated experience.. :wink: At least the results so far is quite exciting!

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Quote:

why the specific name "usr" was chose

Unix has been putting the things used by the users in /usr since Adam was a lad. Almost all the "normal" programs a user runs on a Unix system are in /usr/bin and the programs are supports by libs (if necessary) in /usr/lib. (cf system/supervisor programs which are separately held in /sbin).

(a few core "user" commands are located in /bin)

IME /opt is almost never used.

It probably helps to read the FHS (v2.3):

http://www.pathname.com/fhs/

(EDIT: just realised this is the same link John gave - oops :oops:)

BTW it's interesting to compare the Linux avr-gcc package with the structure of WinAVR - perhaps not surprisingly they are actually very similar (for example WinAVR has the as.exe and so on in /WinAVR/avr/bin but also the same executables as avr-as.exe in /WinAVR/bin):

clawson@ws-czc1138h0b:/windows/WinAVR-20100110$ tree
.
├── avr
│   ├── bin
│   │   ├── ar.exe
│   │   ├── as.exe
│   │   ├── c++.exe
│   │   ├── gcc.exe
│   │   ├── g++.exe
│   │   ├── ld.exe
│   │   ├── nm.exe
│   │   ├── objcopy.exe
│   │   ├── objdump.exe
│   │   ├── ranlib.exe
│   │   └── strip.exe
│   ├── include
│   │   ├── alloca.h
│   │   ├── assert.h
│   │   ├── avr
│   │   │   ├── boot.h
│   │   │   ├── builtins.h
│   │   │   ├── common.h
│   │   │   ├── crc16.h
│   │   │   ├── delay.h
│   │   │   ├── eeprom.h
│   │   │   ├── fuse.h
│   │   │   ├── interrupt.h
│   │   │   ├── io1200.h
│   │   │   ├── io2313.h
│   │   │   ├── io2323.h
│   │   │   ├── io2333.h

│   │   │   ├── lock.h
│   │   │   ├── parity.h
│   │   │   ├── pgmspace.h
│   │   │   ├── portpins.h
│   │   │   ├── power.h
│   │   │   ├── sfr_defs.h
│   │   │   ├── signal.h
│   │   │   ├── signature.h
│   │   │   ├── sleep.h
│   │   │   ├── version.h
│   │   │   └── wdt.h
│   │   ├── compat
│   │   │   ├── deprecated.h
│   │   │   ├── ina90.h
│   │   │   └── twi.h
│   │   ├── ctype.h
│   │   ├── errno.h
│   │   ├── inttypes.h
│   │   ├── math.h
│   │   ├── setjmp.h
│   │   ├── stdint.h
│   │   ├── stdio.h
│   │   ├── stdlib.h
│   │   ├── string.h
│   │   └── util
│   │       ├── atomic.h
│   │       ├── crc16.h
│   │       ├── delay_basic.h
│   │       ├── delay.h
│   │       ├── parity.h
│   │       ├── setbaud.h
│   │       └── twi.h
│   └── lib
│       ├── avr25

│       │   └── libscanf_min.a
│       ├── avr3

│       │   └── libscanf_min.a
│       ├── avr31

│       │   └── libscanf_min.a
│       ├── avr35

│       │   └── libscanf_min.a
│       ├── avr4

│       │   └── libscanf_min.a
│       ├── avr5

│       │   └── libscanf_min.a
│       ├── avr51

│       │   └── libscanf_min.a
│       ├── avr6

│       │   └── libscanf_min.a
│       ├── avrxmega2

│       ├── crttn861.o
│       ├── ldscripts
│       │   ├── avr1.x
│       │   ├── avr1.xbn
│       │   ├── avr1.xn
│       │   ├── avr1.xr
│       │   ├── avr1.xu

│       │   ├── avrxmega7.x
│       │   ├── avrxmega7.xbn
│       │   ├── avrxmega7.xn
│       │   ├── avrxmega7.xr
│       │   └── avrxmega7.xu
│       ├── libc.a
│       ├── libm.a
│       ├── libobjc.a
│       ├── libobjc.la
│       ├── libprintf_flt.a
│       ├── libprintf_min.a
│       ├── libscanf_flt.a
│       └── libscanf_min.a
├── bin
│   ├── avarice.exe
│   ├── avr-addr2line.exe
│   ├── avr-ar.exe
│   ├── avr-as.exe
│   ├── avr-c++.exe
│   ├── avr-c++filt.exe
│   ├── avr-cpp.exe
│   ├── avrdude.conf
│   ├── avrdude.exe
│   ├── avr-gcc-4.3.3.exe
│   ├── avr-gccbug
│   ├── avr-gcc.exe
│   ├── avr-gcov.exe
│   ├── avr-gdb.exe
│   ├── avr-g++.exe
│   ├── avr-gprof.exe
│   ├── avr-insight.exe
│   ├── avr-ld.exe
│   ├── avr-man
│   ├── avr-nm.exe
│   ├── avr-objcopy.exe
│   ├── avr-objdump.exe
│   ├── avr-ranlib.exe
│   ├── avr-readelf.exe
│   ├── avr-size.exe
│   ├── avr-strings.exe
│   ├── avr-strip.exe
│   ├── cygwin1.dll
│   ├── giveio.sys
│   ├── ice-gdb
│   ├── ice-insight
│   ├── install_giveio.bat
│   ├── itcl32.dll
│   ├── itk32.dll
│   ├── kill-avarice
│   ├── libusb0.dll
│   ├── loaddrv.exe
│   ├── remove_giveio.bat
│   ├── simulavr.exe
│   ├── splint.exe
│   ├── srec_cat.exe
│   ├── srec_cmp.exe
│   ├── srec_info.exe
│   ├── start-avarice
│   ├── status_giveio.bat
│   ├── tcl84.dll
│   ├── tclpip84.dll
│   ├── tclsh84.exe
│   ├── tk84.dll
│   └── wish84.exe
├── lib
│   ├── dde1.2
│   │   ├── pkgIndex.tcl
│   │   └── tcldde12.dll
│   ├── gcc
│   │   ├── avr
│   │   │   └── 4.3.3
│   │   │       ├── avr25
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avr3
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avr31
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avr35
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avr4
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avr5
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avr51
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avr6
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avrxmega2
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avrxmega3
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avrxmega4
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avrxmega5
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avrxmega6
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── avrxmega7
│   │   │       │   ├── libgcc.a
│   │   │       │   └── libgcov.a
│   │   │       ├── include
│   │   │       │   ├── float.h
│   │   │       │   ├── iso646.h
│   │   │       │   ├── objc
│   │   │       │   │   ├── encoding.h
│   │   │       │   │   ├── hash.h
│   │   │       │   │   ├── NXConstStr.h
│   │   │       │   │   ├── objc-api.h
│   │   │       │   │   ├── objc-decls.h
│   │   │       │   │   ├── objc.h
│   │   │       │   │   ├── objc-list.h
│   │   │       │   │   ├── Object.h
│   │   │       │   │   ├── Protocol.h
│   │   │       │   │   ├── sarray.h
│   │   │       │   │   ├── thr.h
│   │   │       │   │   └── typedstream.h
│   │   │       │   ├── stdarg.h
│   │   │       │   ├── stdbool.h
│   │   │       │   ├── stddef.h
│   │   │       │   ├── stdfix.h
│   │   │       │   ├── tgmath.h
│   │   │       │   ├── unwind.h
│   │   │       │   └── varargs.h
│   │   │       ├── include-fixed
│   │   │       │   ├── fixed
│   │   │       │   ├── limits.h
│   │   │       │   ├── README
│   │   │       │   └── syslimits.h
│   │   │       ├── install-tools
│   │   │       │   ├── fixinc_list
│   │   │       │   ├── gsyslimits.h
│   │   │       │   ├── include
│   │   │       │   │   ├── limits.h
│   │   │       │   │   └── README
│   │   │       │   ├── macro_list
│   │   │       │   └── mkheaders.conf
│   │   │       ├── libgcc.a
│   │   │       └── libgcov.a
│   │   └── avr32

│   ├── insight1.0
│   │   └── plugins.tcl
│   ├── itcl3.2
│   │   └── pkgIndex.tcl
│   ├── itk3.2
│   │   └── pkgIndex.tcl
│   ├── libiberty.a
│   ├── libitclstub32.a
│   ├── libitkstub32.a
│   ├── libsimulavr.a
│   ├── libsimulavr.la
│   ├── libtcl84.a
│   ├── libtclstub84.a
│   ├── libtk84.a
│   ├── libtkstub84.a
│   ├── reg1.1
│   │   ├── pkgIndex.tcl
│   │   └── tclreg11.dll
│   ├── sta43464
│   ├── stb43464
│   │   └── libcygwin.a
│   ├── tclConfig.sh
│   ├── tk8.4
│   │   └── pkgIndex.tcl
│   └── tkConfig.sh
├── libexec
│   └── gcc
│       ├── avr
│       │   └── 4.3.3
│       │       ├── cc1.exe
│       │       ├── cc1obj.exe
│       │       ├── cc1plus.exe
│       │       ├── collect2.exe
│       │       └── install-tools
│       │           ├── fix-header.exe
│       │           ├── fixincl.exe
│       │           ├── fixinc.sh
│       │           ├── fixproto
│       │           ├── mkheaders
│       │           └── mkinstalldirs
│       └── avr32

├── mfile
│   ├── help.html
│   ├── htmlview.tcl
│   ├── htmlview.xbm
│   ├── makefile_template
│   ├── makefile_template.txt
│   ├── mfile.tcl
│   ├── mfile.xbm
│   └── README
├── path1.log
├── path2.log
├── sample
│   ├── gcc2.bat
│   ├── gcc.bat
│   ├── Makefile
│   ├── Makefile.lib
│   └── Makefile.wpo
├── source
│   ├── avr
│   │   ├── binutils
│   │   │   └── 2.19
│   │   │       ├── 30-binutils-2.19-avr-size.patch
│   │   │       ├── 31-binutils-2.19-avr-coff.patch
│   │   │       ├── 32-binutils-2.19-new-sections.patch
│   │   │       ├── 33-binutils-2.19-data-origin.patch
│   │   │       ├── 34-binutils-2.19-as-dwarf.patch
│   │   │       ├── 35-binutils-2.19-dwarf2-AVRStudio-workaround.patch
│   │   │       ├── 40-binutils-2.19-wrong-arch.patch
│   │   │       ├── 41-binutils-2.19-avr25-wraparound-reloc.patch
│   │   │       ├── 42-binutils-2.19-bug-9841.patch
│   │   │       ├── 50-binutils-2.19-xmega.patch
│   │   │       └── 51-binutils-2.19-new-devices.patch
│   │   ├── gcc
│   │   │   └── 4.3.3
│   │   │       ├── 20-gcc-4.3.3-libiberty-Makefile.in.patch
│   │   │       ├── 21-gcc-4.3.3-disable-libssp.patch
│   │   │       ├── 23-gcc-4.3.3-ada-Makefile.patch
│   │   │       ├── 30-gcc-4.3.3-param-inline-call-cost.patch
│   │   │       ├── 40-gcc-4.3.3-bug-10768-by-adacore.patch
│   │   │       ├── 41-gcc-4.3.3-bug-11259_v3.patch
│   │   │       ├── 42-gcc-4.3.3-bug-spill-v4.patch
│   │   │       ├── 43-gcc-4.3.3-bug-35013.patch
│   │   │       ├── 44-gcc-4.3.3-libgcc16.patch
│   │   │       ├── 45-gcc-4.3.3-bug-33009.patch
│   │   │       ├── 46-gcc-4.3.3-andsi3-wrong-attribute.patch
│   │   │       ├── 47-gcc-4.3.3-bug-18145-v4.patch
│   │   │       ├── 50-gcc-4.3.3-mega256-v2.patch
│   │   │       ├── 51-gcc-4.3.3-xmega-v13.patch
│   │   │       ├── 52-gcc-4.3.3-new-devices.patch
│   │   │       ├── 60-gcc-4.3.3-osmain.patch
│   │   │       ├── 61-gcc-4.3.3-builtins_v6.patch
│   │   │       ├── 62-gcc-4.3.3-ada-mlib.patch
│   │   │       ├── 63-gcc-4.3.3-ada-freestanding.patch
│   │   │       ├── 64-gcc-4.3.3-ada-timebase.patch
│   │   │       ├── 65-gcc-4.3.3-ada-gnat1_print_path.patch
│   │   │       └── 66-gcc-4.3.3-ada-optim_static_addr.patch
│   │   └── insight
│   │       └── 6.8
│   │           └── 50-gdb-6.8-mega256.patch
│   ├── avr32
│   │   ├── binutils
│   │   │   └── 2.19
│   │   │       ├── 20-binutils.2.19-avr32-autoconf.patch
│   │   │       ├── 30-binutils-2.19-avr32-bfd.patch
│   │   │       ├── 31-binutils-2.19-avr32-binutils.patch
│   │   │       ├── 32-binutils-2.19-avr32-gas.patch
│   │   │       ├── 33-binutils-2.19-avr32-include.patch
│   │   │       ├── 34-binutils-2.19-avr32-ld.patch
│   │   │       └── 35-binutils-2.19-avr32-opcodes.patch
│   │   ├── gcc
│   │   │   └── 4.3.2
│   │   │       ├── 30-gcc-4.3.2-avr32.patch
│   │   │       ├── 40-gcc-4.3.2-avr32-fix-f32_to_f64.patch
│   │   │       ├── 41-gcc-4.3.2-avr32-fix-f64_add.patch
│   │   │       ├── 42-gcc-4.3.2-avr32-fix-32bit-div.patch
│   │   │       ├── 43-gcc-4.3.2-avr32-fix-f64_cmp.patch
│   │   │       ├── 44-gcc-4.3.2-avr32-fix-f64_div.patch
│   │   │       ├── 45-gcc-4.3.2-avr32-fix-f64_to_f32.patch
│   │   │       └── 46-gcc-4.3.2-avr32-fix-32bit-div_2.patch
│   │   ├── insight
│   │   │   └── 6.8
│   │   │       ├── 30-gdb-6.8-avr32.patch
│   │   │       ├── 31-gdb-6.8-avr32-bfd.patch
│   │   │       └── 32-gdb-6.8-avr32-opcodes.patch
│   │   └── newlib
│   │       └── 1.16.0
│   │           ├── 10-newlib-1.16.0-winavr.patch
│   │           ├── 30-newlib-1.16.0-avr32.patch
│   │           └── 31-newlib-1.16.0-flashvault.patch
│   ├── avr-libc
│   │   └── now
│   │       ├── 30-avr-libc-1.6.6-remove-debug-info.patch
│   │       └── 31-avr-libc-1.6.6-builtins.patch
│   ├── mingw
│   │   └── 5.1.3
│   │       └── mingw-vista.patch
│   └── SOURCE
├── tree.txt
├── utils
│   ├── bin
│   │   ├── ansi2knr.exe
│   │   ├── AvrCalc.exe
│   │   ├── basename.exe
│   │   ├── bc.exe
│   │   ├── bison.exe
│   │   ├── bison.hairy
│   │   ├── bison.simple
│   │   ├── bunzip2.exe
│   │   ├── bzcat.exe
│   │   ├── bzip2.exe
│   │   ├── cat.exe
│   │   ├── chgrp.exe
│   │   ├── chmod.exe
│   │   ├── chown.exe
│   │   ├── cksum.exe
│   │   ├── cmp.exe
│   │   ├── comm.exe
│   │   ├── compress.exe
│   │   ├── cp.exe
│   │   ├── csplit.exe
│   │   ├── cut.exe
│   │   ├── date.exe
│   │   ├── dc.exe
│   │   ├── dd.exe
│   │   ├── df.exe
│   │   ├── diff3.exe
│   │   ├── diff.exe
│   │   ├── dircolors.exe
│   │   ├── dirname.exe
│   │   ├── du.exe
│   │   ├── echo.exe
│   │   ├── egrep.exe
│   │   ├── env.exe
│   │   ├── expand.exe
│   │   ├── expr.exe
│   │   ├── factor.exe
│   │   ├── false.exe
│   │   ├── fgrep.exe
│   │   ├── find.exe
│   │   ├── flex.exe
│   │   ├── flex.lib
│   │   ├── fmt.exe
│   │   ├── fold.exe
│   │   ├── fromdos.exe
│   │   ├── fsplit.exe
│   │   ├── gawk.exe
│   │   ├── gclip.exe
│   │   ├── gplay.exe
│   │   ├── grep.exe
│   │   ├── gsar.exe
│   │   ├── gunzip.exe
│   │   ├── gzip.exe
│   │   ├── head.exe
│   │   ├── id.exe
│   │   ├── indent.exe
│   │   ├── info.exe
│   │   ├── infokey.exe
│   │   ├── install.exe
│   │   ├── install-info.exe
│   │   ├── join.exe
│   │   ├── jwhois.exe
│   │   ├── less.exe
│   │   ├── ln.exe
│   │   ├── logname.exe
│   │   ├── ls.exe
│   │   ├── m4.exe
│   │   ├── make.exe
│   │   ├── make.exe.old
│   │   ├── makeinfo.exe
│   │   ├── makemsg.exe
│   │   ├── man.exe
│   │   ├── md5sum.exe
│   │   ├── mkdir.exe
│   │   ├── mkfifo.exe
│   │   ├── mknod.exe
│   │   ├── mount.exe
│   │   ├── msys-1.0.dll
│   │   ├── msys-1.0.dll.old
│   │   ├── mvdir.exe
│   │   ├── mv.exe
│   │   ├── nl.exe
│   │   ├── od.exe
│   │   ├── paste.exe
│   │   ├── patch.exe
│   │   ├── pathchk.exe
│   │   ├── pclip.exe
│   │   ├── pr.exe
│   │   ├── printenv.exe
│   │   ├── printf.exe
│   │   ├── ps.exe
│   │   ├── pwd.exe
│   │   ├── rman.exe
│   │   ├── rmdir.exe
│   │   ├── rm.exe
│   │   ├── sdiff.exe
│   │   ├── sed.exe
│   │   ├── seq.exe
│   │   ├── shar.exe
│   │   ├── sh.exe
│   │   ├── sleep.exe
│   │   ├── sort.exe
│   │   ├── split.exe
│   │   ├── stego.exe
│   │   ├── su.exe
│   │   ├── sum.exe
│   │   ├── sync.exe
│   │   ├── tac.exe
│   │   ├── tail.exe
│   │   ├── tar.exe
│   │   ├── tee.exe
│   │   ├── test.exe
│   │   ├── texindex.exe
│   │   ├── todos.exe
│   │   ├── touch.exe
│   │   ├── tr.exe
│   │   ├── true.exe
│   │   ├── type.exe
│   │   ├── uname.exe
│   │   ├── unexpand.exe
│   │   ├── uniq.exe
│   │   ├── unshar.exe
│   │   ├── uudecode.exe
│   │   ├── uuencode.exe
│   │   ├── wc.exe
│   │   ├── wget.exe
│   │   ├── wget.GID
│   │   ├── wget.hlp
│   │   ├── which.exe
│   │   ├── whoami.exe
│   │   ├── xargs.exe
│   │   ├── yes.exe
│   │   └── zcat.exe
│   └── libusb
│       └── bin
│           ├── avrisp2.cat
│           ├── avrisp2.inf
│           ├── avrisp2_x64.cat
│           ├── inf-wizard.exe
│           ├── install-filter.exe
│           ├── jtagice2.cat
│           ├── jtagice2.inf
│           ├── jtagice2_x64.cat
│           ├── libusb0.dll
│           ├── libusb0.sys
│           ├── libusb0_x64.dll
│           ├── libusb0_x64.sys
│           ├── testlibusb.exe
│           └── testlibusb-win.exe
├── WinAVR-20100110-uninstall.exe
├── WinAVR-manifest.log
├── WinAVR-user-manual.html
└── WinAVR-user-manual.txt

("sudo apt-get install tree" if you don't already have a copy of "tree" that produces this output).

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

Using the -B option is another way that seems to work. I read in a bugzilla comment that {target}/bin is meant for internal use by binutils but I've never read any official docs stating that.

john@ubuntu:/usr/local/avr$ avr/bin/gcc -B/usr/local/avr/libexec/gcc/avr/4.3.4 /home/john/src/t.c -S -o -
	.file	"t.c"
__SREG__ = 0x3f
__SP_H__ = 0x3e
__SP_L__ = 0x3d
__CCP__  = 0x34
__tmp_reg__ = 0
__zero_reg__ = 1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@Johan

Have a look here , where ekh gives examples of debugging with a dragon in linux/Codeblocks
https://www.avrfreaks.net/index.p...

You could try to build the AS toolchain (AS4 i think)
https://www.avrfreaks.net/index.p...

Remember to get the fixed delay file from cliff's site , if you use that "deb version" from there.

/Bingo

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

JohanEkdahl wrote:
In /usr/local I see stuff that I do not really understand:

In /usr/local/avr/bin I find the toolchain with the names I recognize from e.g. WinAVR (they have the prefix "avr-"). These are the ones that work as expected.

In /usr/local/avr/avr/bin I find some parts of some toolchain (e.g "gcc" with no prefix).

The anatomy of a GCC installation looks like that:
$prefix/bin             - Programs that the user calls on
                          $host to compile programs for
                          $target
$prefix/$target/bin     - GCC-usable/used executables
                          (binutils, ...)
$prefix/$target/include - Header for $target
$prefix/$target/lib     - (Multi)Libs for $target
$prefix/libexec/gcc/$target/$gcc-version 
                        - Executables for GCC-version
                          (cc1, cc1plus, ...)
$prefix/lib/gcc/$target/$gcc-version
                        - (Multi)Libs for GCC-version
                          for $target

In your case it appears that you have several avr-Tools installed, at least one with
    $prefix = /usr/local
and one with
    $prefix = /usr/local/avr
so that you have two installs badly intertwined and maybe not functional or confusing each other.

avrfreaks does not support Opera. Profile inactive.

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

@Johan (x2) :-)

The .deb on "cliff's site" package was build with PREFIX=/usr/local/avr
It only installs & extracts packages to that dir.

/Bingo

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

Bingo600 wrote:
The .deb on "cliff's site" package was build with PREFIX=/usr/local/avr
Bit unhappy choice because there are also packages with PREFIX=/usr/local IIRC.

avrfreaks does not support Opera. Profile inactive.

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

Quote:

$prefix = /usr/local
and one with
$prefix = /usr/local/avr
so that you have two installs badly intertwined and maybe not functional or confusing each other.


No. This is a fresh Ubuntu 11.04 (in a VirtualBox machine) where I installed the pre-built Bingo-stuff from Cliff's site once.

Quote:

$prefix/$target/bin - GCC-usable/used executables
(binutils, ...)

Could you reformulate that into something a mere mortal can grasp? (Is the "usable/used" really a distinction? Are the other parts of this directory tree devoid of "usable/used" stuff?")

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

The user-called executable is located at $prefix/bin/$target-gcc (or $target-gcc-$version or $target-g++ for C++ resp gcc for native C resp. g++ for native C++ or gcj for Java, ...). These executables (nor gcc/g++ located in $prefix/$target/bin) are the compiler proper; this is located at $prefix/libexec/gcc/$target/$version/cc1 (for C, cc1plus for C++, cc1obj for Objective-C, etc).

Similarly, the compiler driver does not call $prefix/bin/$target-as et al.; instead it calls $prefix/$target/bin/as etc.

See the subtools that your gcc calls by adding -v -Wl,-v to the command line.

The tools that are actually used can be influenced by --sysroot or -B or by several flags at configure time.

avrfreaks does not support Opera. Profile inactive.

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

Quote:
Similarly, the compiler driver does not call $prefix/bin/$target-as et al.; instead it calls $prefix/$target/bin/as etc.

So, is there anything wrong with the user directly using the programs in $prefix/$target/bin/?

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

Puh, that's a question for gcc-help@gcc.gnu.org mailing list, see http://gcc.gnu.org/lists.html.

As far as the compiler is concerned you don't want to call cc1 directly except in the case where you want to debug the compiler: in that case you want to debug the compiler proper and not the compiler driver. For sophisticated differences and historically grown organization and structure please consult the mentioned ML.

avrfreaks does not support Opera. Profile inactive.

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

SprinterSB wrote:
Bingo600 wrote:
The .deb on "cliff's site" package was build with PREFIX=/usr/local/avr
Bit unhappy choice because there are also packages with PREFIX=/usr/local IIRC.

I fail to see the problem

That way the full package is installed in /usr/local/avr , and does not pollute /usr/local

Quote:
bingo@frodo:~$ ls /usr/local/avr
avr bin build etc include info lib libexec man share source

Quote:
avr-gcc -v
Using built-in specs.
Target: avr
Configured with: ../../source/gcc-4.3.4/configure -v --target=avr --disable-nls --prefix=/usr/local/avr --with-gnu-ld --with-gnu-as --enable-languages=c,c++ --disable-libssp --with-dwarf2
Thread model: single
gcc version 4.3.4 (GCC)

/Bingo

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

JohanEkdahl wrote:
So, I can not use /usr/local/avr/bin since I can not even specify that as a base directory (so I never get to the point where I would be able to tell NetBeans that e.g. gcc is rather named avr-gcc).
Or the other way round: Just copy avr-gcc to a file named gcc in the same directory.
JohanEkdahl wrote:
And I can not use /usr/local/avr/avr/bin since the tool chain there seems to be dysfunctional in general.
It's not a "dysfunctional tool chain". It's not intended for for end user except you like to fiddle with, e.g. -B etc

avrfreaks does not support Opera. Profile inactive.

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

Bingo600 wrote:
SprinterSB wrote:
Bingo600 wrote:
The .deb on "cliff's site" package was build with PREFIX=/usr/local/avr
Bit unhappy choice because there are also packages with PREFIX=/usr/local IIRC.

I fail to see the problem

PREFIX=/usr/local is not uncommon so installing an avr-Toolchain in /usr/local will also set up /usr/local/avr etc. I never investigated if two installations of $target-gcc, one in foo and one in foo/$target work properly together. And even if, I'd discourage such mixture.

avrfreaks does not support Opera. Profile inactive.