Issue with RTEMS 4.12 compiler include path

John Harwell jharwell at swri.org
Wed Jun 22 18:39:30 UTC 2016


Gedare,

The command line make uses when attempting to compile my super-simple 
test application is:

/opt/rtems-4.12/bin/sparc-rtems4.12-gcc -O0 -g -D__rtems__ -m32 -W -Wall 
-Wextra -std=gnu99 -fmessage-length=0 
-isystem/opt/rtems-4.12/lib/gcc/sparc-rtems4.12/6.1.1/include 
-isystem/opt/rtems-4.12/lib/gcc/sparc-rtems4.12/6.1.1/include-fixed 
-isystem/opt/rtems-4.12/lib/gcc/sparc-rtems4.12/6.1.1/../../../../sparc-rtems4.12/include 
./tests/spw-test.c  -o bin/spw-test  -lm

All of the system includes that my version of gcc does define are 
included in the command line not because they are needed for building, 
but so that codesonar and the clang static analyzer can easily hook into 
the build process and be able to find all the system definitions for 
proper analysis.

And this is my application:

#include <rtems.h>
#include <bsp.h>
#define CONFIGURE_INIT

rtems_task Init(rtems_task_argument ignored);

#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER 1
#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
#define CONFIGURE_INIT_TASK_STACK_SIZE           (10 * 
RTEMS_MINIMUM_STACK_SIZE)
#define CONFIGURE_MAXIMUM_TASKS 13
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_MAXIMUM_DRIVERS 16
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
#define CONFIGURE_EXTRA_TASK_STACKS              (10 * 
RTEMS_MINIMUM_STACK_SIZE)
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES rtems_resource_unlimited(10)
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 
rtems_resource_unlimited(10)
#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES rtems_resource_unlimited(10)
#define CONFIGURE_UNIFIED_WORK_AREAS
#include <rtems/confdefs.h>

rtems_task Init(
     rtems_task_argument __unused ignored)
{

} /* Init() */

This results in the following error:
fatal error: rtems.h: No such file or directory

However, if I add -I/opt/rtems-4.12/sparc-rtems4.12/leon3/lib/include to 
the command line (the location of rtems.h), then everything works fine. 
My understanding is that this is a "system" include directory that 
should be one of the default paths searched by the compiler.

Thanks for your help!

John Harwell
Southwest Research Institute

