Author Topic: Avr-gcc project on x86_64 and gnu/stubs-32.h file  (Read 13462 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12121
    • Travis build status
Re: Avr-gcc project on x86_64 and gnu/stubs-32.h file
« Reply #15 on: August 11, 2011, 03:10:18 pm »
Seems the autodetection fails, see for the details: CompilerGNUAVR::AutoDetectInstallationDir()

http://svn.berlios.de/wsvn/codeblocks/trunk/src/plugins/compilergcc/compilerGNUAVR.cpp?peg=7359

Seems like the m_MasterPath is not set correctly.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Difool

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Avr-gcc project on x86_64 and gnu/stubs-32.h file
« Reply #16 on: August 11, 2011, 03:11:59 pm »
Please close C::B and rename the default.conf.
Than restart C::B, so the configuration is rebuild from scratch and check the "Search directories".

/usr/include always appear in the search directory

I've already do this ...
And I said I had tested with two differents linux distribs (Fedora & Ubuntu), both are fresh installs (in fact, with Live CD ...).
So, they haven't ~/.codeblocks/default.conf
« Last Edit: August 11, 2011, 03:26:43 pm by Difool »

Offline Difool

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Avr-gcc project on x86_64 and gnu/stubs-32.h file
« Reply #17 on: August 11, 2011, 03:18:08 pm »
Seems the autodetection fails, see for the details: CompilerGNUAVR::AutoDetectInstallationDir()

http://svn.berlios.de/wsvn/codeblocks/trunk/src/plugins/compilergcc/compilerGNUAVR.cpp?peg=7359

Seems like the m_MasterPath is not set correctly.

m_MasterPath is set by :
Code: [Select]
    if (platform::windows)
    {
      ....
    }
    else // if platform::linux
        m_MasterPath = _T("/usr");

But what is the usefulness of adding this include path ?
Code: [Select]
AddIncludeDir(m_MasterPath + sep + _T("include"));

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Avr-gcc project on x86_64 and gnu/stubs-32.h file
« Reply #18 on: August 11, 2011, 03:20:45 pm »
After installing avr-gcc, I cam confirm this issue.

If the compiler-plugin detects the gnu-avr-gcc compiler it adds /usr/include and /usr/lib to the appropriate search dirs, but this is (of course) wrong for a cross-compiler.
I guess none of these is normally needed as long as only compiler-included headers and libs are used, because the compiler normally knows where to search.
I am not sure if it is needed on windows, normally it should not.

The wrong search-dirs are only added, if auto-detection does not fail:
Code: [Select]
   AutoDetectResult ret = wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C) ? adrDetected : adrGuessed;
    if (ret == adrDetected)
    {
        if (platform::windows)
        {
            AddIncludeDir(m_MasterPath + sep + _T("avr\\include"));
            AddLibDir(m_MasterPath + sep + _T("avr\\lib"));
            m_ExtraPaths.Add(m_MasterPath + sep + _T("utils") + sep + _T("bin")); // for make
        }
        else
        {
            AddIncludeDir(m_MasterPath + sep + _T("include"));
            AddLibDir(m_MasterPath + sep + _T("lib"));
        }
    }

m_MasterPath is /usr, because the executables are in /usr/bin as nearly in all cases on linux.
That's the cause, why I did not see them until I installed the compiler.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Avr-gcc project on x86_64 and gnu/stubs-32.h file
« Reply #19 on: August 11, 2011, 03:22:16 pm »
Seems the autodetection fails, see for the details: CompilerGNUAVR::AutoDetectInstallationDir()

http://svn.berlios.de/wsvn/codeblocks/trunk/src/plugins/compilergcc/compilerGNUAVR.cpp?peg=7359

Seems like the m_MasterPath is not set correctly.

m_MasterPath is set by :
Code: [Select]
    if (platform::windows)
    {
      ....
    }
    else // if platform::linux
        m_MasterPath = _T("/usr");

But what is the usefulness of adding this include path ?
Code: [Select]
AddIncludeDir(m_MasterPath + sep + _T("include"));
As posted before: master path is set correctly, but the search-dirs are not (and most likely not needed).

Offline Difool

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Avr-gcc project on x86_64 and gnu/stubs-32.h file
« Reply #20 on: August 11, 2011, 03:40:04 pm »
Yes, so the AutoDetectInstallationDir() function seems to be useless and even undesirable. (It remains to be confirmed for Windows).
Should I open a ticket on the bugtracker for this ?
« Last Edit: August 11, 2011, 03:42:03 pm by Difool »