rtems-tools building error

Denis Obrezkov denisobrezkov at gmail.com
Sun Jan 8 07:54:45 UTC 2017


2017-01-08 1:36 GMT+02:00 Denis Obrezkov <denisobrezkov at gmail.com>:

> 2017-01-08 1:27 GMT+02:00 Joel Sherrill <joel at rtems.org>:
>
>>
>>
>> On Sat, Jan 7, 2017 at 3:59 PM, Denis Obrezkov <denisobrezkov at gmail.com>
>> wrote:
>>
>>> Hello,
>>> I cloned rtems-tools from https://git.rtems.org/rtems-tools
>>> and I can't build them:
>>>
>>> ~/Projects/rtems/rtems-tools$ ./waf configure
>>> --prefix=$HOME/Projects/rtems/4.11
>>> Setting top to                           : /home/reprofy/Projects/rtems/r
>>> tems-tools
>>> Setting out to                           : /home/reprofy/Projects/rtems/r
>>> tems-tools/build
>>> Version                                  : 4.12.516f9311e61f (4.12)
>>> Checking for program 'python'            : /usr/bin/python
>>> Checking for python version              : (2, 7, 9, 'final', 0)
>>> Checking for 'gcc' (C compiler)          : /usr/bin/gcc
>>> Checking for 'g++' (C++ compiler)        : /usr/bin/g++
>>> Checking for header alloca.h             : yes
>>> Checking for header fcntl.h              : yes
>>> Checking for header process.h            : not found
>>> Checking for header stdlib.h             : yes
>>> Checking for header string.h             : yes
>>> Checking for header strings.h            : yes
>>> Checking for header sys/file.h           : yes
>>> Checking for header sys/stat.h           : yes
>>> Checking for header sys/time.h           : yes
>>> Checking for header sys/types.h          : yes
>>> Checking for header sys/wait.h           : yes
>>> Checking for header unistd.h             : yes
>>> Checking for header vfork.h              : not found
>>> Checking for function getrusage          : yes
>>> Checking for program 'm4'                : /usr/bin/m4
>>> Checking for header sys/wait.h           : yes
>>> Checking for function kill               : yes
>>> Checking for function open64             : not found
>>> Checking for function stat64             : not found
>>> 'configure' finished successfully (0.585s)
>>> reprofy at repdell:~/Projects/rtems/rtems-tools$ ./waf build install
>>> Waf: Entering directory `/home/reprofy/Projects/rtems/rtems-tools/build'
>>> [  5/145] Compiling rtemstoolkit/elftoolchain/libelf/elf.c
>>> [ 12/145] Compiling rtemstoolkit/elftoolchain/libelf/elf_fill.c
>>> [ 13/145] Compiling rtemstoolkit/elftoolchain/libelf/elf_flag.c
>>> [ 14/145] Compiling rtemstoolkit/elftoolchain/libelf/elf_getarhdr.c
>>> ../rtemstoolkit/elftoolchain/libelf/elf.c:34:29: error: expected
>>> expression before ‘,’ token
>>>   .libelf_arch  = LIBELF_ARCH,
>>>                              ^
>>>
>>>
>> :LIBELF_ARCH is defined based on the architecture libelf is being compiled
>> for. The file elf.c is pretty simple and LIBELF is conditionally defined
>> in this file:
>>
>> https://git.rtems.org/rtems-tools/plain/rtemstoolkit/elftool
>> chain/libelf/_libelf_config.h
>>
>> Since the definition of LIBARCH_ARCH is dependent on the host
>> architecture,
>> what host are you compiling on?
>>
>> Also the following command will show you all the gcc predefines. Is one
>> of them
>> for the architecture in the libelf_config.h file?
>>
>> gcc -dM -E - </dev/null | less
>>
>>
>>> Waf: Leaving directory `/home/reprofy/Projects/rtems/rtems-tools/build'
>>> Build failed
>>>  -> task in 'elf' failed (exit status 1):
>>>         {task 140143375691152: c elf.c -> elf.c.5.o}
>>> ['/usr/bin/gcc', '-pipe', '-g', '-O2', '-I/home/reprofy/Projects/rtems/rtems-tools/build',
>>> '-I/home/reprofy/Projects/rtems/rtems-tools/build/rtemstoolkit/elftoolchain/libelf',
>>> '-I/home/reprofy/Projects/rtems/rtems-tools/rtemstoolkit/elftoolchain/libelf',
>>> '-I/home/reprofy/Projects/rtems/rtems-tools/build/rtemstoolkit/elftoolchain/common',
>>> '-I/home/reprofy/Projects/rtems/rtems-tools/rtemstoolkit/elftoolchain/common',
>>> '../rtemstoolkit/elftoolchain/libelf/elf.c', '-c', '-o',
>>> '/home/reprofy/Projects/rtems/rtems-tools/build/rtemstoolkit
>>> /elftoolchain/libelf/elf.c.5.o']
>>>
>>> --
>>> Regards, Denis Obrezkov
>>>
>>> _______________________________________________
>>> users mailing list
>>> users at rtems.org
>>> http://lists.rtems.org/mailman/listinfo/users
>>>
>>
>>
> Information about my host system:
> Debian GNU/Linux 8.6 (jessie)
> SMP Debian 4.2.6-3~bpo8+2 (2015-12-14) x86_64 GNU/Linux
>
> I thought, may be some symbols undefined, and _libelf_config.h can't
> define
> LIBELF_ARCH, but actually I found out that __linux__ symbol is defined in
> my gcc.
>
>
> --
> Regards, Denis Obrezkov
>

It seems that I found the solution.
This is my output from readelf program:
readelf -h SomeFile
Заголовок ELF:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Класс:                             ELF64
  Данные:                            дополнение до 2, little endian
  Версия:                            1 (current)
  OS/ABI:                            UNIX - System V
  Версия ABI:                        0
  Тип:                               EXEC (Исполняемый файл)
  Машина:                            Advanced Micro Devices X86-64
  Версия:                            0x1
  Адрес точки входа:               0x401bb0
  Начало заголовков программы:          64 (байт в файле)
  Начало заголовков программы:          584096 (байт в файле)
  Флаги:                             0x0
  Размер этого заголовка:            64 (байт)
  Размер заголовков программы:       56 (байт)
  Число заголовков программы:        9
  Размер заголовков раздела:         64 (байт)
  Число заголовков раздела:          40
  Индекс табл. строк загол. раздела: 37

its fields are in Russian, so I just changed search  fields in native-elf
format script
and it works.

-- 
Regards, Denis Obrezkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20170108/bb6569aa/attachment.html>


More information about the users mailing list