On 06/22/2016 12:30 PM, Gedare Bloom wrote:
> I was not clear, what was your Makefile, or how do you build your
> "very simple application"? Perhaps you can provide it as a compressed
> folder.
>
> On Wed, Jun 22, 2016 at 11:59 AM, John Harwell <jharwell at swri.org> wrote:
>> Here is the Makefile that configure generated. Hope this helps.
>>
>>
>> On 06/22/2016 10:53 AM, Gedare Bloom wrote:
>>> What is your makefile?
>>>
>>> On Tue, Jun 21, 2016 at 3:15 PM, John Harwell <jharwell at swri.org> wrote:
>>>> Hello,
>>>>
>>>> I have been able to successfully build what I think is the SMP version of
>>>> RTEMS 4.12 for SPARC by downloading and building the tools:
>>>>
>>>> ../source-builder/sb-set-builder --prefix=/opt/rtems-4.12
>>>> 4.12/rtems-sparc
>>>>
>>>> And configuring, building, and installing RTEMS:
>>>> ../rtems/configure --prefix=/opt/rtems-4.12 --target=sparc-rtems4.12
>>>> --enable-posix --enable-rtemsbsp="leon3" --enable-tests=samples
>>>> --enable-smp
>>>> CONSOLE_USE_INTERRUPTS=0
>>>> make install
>>>>
>>>> I got the configure line from a README I found on the Gaisler site.
>>>>
>>>> However, after building RTEMS and then attempting to build a very simple
>>>> application consisting only of an empty Init(), I get the following error
>>>> message:
>>>>
>>>> fatal error: rtems.h: No such file or directory
>>>>
>>>> I  do have rtems.h in /opt/rtems-4.12/sparc-rtems/leon3/lib/include, but
>>>> that path is not in the compiler built-in search path. I can get around
>>>> this
>>>> but manually adding this directory to the include path, but I'm wondering
>>>> if
>>>> I configured something incorrectly in the build process which caused this
>>>> to
>>>> happen.
>>>>
>>>> Here is the information of the compiler:
>>>> Using built-in specs.
>>>> COLLECT_GCC=/opt/rtems-4.12/bin/sparc-rtems4.12-gcc
>>>> Target: sparc-rtems4.12
>>>> Configured with: ../gcc-6-20160609/configure --prefix=/opt/rtems-4.12
>>>> --bindir=/opt/rtems-4.12/bin --exec_prefix=/opt/rtems-4.12
>>>> --includedir=/opt/rtems-4.12/include --libdir=/opt/rtems-4.12/lib
>>>> --libexecdir=/opt/rtems-4.12/libexec --mandir=/opt/rtems-4.12/share/man
>>>> --infodir=/opt/rtems-4.12/share/info --datadir=/opt/rtems-4.12/share
>>>> --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-rtems4.12
>>>> --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --verbose
>>>> --with-newlib
>>>> --with-system-zlib --disable-nls --without-included-gettext
>>>> --disable-win32-registry --enable-version-specific-runtime-libs
>>>> --disable-lto --enable-newlib-io-c99-formats --enable-newlib-iconv
>>>>
>>>> --enable-newlib-iconv-encodings=big5,cp775,cp850,cp852,cp855,cp866,euc_jp,euc_kr,euc_tw,iso_8859_1,iso_8859_10,iso_8859_11,iso_8859_13,iso_8859_14,iso_8859_15,iso_8859_2,iso_8859_3,iso_8859_4,iso_8859_5,iso_8859_6,iso_8859_7,iso_8859_8,iso_8859_9,iso_ir_111,koi8_r,koi8_ru,koi8_u,koi8_uni,ucs_2,ucs_2_internal,ucs_2be,ucs_2le,ucs_4,ucs_4_internal,ucs_4be,ucs_4le,us_ascii,utf_16,utf_16be,utf_16le,utf_8,win_1250,win_1251,win_1252,win_1253,win_1254,win_1255,win_1256,win_1257,win_1258
>>>> --enable-threads --disable-plugin --enable-libgomp
>>>> --enable-languages=c,c++
>>>> Thread model: rtems
>>>> gcc version 6.1.1 20160609 (RTEMS 4.12, RSB
>>>> c476de6150f39afdf142c6f4420c59ba2f1aa2fe, Newlib 2.4.0.20160527) (GCC)
>>>> COLLECT_GCC_OPTIONS='-E' '-v' '-mcpu=v7'
>>>>    /opt/rtems-4.12/libexec/gcc/sparc-rtems4.12/6.1.1/cc1 -E -quiet -v -
>>>> -mcpu=v7
>>>> ignoring nonexistent directory
>>>>
>>>> "/opt/rtems-4.12/lib/gcc/sparc-rtems4.12/6.1.1/../../../../sparc-rtems4.12/sys-include"
>>>> #include "..." search starts here:
>>>> #include <...> search starts here:
>>>>    /opt/rtems-4.12/lib/gcc/sparc-rtems4.12/6.1.1/include
>>>>    /opt/rtems-4.12/lib/gcc/sparc-rtems4.12/6.1.1/include-fixed
>>>>
>>>>
>>>> /opt/rtems-4.12/lib/gcc/sparc-rtems4.12/6.1.1/../../../../sparc-rtems4.12/include
>>>> End of search list.
>>>> # 1 "<stdin>"
>>>> # 1 "<built-in>"
>>>> # 1 "<command-line>"
>>>> # 1 "<stdin>"
>>>>
>>>> COMPILER_PATH=/opt/rtems-4.12/libexec/gcc/sparc-rtems4.12/6.1.1/:/opt/rtems-4.12/libexec/gcc/sparc-rtems4.12/6.1.1/:/opt/rtems-4.12/libexec/gcc/sparc-rtems4.12/:/opt/rtems-4.12/lib/gcc/sparc-rtems4.12/6.1.1/:/opt/rtems-4.12/lib/gcc/sparc-rtems4.12/:/opt/rtems-4.12/lib/gcc/sparc-rtems4.12/6.1.1/../../../../sparc-rtems4.12/bin/
>>>>
>>>> LIBRARY_PATH=/opt/rtems-4.12/lib/gcc/sparc-rtems4.12/6.1.1/:/opt/rtems-4.12/lib/gcc/sparc-rtems4.12/6.1.1/../../../../sparc-rtems4.12/lib/
>>>> COLLECT_GCC_OPTIONS='-E' '-v' '-mcpu=v7'
>>>>
>>>> Thanks,
>>>>
>>>> John Harwell
>>>> Southwest Research Institute
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> users mailing list
>>>> users at rtems.org
>>>> http://lists.rtems.org/mailman/listinfo/users
>>



More information about the users mailing list