[Nix-dev] avr-gcc and .o include dirs?

Marc Weber marco-oweber at gmx.de
Wed Feb 11 23:10:15 CET 2009


Hi.

I've encountered a nix specific issue. On of those you don't even think
about when not using nix.

The problem:
avrlibc creates a mcu (microcontroller unit) specific .o file.
That one is needed to link the final program.
The search path for .o files is hardcoded into gcc, correct?
Because normal distributions put everything into the same directory
there is no problem.

I can think about the following solutions:
* patch avrlibc to use static libraries instead of .o files. You can tell
  gcc where they are by adding -L
* patch gcc to accept an additional env var called NIX_OBJECT_DIRS
  pointing to those directories
* install everything into the same profile and hope that it'll work.
  (strace showed an path_to_gcc/../../../avr/lib path so it should
* copy the .o file into the local working directory (cumbersome!)
* .. ?

Does the i686 and x86_64 gcc compilers suffer from the same problem?
Does such a use case (importing .o files) exist?

Marc Weber



More information about the nix-dev mailing list